[Dclug] remote procmail (or something like it)

Kevin Dwyer kevin at pheared.net
Tue Apr 17 20:42:51 EDT 2007


The place that hosts my e-mail does not provide procmail for filtering
my incoming mail.  This is a luxury I can mostly do without, but there
are some times when I miss it.  I got to wondering if anyone had tried
to implement a remote (client-side) procmail over IMAP.  I don't think
mutt can do this so it would be neat if procmail could.

Some ideas that have come up:

1. fetchmail to download the mail, procmail to filter, mutt to read
locally.  Drawback is that it's all local to me now which defeats some
of the purpose of the mail host.  On the other hand, this will
definitely work.

2. fetchmail to essentially cat the mailbox to procmail and capture the
decisions procmail would make (drop, requeue, whatever) and then replay
these actions through a connection to IMAP.  Drawback is that it is more
complex, but it might actually work while keeping my mail on the server.
Since procmail can ultimately be configured to do anything, this method
can probably only hope to handle simple recipes.

3. Write an entirely new program to login to IMAP, parse everything, do
stuff.  This could either be the most work or the least, depending on
how difficult the former methods are.  I've written code to connect to
IMAP and do things (delete old spam), but this would involve reinventing
the procmail recipe, albeit in a limited fashion.  This one is the most
likely to exist as well, so maybe someone knows about a project.

4. ?

Feel free to fill in the last one.  I would like to keep the mail on the
server, but I'm not afraid of downloading new ones periodically for
parsing.

-kpd



More information about the Dclug mailing list