ProcmailProcmail is an e-mail processing utility and language. It can be used to filter incoming e-mail and process it.
To install procmail, Telnet or SSH to your Virtual Server and do the following:
The Sendmail Configuration Tools include a default sendmail configuration file to enable procmail mail filtering. The following steps will install the default procmail-enabled sendmail configuration file on your Virtual Private Server.
1. Connect to your Virtual Server via SSH or Telnet and run this command:
% vinstall sendmail
2. Make a back-up of your current sendmail configuration file in case you need it later
% cp ~/etc/sendmail.cf ~/etc/sendmail.cf.old
3. Copy the procmail-enabled sendmail configuration file to the etc/ directory.
% cp ~/usr/local/sendmail/cf/cf/default-procmail-lda.cf ~/etc/sendmail.cf
4. Test to see if mail is being delivered properly. Enter the following command at the command prompt of your Virtual Private Server.
% virtual mail -s test root
When you enter this command, your cursor will move down to a blank line and wait for you to input the content of the message. A simple message such as hi is sufficient for our test. After you have entered your message, hold down the control key and press the D key to exit the mail program and send the message. The control-D combination will be represented by ^D on your screen.
You can check to see if the message was delivered properly by checking the last two lines of your messages log file.
% tail -f ~/var/log/messages
The following is an example of what you might see if the message was sent.
<XX>AUG 10 14:31:24 sendmail: f8AKVOg24923: from=server, size=27, class=0,
nrcpts=1, msgid=<2002080231.f8AKVOg24923@yourdomain.com>, relay=server@localhost
<XX>AUG 10 14:31:25 sendmail: f8AKVOg24923: to=server, ctladdr=server (1234/100),
delay=00:00:01, xdelay=00:00:00, mailer=local, pri=30027 dsn=2.0.0, stat=sent
Once you have sendmail working with Procmail, you can configure your procmail configuration file by following the instructions found on the following page.
More info can be found by reading the procmail man pages: