POPFILTER: how to delete unwanted email BEFORE downloading it

Table of contents

1.0 How to delete email on pop3 server
2.0 POPFILTER
3.0 Supported mail user agents
4.0 Installation
5.0 TO DO list
6.0 Credits
7.0 Feedback

1.0 How to delete email on pop3 server [toc]

On the Net there are a lot of examples on how to download automatically your email from different POP3 servers into your computer, and, once it's there, how to process it, i.e. how to sort it, delete spam, send automatic answers, etc,etc..

However, I have always found a couple of flaws in these strategies for filtering email.

1.1 Why delete AFTER download? [toc]

While should I download a message, spending time and money, when I already know that I'm not interested in it? Even with permanent flat rate connections, why move stuff around just to delete it somewhere else? This is especially true with mailing lists: most of the threads are of little or no interest whatsoever to me, but they vary all the time, and I cannot certainly flag the mailing list address as spam.

For example, imagine a 100 messages thread going on for days about RAID, and you don't use it at all.

Why should you ever download the messages, then? If you change your mind next month, mailing lists are mirrored on the net anyways, right? (of course, when it's mail that would not be backed up anywhere else it's different..)

1.2 Filtering with procmail only is static [toc]

Another fault I've found in usual email filtering procedures is that they can't be driven dynamically from the email client: everything is static, i.e. written once and for all in procmailrc, while I wanted to select a message from inside my mail client, and tell to it "let's not download any reply to this"

2.0 POPFILTER [toc]

I have written a short Perl script which should solve the two problems above: it doesn't replace anything in the email chain (fetchmail/MTA/procmail), but it is supposed to run just before fetchmail.

POPFILTER:

  1. reads a list of uninteresting headers, created through your email client
  2. connects to the POP3 server, reading account info from fetchmailrc
  3. downloads only the headers of all messages
  4. check if a message recipient (list) and subject are in the black list
  5. if this is the case, sends a delete command to the POP3 server

    After POPFILTER has finished, fetchmail can step in and download what's left. Hopefully, it will be a much smaller amount of data.

    2.1 Other similar programs [toc]

    Some days after writing popfilter, it did come to my mind that I should have searched Freshmeat first. I did it, and found several existing programs doing the same thing. They are listed here, together with the reasons why I decided to keep using my script:

    1. mailfilter (no auto reply, which I plan to add in the future)
    2. animail (overlaps with fetchmail, which I wish to keep, and is written in Python: fine language, but I don't have time to learn it now)
    3. popsneaker (requires external libs, and is more than 2000 lines of code against the 179 of popfilter)

      Furthermore, as already mentioned, I wanted something that I could drive at will from the email client. Of course, the ones above are all fine pieces of software, and you are encouraged to try them all.


3.0 Supported mail user agents [toc]

Any Mail User agent which can pipe the headers of a selected message into formail can work with POPFILTER.

3.1 Mutt macros [toc]

Insert these two macros in muttrc and use them whenever you have highlighted a message whose follow-ups you don't want to download anymore
      macro pager X "|formail -XFrom: -XSubject: -XTo:|/usr/local/bin/popfilter_format.pl\n"
      macro index X "|formail -XFrom: -XSubject: -XTo:|/usr/local/bin/popfilter_format.pl\n"

4.0 Installation [toc]

Download the tarball here : http://web.tiscali.it/marco_web/popfilter_v01.gz

Just install the MAIL::POP3Client module if you don't have it already, put the scripts in /usr/local/bin with appropriate permissions and go.

(I'll detail this more, I promise..)


5.0 TO DO list [toc]

  1. Add a "ggod list" and a "bad list", i.e. messages to never discard or always discard
  2. Capability to combine rules
  3. When receiving messages with Word attachments and/or in HTML format, automatically send polite but firm request to not indulge in such bad abits....

6.0 Credits [toc]


7.0 Feedback [toc]

I am very interested in making popfilter as robust and general purpose as possible. Any feedback (questions, patches, opinions, etc..) is welcome and should be sent to marco.REMOVEfioretti@ALLUPPERCASEtiscalinet.it

Marco Fioretti


This file has been automatically generated from plain text file with perl script site_t2html.pl 1.174
Html date: 2001-07-12 19:46