When running:
python ~/bin/imap_upload.py --time-fields=date --gmail --user=mr@gavincowie.com --password=***** --box="[Gmail]/Sent Mail" Sent
the dates shown in the gmail interface are all appearing as the date of the mbox file instead of the date of the email message. Clicking through to the message, the send date is correctly shown. It seems to correspond with this report:
http://productforums.google.com/forum/#!topic/gmail/0PU1gQuXNi8
Which mentions RFC 3501 :
"When uploading messages, the IMAP client is supposed to specify the "internal date" of the message as one of the arguments to the APPEND command. If the client omits this parameter, the server is supposed to use the current time. RFC 3501 section 6.3.11 states in part:
"If a date-time is specified, the internal date SHOULD be set in the resulting message; otherwise, the internal date of the resulting message is set to the current date and time by default."
If the client is specifying the date and Gmail is ignoring it, that's a bug in Gmail. If the client isn't specifying the date, it's a bug in the client."
Reading through that thread it seems that some people have success doing imports (albeit mostly with thunderbird) so it must be possible to set this date correctly in gmail.
Any thoughts?
There is a
time-fields
flag in which you can specify the date source. The default is "from,received,date" which looks at the mbox "From " line first then at the "Received: " and "Date: " message headers.In your case the mbox file has incorrect dates so you'll want to specify
or any one of those. Gmail respects the date the client sets so this will work.