Repelling the Invaders Part 5
- 0
- Add a Comment
- No Related Post
Repelling the Invaders - Part 5
Procmail works great for sorting through the headers of your email looking for patterns. Remember, those patterns are defined as regular expressions in the ~/.procmailrc file - a file that also contains environment variables, such as the location of sendmail.
If you’re going to do more with your email than just filter it and sort it into the appropriate mailboxes, you’ll need sendmail. procmail doesn’t send or recieve mail, it just delivers what’s been received. Any outgoing mail is handled by sendmail. You’ll most commonly see sendmail in a ~/.procmailrc file in a form similar to this:
[lots of other filtering code] | $SENDMAIL -t
These lines in ~/.procmailrc can be quite long, but they serve the same purpose - to send the output of the other programs (procmail, formail, etc.) as input to sendmail. Depending on the options given, sendmail will then process the mail for autoforwarding, etc.
A fine example of this use of the procmail/sendmail combination can be found here in Nic Wolff’s article, “Rejecting Spam With a Procmail Accept List.” This article even comes complete with a ~/.procmailrc file that can be used with only minor modification. sendmail is used, in this example, to send a confirmation message to a sender who’s not on an existing “accept” list. The email is queued until a response is received from the sender, then delivered as normal. That’s an effective way to hide, if not completely kill, lots of spam.
One other program bears some mention in conjunction with procmail. Formail will be the subject of discussion tomorrow, as we move toward the close of the series on filtering your email.
