Differences

This shows you the differences between two versions of the page.

Link to this comparison view

wiki:software:unix_systems:mailfilter [2009/01/29 11:03]
Keith A McDermott 2nd try
— (current)
Line 1: Line 1:
-====== 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: 
- 
-<code bash> 
-:0: 
-* ^From:.*spammer@some.com 
-/dev/null 
-</code> 
- 
- 
-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: 
- 
-<code bash> 
-:0:   
-* ^From:.*fred@physics.purdue.edu 
-~/Mail/fred 
-</code> 
- 
-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