fetchmail-friends
[Top] [All Lists]

Re: [fetchmail]Selective deletion of email from remote server?

2002-05-04 21:46:02
n Sat, May 04, 2002 at 09:54:12PM -0600, Rob 'Feztaa' Park wrote:

[ ... ]

I'm not sure *exactly* what you're trying to accomplish here,
but it sounds like you want to be using procmail. It will allow
you to sort your mail and delete it on certain criteria. It's
infinitely useful if you're subscribed to a few mailing
lists... ;)

Thank you ... but I know what procmail is and I use it extensively,
and what I'm asking for cannot be done by procmail.  Procmail is an
MDA which is run on the local server.  If procmail is used in
conjunction with fetchmail, procmail runs after fetchmail retrieves
the message from the remote server.  What I'm looking for is a way
to control the way that fetchmail retrieves the message from the
REMOTE server, before any MDA such as procmail even gets invoked.

Fetchmail allows us to specify "keep" and "nokeep".  This is a
binary choice for any given remote server: either fetchmail keeps
the messages on the remote server after retrieving them (the "keep"
option) or it deletes them on the server after retrieving them (the
"nokeep" option).

What I'm looking for is a hack or a trick which would allow "keep"
or "nokeep" to depend on some sort of runtime criteria.  For
example, one possibility is that I would like fetchmail to do a
"nokeep" on a given remote server for any message that is older than
a certain age; otherwise, it would do a "keep" on that server for
the message.  Another possibility would be for fetchmail to "keep"
the N newest messages on the remote server, and "nokeep" the rest.
The end result of either of these cases would be that some messages
are kept on the remote server after fetchmail retrieves them, and
some are not, with the newest messages being kept on the remote
server, and the older ones being deleted from the remote server
after a while.

I realize that some sort of trick or hack would be necessary to get
fetchmail to do this, but I'm wondering if anyone else has been able
to come up with such a thing.

Thanks again, in advance.

-- 
 Fetchmail User
 fmail(_at_)asfast(_dot_)net