Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
up vote 2 down vote accepted

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).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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