mirror of
https://github.com/samsonjs/imapbackup.git
synced 2026-04-27 14:57:44 +00:00
Merge pull request #9 from markfeit/master
Format "From" line date with ctime(3) per RFC 4155.
This commit is contained in:
commit
83e030ad68
1 changed files with 7 additions and 2 deletions
|
|
@ -124,6 +124,8 @@ def string_from_file(value):
|
||||||
return content.read().strip()
|
return content.read().strip()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def download_messages(server, filename, messages, config):
|
def download_messages(server, filename, messages, config):
|
||||||
"""Download messages from folder and append to mailbox"""
|
"""Download messages from folder and append to mailbox"""
|
||||||
|
|
||||||
|
|
@ -157,9 +159,12 @@ def download_messages(server, filename, messages, config):
|
||||||
|
|
||||||
# each new message
|
# each new message
|
||||||
for msg_id in messages.keys():
|
for msg_id in messages.keys():
|
||||||
|
|
||||||
# This "From" and the terminating newline below delimit messages
|
# This "From" and the terminating newline below delimit messages
|
||||||
# in mbox files
|
# in mbox files. Note that RFC 4155 specifies that the date be
|
||||||
buf = "From nobody %s\n" % time.strftime('%a %b %d %H:%M:%S %Y')
|
# 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
|
# If this is one of our synthesised Message-IDs, insert it before
|
||||||
# the other headers
|
# the other headers
|
||||||
if UUID in msg_id:
|
if UUID in msg_id:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue