This is an old revision of the document!


Filtering incoming mail

You should use procmail.

On the PCN mail server, procmail is used as the local delivery agent, and is run every time a message is delivered to you. To filter, just create a file named .procmailrc in your home directory, and place the rules you want procmail to follow in there.

For example, if you want to send email from spammer@some.com to the bit bucket, you would place the following lines in your .procmailrc:

:0:
* ^From:.*spammer@some.com
/dev/null

If you want to filter mail from fred@physics.purdue.edu into its own folder, rather than INBOX, you would add the following lines to your .procmailrc:

:0:  
* ^From:.*fred@physics.purdue.edu
~/Mail/fred

Procmail is capable of many, far more complex actions than can be reasonably covered here.

Further documentation can be found using the 'man' command, specifically:

man procmail

man procmailex

man procmailrc

wiki/software/unix_systems/mailfilter.1335989079.txt · Last modified: 2012/05/02 16:04 by David C LeFevre