Cheap website hosting service by

Domain registration & domain search service from just
$5.95/year only


Webhosting service for single or multiple domain names at affordable price.

 Back to Index

20.13 Using procmail

Contributed by Marc Silver.

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 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:

"|exec /usr/local/bin/procmail || exit 75"

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.

The majority of these rules can also be found in the procmailex(5) manual page.

Forward all mail from to an external address of

* ^From.*

Forward all mails shorter than 1000 bytes to an external address of

* < 1000

Send all mail sent to into a mailbox called alternate:

* ^

Send all mail with a subject of ``Spam'' to /dev/null:


A useful recipe that parses incoming mailing lists and places each list in its own mailbox:

* ^Sender:.owner-freebsd-\/[^@]+@FreeBSD.ORG
    * LISTNAME??^\/[^@]+





2002-2004 Website Hosting Service


Disclaimer: This documentation is provided only for the benefits of our website hosting customers.
For authoritative source of the documentation, please refer to