docker-offlineimap/offlineimap/folder
Tobias Thierer caef9a72fc Fix IMAP folder throwing away time zone when parsing email Date headers
Fix imapfolder.getmessageinternaldate misparsing the Date:
header from emails due to a bug or surprising behaviour by
email.utils.parsedate. This is because email.utils.parsedate's
return value contains the unadjusted hour value from the string
parsed but does not include information about the time zone in
which it is specified. For example (Python 2.7.3):

$ python -c "import email.utils;
  print email.utils.parsedate('Mon, 20 Nov 1995 19:12:08 -0500')"
 (1995, 11, 20, 19, 12, 8, 0, 1, -1)

(the -1 is the isdst field); the -0500 time zone is completely
ignored, so e.g. the same input with time "19:12:08 +0300" has
the same result. When passed to time.struct_time as allowed per
the parsedate documentation, this time is interpreted in GMT and
thus deviates from the correct value by the timezone offset
(in this example, -5 hours).

I consider this a bug in email.utils.parsedate: In my opinion,
since the return value of the parsetime doesn't include a timezone,
it should be expressed in terms of UTC rather than in terms of the
time zone from the Date header; the existence of
email.utils.parsedate_tz, to which I've switched, indicates that
maybe the authors were aware of this problem.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-10-03 11:16:13 +02:00
..
__init__.py Use "from . import" for relative imports 2012-02-06 17:41:43 +01:00
Base.py Determine folder syncing on Folder initialization 2012-09-01 02:30:46 +02:00
Gmail.py Use "from . import" for relative imports 2012-02-06 17:41:43 +01:00
IMAP.py Fix IMAP folder throwing away time zone when parsing email Date headers 2012-10-03 11:16:13 +02:00
LocalStatus.py Use "with lock" pattern 2012-08-31 22:34:53 +02:00
LocalStatusSQLite.py Prevent modifications on a folder level to occur in dry-run 2012-02-17 13:17:05 +01:00
Maildir.py Prevent modifications on a folder level to occur in dry-run 2012-02-17 13:17:05 +01:00
UIDMaps.py Add missing OfflineImapError import in folder/UIDMaps.py 2012-07-30 20:10:11 +02:00