I know that fetchmail can be configured to leave mail on the server (usually done with the keep uidl keyword combination), but is there a way to configure it to leave mail on the server for a specified minimum period of time and delete them thereafter?

For example, suppose I want messages to remain on the server for 48 hours after they have been downloaded, and then be deleted on the next fetchmail invocation against that server.

I am mostly interested in solutions that work with POP3.


Short: it doesn't do that.

Long: fetchmail is only designed to do one of these:

  • read entire mailboxes, or
  • read the unread messages from a mailbox

When it has read a message, it can mark this (on the server) as "read". But there is no timestamp associated with this.

The inability to do this is known, and according to a reply on fetchmail users by by Rob MacGregor, probably an FAQ:

That'll be because that's not what Fetchmail was designed to do. Fetchmail is designed to download entire mailboxes or at least the unread messages. Without changes to the source there's no way to download only the seen email.

It also doesn't delete email after N days (I'm pretty sure that's in the FAQ - it certainly used to be).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.