5 ***Contributed by Marc Silver. ***
\r
7 The ***procmail*** utility is an incredibly powerful application used to filter incoming mail. It allows users to define ***rules*** which can be matched to incoming mails to perform specific functions or to reroute mail to alternative mailboxes and/or email addresses. **procmail** can be installed using the [mail/procmail](http://pkgsrc.se/mail/procmail) port. Once installed, it can be directly integrated into most MTAs; consult your MTA documentation for more information. Alternatively, **procmail** can be integrated by adding the following line to a `.forward` in the home directory of the user utilizing **procmail** features:
\r
10 "|exec /usr/local/bin/procmail || exit 75"
\r
13 The following section will display some basic **procmail** rules, as well as brief descriptions on what they do. These rules, and others must be inserted into a `.procmailrc` file, which must reside in the user's home directory.
\r
15 Forward all mail from `user@example.com` to an external address of `goodmail@example2.com`:
\r
20 * ^From.*user@example.com
\r
21 ! goodmail@example2.com
\r
24 Forward all mails shorter than 1000 bytes to an external address of `goodmail@example2.com`:
\r
30 ! goodmail@example2.com
\r
33 Send all mail sent to `alternate@example.com` into a mailbox called `alternate`:
\r
38 * ^TOalternate@example.com
\r
42 Send all mail with a subject of ***Spam*** to `/dev/null`:
\r
50 A useful recipe that parses incoming `dragonflybsd.org` mailing lists and places each list in its own mailbox:
\r
55 * ^List-Post: <mailto:\/[^@]+
\r
60 * LISTNAME??^\/[^-]+
\r
68 CategoryHandbook-email
\r