procmail is a very handy tool for sorting, filtering and redirecting e-mail. Setting procmail up as the local delivery agent for sendmail under FreeBSD is very straightforward and allows the administrator (and users) much more flexibility in determining how mail gets delivered. Setting procmail as the LDA allows users to not worry about the $HOME/.forward file that's necessary if procmail is used stand-alone. Using procmail directly from sendmail instead of from $HOME/.forward saves a few steps, potentially having a positive performance impact.
If users don't wish to do any special handling and prefer the same behavior as regular mail.local, that's no problem. procmail will deliver to the same place mail.local will deliver to when there is no $HOME/.procmailrc file to process.
These instructions are broken in to two parts, installing procmail and changing sendmail's LDA, to keep things in order.
cd /usr/ports/mail/procmail
make install clean
That's it. :)cp -r /etc/mail /root/mail-backup/
Or whatever. You get the idea.FEATURE(local_procmail)dnl MAILER(procmail)dnlYou'll have to eyeball the location. On a side note, I toss define(`confSMTP_LOGIN_MSG',`')dnl in to my config to disable the banner display when an SMTP connection is made to the machine. Note the direction of the quotes.
make all install restart
will rebuild your site's hostname.cf from the hostname.mc, copy the hostname.cf to sendmail.cf (what sendmail actually reads for configuration information) and restart sendmail.Mike Hogsett suggests a quick way to make sure procmail is handling local mail delivery is to create a simple $HOME/.procmailrc that only logs mail as it's delivered. Just add a line like:
LOGFILE=$HOME/procmail.log
to your $HOME/.procmailrc and start watching for $HOME/procmail.log. The first time you get an e-mail delivered to your mail spool, $HOME/procmail.log will be created and information about the e-mail will be recorded. Consecutive mail deliveries will append to $HOME/procmail.log. If everything is happening as it should you're in good shape.What you do with procmail is completely up to you. I'm planning on installing SpamAssassin at a later date and suggesting to users that they filter their mail through SpamAssassin using procmail, but beyond that I'm not going to make anyone do anything.
If you're interested in doing neat things with procmail be sure to check out the following links.
Thanks goes to Steve Atwell and Jayson Anderson for confirming what I suspected about the sendmail config and procmail.
Page created 20030719 04:07.
Page modified 20040708 22:13.
Comments? Suggestions? Send them to hemi@puresimplicity.net.
© 2003 Josh Tolbert. This page may not be duplicated without
permission.