When fetchmail
checks my IMAP inbox, it downloads any unread messages and removes the message 'unread' flag on the mail server.
Is there a way to have fetchmail
download new messages without marking them as read?
I use procmail
to automatically process new mail messages and run scripts based upon mail rules, so I want the messages downloaded, but would prefer it if the "new message" flag was preserved on messages I have not yet read in my e-mail client.
This is my .fetchmailrc
file:
poll mail.domain.com protocol IMAP
user "user@domain.com"
password 'password'
folder 'INBOX'
keep
ssl
mda "/usr/bin/procmail -f %F"
Best Answer
I could not find a way to preserve or re-instate the 'unread' flag on the server.
In the end, I switched to using getmail, a more modern alternative to
fetchmail
that's written in Python. Unlikefetchmail
,getmail
retrieves messages based upon the server's message id rather than the message 'unread' flag.This is the
getmail
configuration file I created that provided equivalence to myfetchmail
configuration: