← Back to team overview

c2c-oerpscenario team mailing list archive

Re: [Bug 812072] Re: Invalid Mail Message Date format makes fetchmail crash permanently

 

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
eric.caudal@xxxxxxxxxxxxxx  <mailto:caudaleric@xxxxxxxxxxxxxx>
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 contact@xxxxxxxxxxxxxx

  [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'&#13;

  ×ð¾´µÄÓû§ÄúºÃ:

  &#13;

  ½üÆÚÒòÃÜÂë¼òµ¥¶øÔì³ÉÓÊÏäÕ˺ű»µÁÇé¿öƵ·¢£¬ÎªÁË·ÀÖ¹ÄúÕý³£µÄÓÊÏäÕ˺ű»ÓÃÓÚ·Ç·¨À¬»øÓʼþ·¢ËÍ£¬ÎÒÃǶÔϵͳÔö¼ÓÁËÈõÃÜÂë¼ì²â¹æÔò£¬&#13;

  ¾­ÏµÍ³¼ì²âÄúµÄÃÜÂë¹ýÓÚ¼òµ¥,¼«Ò×±»·Ç·¨·Ö×Ó½øÐÐÃÜÂëÆƽ⣬µ«ÊÇÓÉÓÚÄúµÄÃÜÂëÊôÓÚ¼ÓÃÜÐÅÏ¢£¬ÎÒÃÇÎÞ·¨²é¿´£¬ËùÒÔÇëÄú×ÔÐм°Ê±ÊÖ¶¯ÐÞ¸ÄÃÜ&#13;

  Â룬·ñÔòϵͳ½«ÏÞÖÆÄúÿÈÕÍâ·¢ÓʼþµÄÊýÁ¿Îª20·â£¬ÐÞ¸ÄÍêÃÜÂëºóϵͳ½«×Ô¶¯È¡Ïû¶ÔÄúµÄÓÊÏäÏÞÖÆ!

  &#13;

  *ÃÜÂëÉèÖÃСÌùÊ¿*

  &#13;

  ÇëÄú²ÉÄÉÎÒÃÇÌṩ¸øÄúµÄÒÔϹØÓÚÃÜÂëÉèÖõÄС½¨Ò飺

  &#13;

  1. ÃÜÂ볤¶È±ØÐëÔÚ6-20λ

  &#13;

  2. ±ØÐë²ÉÓÃÎÞÐòµÄ¡°×Öĸ+Êý×Ö¡±µÄ×éºÏ·½Ê½£»¸ñʽÈ磺c1h2i3n4a5

  &#13;

  3.
  ²»Òª²ÉÓõÝÔö»òÕߵݼõµÄÄÚÈÝ£¬È磺¡°ABCD1234¡±¡¢¡°4321DCBA¡±£¬ÒòΪÕâÑùµÄÃÜÂëºÜÈÝÒ×±»ÃÜÂë¼ÆË㹤¾ßËùÆƽ⣻

  &#13;

  4. ÃÜÂëÖв»Òª°üº¬ÓʼþÕ˺ż°ÓʼþÓòÃû

  &#13;

  5.
  Èç¹ûÄúʹÓÿͻ§¶ËÈí¼þ£¨foxmail,outlookµÈ£©ÊÕ·¢Óʼþ£¬ÔÚwebmailÉÏÐÞ¸ÄÃÜÂëºó£¬ÇëÁ¢¼´½øÈë¿Í»§¶Ëͬ²½½øÐÐÃÜÂëÉèÖ㬷ñÔò¿Í»§¶Ë½«ÎÞ·¨Õý³£ÊÕ·¢Óʼþ¡£

  &#13;

  ±£»¤ÄúµÄÓÊÏäÃÜÂ룬¾ÍÊDZ£»¤ÄúÆóÒµµÄÎÞÐÎ×ʲú£¬¸ÐлÄú¶ÔÖйúÍòÍø¡°ÈõÃÜÂëÓÅ»¯¡±¹¤×÷С×éµÄÖ§³Ö£¡&#13;

  ',E'imap',NULL,E'contact@xxxxxxxxxxxxxx',NULL,E'Date: Tue, 12 Jul 2011
  01:29:56 +0800',NULL,6,10,E'ÄúµÄÃÜÂë¹ýÓÚ¼òµ¥,
  Ç뾡¿ìÐÞ¸Ä!',E'do_not_reply@xxxxxxxxxxx;',NULL,E'crm.lead',698,E'<1310405396$19244$22878693@do_not_reply@xxxxxxxxxxx>',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'contact@xxxxxxxxxxxxxx',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'contact@xxxxxxxxxxxxxx',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


References