Difference between revisions of "sendmail/procmail"
(clarification of link) |
(finally, working instructions) |
||
Line 1: | Line 1: | ||
+ | ==About== | ||
+ | Instructions which actually worked for configuring [[sendmail]] to deliver through [[procmail]] are [http://commons.oreilly.com/wiki/index.php/SpamAssassin/Integrating_SpamAssassin_with_sendmail here]. Note the following: | ||
+ | * "dnl" at the end of a command is optional, if there are no comments following it (it apparently means "delete from here to the start of the next line") | ||
+ | * The "FEATURE(`local_procmail',`/path/to/procmail')dnl" line must go '''before''' the existing "MAILER(`local')" line | ||
+ | * Be sure to restart sendmail after applying the change. (If not using Webmin to do the editing, also be sure to rebuilt the sendmail.m4 file.) | ||
==Notes== | ==Notes== | ||
From the [http://www.sendmail.com/sm/open_source/docs/m4/mailers.html mailers documentation]: | From the [http://www.sendmail.com/sm/open_source/docs/m4/mailers.html mailers documentation]: |
Latest revision as of 20:52, 21 July 2013
About
Instructions which actually worked for configuring sendmail to deliver through procmail are here. Note the following:
- "dnl" at the end of a command is optional, if there are no comments following it (it apparently means "delete from here to the start of the next line")
- The "FEATURE(`local_procmail',`/path/to/procmail')dnl" line must go before the existing "MAILER(`local')" line
- Be sure to restart sendmail after applying the change. (If not using Webmin to do the editing, also be sure to rebuilt the sendmail.m4 file.)
Notes
From the mailers documentation:
This is designed to be used in mailertables. For example, a common question is "how do I forward all mail for a given domain to a single person?". If you have this mailer defined, you could set up a mailertable reading:
host.com procmail:/etc/procmailrcs/host.comwith the file /etc/procmailrcs/host.com reading:
:0 # forward mail for host.com ! -oi -f $1 person@other.hostThis would arrange for (anything)@host.com to be sent to person@other.host. Within the procmail script, $1 is the name of the sender and $2 is the name of the recipient.
If you use this with FEATURE(`local_procmail'), the FEATURE should be listed first.
Of course there are other ways to solve this particular problem, e.g., a catch-all entry in a virtusertable.
Links
- Invoking procmail from sendmail: this seems to be about how to forward mail to procmail on a shared server, rather than how to configure sendmail to filter all mail through procmail
- PROCMAIL_MAILER_PATH parameter
- FAQ: Version 8 issues seems to have some procmail examples