1
I'm setting up my own IMAP and I need to gather emails received during the last 9 years in my own server (and to continuously synchronize from a few email boxes).
I have successfully set up fetchmail with a test account on an empty mailbox. Whenever I send mail to the target mailbox, it will be picked up via POP3 into my box.
But I discovered that the message I'm delivered into Windows Mail shows the date/time when fetchmail
ran. This can be appropriate for new mail, but really inappropriate for history tracking.
My .fetchmailrc
file currently * shows
set invisible
poll pop.fastwebnet.it proto imap
user "redacted" pass "redacted" fetchall
mda "/usr/lib/dovecot/deliver"
My inbox is configured using Postfix & Dovecot with Maildir
format. I chose POP3 for fetchmail because it will delete the message once synchronized to maildir.
How can I tell fetchmail
that new mail dropped into Maildir must match exactly what found on server, with reference to date and time?
I mean, if I went to synchronize my history from anotherbox@example.org
that accumulated 9 years of mail, all of them will be dated today!
For example, I sent myself a test email at about 14:59 to redacted@fastwebnet.it
, opened the webmail at fastwebnet.it
to confirm that 14:59 was the "official" time, then ran fetchmail
from my server at 15:30. Windows Mail showed that the email's time was 15:30 instead of 14:59.
Updates
From the comment and by reading the documentation, it looks clear that fetchmail normally adds a Received
header at the top of the email so the client will detect the mail is brand new.
I also ran fetchmail
in verbose mode, this time using IMAP. It seems that by default it drops mail via SMTP, so that's where the problem lies. If my server receives a mail via SMTP to be dropped into Maildir, it will assume that the email is brand new.
*I have updated my questions from the original writing
fetchmail does not rewrite the
Date
field. It puts the maildrop date into aReceived
field at the top of the headers, but not inDate
, which is the one that is normally displayed by a MUA. – Daniel Vérité – 2014-12-30T15:14:46.480