diff --git a/imapbackup.py b/imapbackup.py index dc1ca9a..2c2c6a3 100644 --- a/imapbackup.py +++ b/imapbackup.py @@ -124,6 +124,8 @@ def string_from_file(value): return content.read().strip() + + def download_messages(server, filename, messages, config): """Download messages from folder and append to mailbox""" @@ -157,9 +159,12 @@ def download_messages(server, filename, messages, config): # each new message for msg_id in messages.keys(): + # This "From" and the terminating newline below delimit messages - # in mbox files - buf = "From nobody %s\n" % time.strftime('%a %b %d %H:%M:%S %Y') + # in mbox files. Note that RFC 4155 specifies that the date be + # in the same format as the output of ctime(3), which is required + # by ISO C to use English day and month abbreviations. + buf = "From nobody %s\n" % time.ctime() # If this is one of our synthesised Message-IDs, insert it before # the other headers if UUID in msg_id: