Hi Vishal, I think you misunderstood my point. Actually I do receive mails in Chinese into the CRM system. The problem happens with some mails that seems to have wrong format for the date: check the trackback on my first message. Some mails when they arrive have the date like
'Date: Tue, 12 July 2011' Instead of 'Tue, 12 July 2011' The problem is when this happens fecthmail tries over and over to get this email and crashes all cron jobs. So what we should at least check in the code is that the date is properly formated else take the date of the day. Eric CAUDAL [email protected] <mailto:[email protected]> Cell phone: + 86 186 2136 1670 Elico Corp, Shanghai OpenERP Ready Partner http://www.elico-corp.com On 29/07/2011 21:00, Vishal Parmar(Open ERP) wrote: > ** Attachment added: "mail_message.png" > > https://bugs.launchpad.net/openobject-addons/+bug/812072/+attachment/2240548/+files/mail_message.png > > ** Changed in: openobject-addons > Status: New => Incomplete > -- You received this bug notification because you are a member of C2C OERPScenario, which is subscribed to the OpenERP Project Group. https://bugs.launchpad.net/bugs/812072 Title: Invalid Mail Message Date format makes fetchmail crash permanently Status in OpenERP Modules (addons): Incomplete Bug description: A date format causes the cron job to crash and cannot recover. [2011-07-18 08:22:40,863][company] INFO:imap:fetchmail start checking for new emails on [email protected] [2011-07-18 08:22:41,245][company] DEBUG:tools:tools.misc.html2plaintext: cannot use BeautifulSoup, fallback to lxml.etree.HTMLParser [2011-07-18 08:22:41,273][company] DEBUG:translate:no translation language detected, skipping translation for "'receive'" [2011-07-18 08:22:41,280][company] ERROR:db.cursor:bad query: insert into "mailgate_message" (id,"description","server_type","email_bcc","email_to","email_cc","date","partner_id","server_id","user_id","name","email_from","references","model","res_id","message_id","history",create_uid,create_date) values (2714,E' ×ð¾´µÄÓû§ÄúºÃ: ½üÆÚÒòÃÜÂë¼òµ¥¶øÔì³ÉÓÊÏäÕ˺ű»µÁÇé¿öƵ·¢£¬ÎªÁË·ÀÖ¹ÄúÕý³£µÄÓÊÏäÕ˺ű»ÓÃÓÚ·Ç·¨À¬»øÓʼþ·¢ËÍ£¬ÎÒÃǶÔϵͳÔö¼ÓÁËÈõÃÜÂë¼ì²â¹æÔò£¬ ¾ÏµÍ³¼ì²âÄúµÄÃÜÂë¹ýÓÚ¼òµ¥,¼«Ò×±»·Ç·¨·Ö×Ó½øÐÐÃÜÂëÆÆ½â£¬µ«ÊÇÓÉÓÚÄúµÄÃÜÂëÊôÓÚ¼ÓÃÜÐÅÏ¢£¬ÎÒÃÇÎÞ·¨²é¿´£¬ËùÒÔÇëÄú×ÔÐм°Ê±ÊÖ¶¯ÐÞ¸ÄÃÜ Â룬·ñÔòϵͳ½«ÏÞÖÆÄúÿÈÕÍâ·¢ÓʼþµÄÊýÁ¿Îª20·â£¬ÐÞ¸ÄÍêÃÜÂëºóϵͳ½«×Ô¶¯È¡Ïû¶ÔÄúµÄÓÊÏäÏÞÖÆ! *ÃÜÂëÉèÖÃСÌùÊ¿* ÇëÄú²ÉÄÉÎÒÃÇÌṩ¸øÄúµÄÒÔϹØÓÚÃÜÂëÉèÖõÄС½¨Ò飺 1. ÃÜÂ볤¶È±ØÐëÔÚ6-20λ 2. ±ØÐë²ÉÓÃÎÞÐòµÄ¡°×Öĸ+Êý×Ö¡±µÄ×éºÏ·½Ê½£»¸ñʽÈ磺c1h2i3n4a5 3. ²»Òª²ÉÓõÝÔö»òÕߵݼõµÄÄÚÈÝ£¬È磺¡°ABCD1234¡±¡¢¡°4321DCBA¡±£¬ÒòΪÕâÑùµÄÃÜÂëºÜÈÝÒ×±»ÃÜÂë¼ÆË㹤¾ßËùÆÆ½â£» 4. ÃÜÂëÖв»Òª°üº¬ÓʼþÕ˺ż°ÓʼþÓòÃû 5. Èç¹ûÄúʹÓÿͻ§¶ËÈí¼þ£¨foxmail,outlookµÈ£©ÊÕ·¢Óʼþ£¬ÔÚwebmailÉÏÐÞ¸ÄÃÜÂëºó£¬ÇëÁ¢¼´½øÈë¿Í»§¶Ëͬ²½½øÐÐÃÜÂëÉèÖ㬷ñÔò¿Í»§¶Ë½«ÎÞ·¨Õý³£ÊÕ·¢Óʼþ¡£ ±£»¤ÄúµÄÓÊÏäÃÜÂ룬¾ÍÊDZ£»¤ÄúÆóÒµµÄÎÞÐÎ×ʲú£¬¸ÐлÄú¶ÔÖйúÍòÍø¡°ÈõÃÜÂëÓÅ»¯¡±¹¤×÷С×éµÄÖ§³Ö£¡ ',E'imap',NULL,E'[email protected]',NULL,E'Date: Tue, 12 Jul 2011 01:29:56 +0800',NULL,6,10,E'ÄúµÄÃÜÂë¹ýÓÚ¼òµ¥, Ç뾡¿ìÐÞ¸Ä!',E'[email protected];',NULL,E'crm.lead',698,E'<1310405396$19244$22878693@[email protected]>',E'True',10,now()) Traceback (most recent call last): File "/usr/local/lib/python2.6/dist-packages/openerp- server_9040/sql_db.py", line 131, in execute res = self._obj.execute(query, params) DataError: invalid input syntax for type timestamp: "Date: Tue, 12 Jul 2011 01:29:56 +0800" LINE 23: ',E'imap',NULL,E'[email protected]',NULL,E'Date: Tue, 12 J... ^ [2011-07-18 08:22:41,281][company] WARNING:imap:[01]: invalid input syntax for type timestamp: "Date: Tue, 12 Jul 2011 01:29:56 +0800" [2011-07-18 08:22:41,281][company] WARNING:imap:[02]: LINE 23: ',E'imap',NULL,E'[email protected]',NULL,E'Date: Tue, 12 J... [2011-07-18 08:22:41,281][company] WARNING:imap:[03]: ^ [2011-07-18 08:22:41,282][company] ERROR:db.cursor:bad query: SELECT email_server.active,email_server.user,email_server.date,email_server.password,email_server.port,email_server.note,email_server.user_id,email_server.name,email_server.is_ssl,email_server.object_id,email_server.server,email_server.priority,email_server.attach,email_server.state,email_server.type,email_server.action_id,email_server.id FROM "email_server" WHERE email_server.id IN (7) ORDER BY id Traceback (most recent call last): File "/usr/local/lib/python2.6/dist-packages/openerp- server_9040/sql_db.py", line 131, in execute res = self._obj.execute(query, params) InternalError: current transaction is aborted, commands ignored until end of transaction block [2011-07-18 08:22:41,283][company] WARNING:imap:current transaction is aborted, commands ignored until end of transaction block [2011-07-18 08:22:41,284][company] ERROR:db.cursor:bad query: SELECT email_server.active,email_server.user,email_server.date,email_server.password,email_server.port,email_server.note,email_server.user_id,email_server.name,email_server.is_ssl,email_server.object_id,email_server.server,email_server.priority,email_server.attach,email_server.state,email_server.type,email_server.action_id,email_server.id FROM "email_server" WHERE email_server.id IN (8) ORDER BY id Traceback (most recent call last): File "/usr/local/lib/python2.6/dist-packages/openerp- server_9040/sql_db.py", line 131, in execute res = self._obj.execute(query, params) InternalError: current transaction is aborted, commands ignored until end of transaction block I temporarily changed the mail_gateway/History function around line 162 as followed: # 'date': email_date or time.strftime('%Y-%m-%d %H:%M:%S'), 'date': time.strftime('%Y-%m-%d %H:%M:%S'),#EC To manage notifications about this bug go to: https://bugs.launchpad.net/openobject-addons/+bug/812072/+subscriptions _______________________________________________ Mailing list: https://launchpad.net/~c2c-oerpscenario Post to : [email protected] Unsubscribe : https://launchpad.net/~c2c-oerpscenario More help : https://help.launchpad.net/ListHelp

