Gmail – How to correct Gmail timestamps after copying them over IMAP

gmailimapimport

I have imported several thousand messages into my Gmail account over IMAP, but in the Gmail interface and the iPhone Mail application the date of every message has been changed to the date of the import, rather than the original receipt date.

If I open one of the messages however, the correct date is shown and the email headers appear to remain intact.

How can I correct this issue?

Best Answer

The problem seems to be what IMAP client is used to copy the messages into gmail. This is a known issue where the IMAP client does not specify the internal date of the email and the server defaults to the current time.

In my case I was attemping to copy old courier Maildir folders into gmail. I ended up using this link that gave direction on how to have Mutt do the dirty work of converting Maildir to mbox. I then used this script from github to accomplish copying the mbox files into gmail. The results were perfect although I did have to boot up an Ubuntu virtual machine to accomplish this.

Alternatively, use a different IMAP client to see if it appends the correct date.