~openerp-dev/openobject-addons/6.1-opw-575216-skh

Viewing all changes in revision 6870.

  • Committer: Olivier Dony
  • Date: 2012-07-02 15:41:06 UTC
  • Revision ID: odo@openerp.com-20120702154106-mwdrd9bv9xvbde0s
[FIX] mail: more reliable parsing of Date header to avoid rejecting emails

dateutil.parser.parse() was failing to parse the date on
some seemingly non-standard Date headers including trailing
extra TZ info, such as:
 "Thu, 28 Jun 2012 18:09:47 +0200 (GMT+02:00)"
RFC2822 seems to only mention the +XXXX offset format, but
apparently other formats are employed in the wild, such
as this one coming from the Zimbra webclient.
The fuzzy matching copes with that, and an extra try/except
block was added for good measure, with a fallback on the
current datetime, should the parsing still fail.

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: