jump to navigation

How To Setup a Vacation Autoresponder with Procmail + Sendmail January 8, 2008

Posted by devhen in CentOS, Fedora, Linux.
6 comments

The problem with vacation auto responders like ‘vacation’ for sendmail is that spammers often fake the From: address. Auto responding to these addresses can get your mail server blacklisted. To avoid this you can setup your autoresponder with procmail and, if you are running a spam filter on your machine, you can tell procmail to auto respond only if the X Spam Status header is ‘No.’ To accomplish this copy the following into ~/.procmailrc in the home directory of the user you want auto responses for. Make sure to make any neccessary changes to MAILDIR, SENDMAIL and the three instances of ‘you@yourdomain.com’:

———————————————

VERBOSE=off
LOGFILE=$HOME/procmail.log
MAILDIR=$HOME/mail
SENDMAIL=/usr/sbin/sendmail
#########################################
# Auto-responder for vacations. Please
# insert text in $MAILDIR/message.txt
#########################################
:0 ic
*!^FROM_DAEMON
*!^X-Loop: you@yourdomain.com
* ^X-Spam-Status: No
|(formail -r -A “Precedence: Auto” \
– -I”From: Testy <you@yourdomain.com>” \
– -I”Subject: Automated acknowledgement” \
– -A “X-Loop: you@yourdomain.com”; \
cat message.txt )| $SENDMAIL -t

———————————————

Now put your auto response message in ~/mail/message.txt . Don’t forget to turn off the autoresponder when you return:

mv ~/.procmailrc ~/procmailrc_backup

Advertisements