/offlineimap/head: changeset 143
No longer throws an exception when updating messages with strange Date headers; will just set IMAP Internaldate to the current date.
This commit is contained in:
parent
0f104249ee
commit
57ba2d0e85
@ -1,6 +1,8 @@
|
|||||||
offlineimap (3.0.3) unstable; urgency=low
|
offlineimap (3.0.3) unstable; urgency=low
|
||||||
|
|
||||||
* Placeholder.
|
* No longer throws an exception when updating messages with strange
|
||||||
|
Date headers; will just set IMAP Internaldate to the current date.
|
||||||
|
Closes: #153425.
|
||||||
|
|
||||||
-- John Goerzen <jgoerzen@complete.org> Thu, 18 Jul 2002 17:46:13 -0500
|
-- John Goerzen <jgoerzen@complete.org> Thu, 18 Jul 2002 17:46:13 -0500
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
from Base import BaseFolder
|
from Base import BaseFolder
|
||||||
from offlineimap import imaputil, imaplib
|
from offlineimap import imaputil, imaplib
|
||||||
import rfc822
|
import rfc822, time
|
||||||
from StringIO import StringIO
|
from StringIO import StringIO
|
||||||
from copy import copy
|
from copy import copy
|
||||||
|
|
||||||
@ -105,7 +105,10 @@ class IMAPFolder(BaseFolder):
|
|||||||
|
|
||||||
message = rfc822.Message(StringIO(content))
|
message = rfc822.Message(StringIO(content))
|
||||||
mid = imapobj._quote(message.getheader('Message-Id'))
|
mid = imapobj._quote(message.getheader('Message-Id'))
|
||||||
date = imaplib.Time2Internaldate(rfc822.parsedate(message.getheader('Date')))
|
datetuple = rfc822.parsedate(message.getheader('Date'))
|
||||||
|
if datetuple == None:
|
||||||
|
datetuple = time.localtime()
|
||||||
|
date = imaplib.Time2Internaldate(datetuple)
|
||||||
|
|
||||||
if content.find("\r\n") == -1: # Convert line endings if not already
|
if content.find("\r\n") == -1: # Convert line endings if not already
|
||||||
content = content.replace("\n", "\r\n")
|
content = content.replace("\n", "\r\n")
|
||||||
|
Loading…
Reference in New Issue
Block a user