If you use procmail to filter messages, you can use it also to setup a vacation email response:
- Create a file called vacation.txt and fill it with your “vacation message”.
- Create a file called vacation.rc fill it with the following commands (and don’t forget to adjust the values for USER, DOMAIN, and PATHxxx to your needs):
:0 Whc: vacation.lock * .*for <USER@DOMAIN> * !^FROM_DAEMON * !^X-Loop: USER@DOMAIN | formail -rD 8192 vacation.cache :0 ehc | (formail -rA”Precedence: junk (autoreply)” -A”X-Loop: USER@DOMAIN” ; cat PATHTOVACATIONMESSAGE/vacation.txt ) | PATHTOSENDMAIL/sendmail -oi -t
- Find your .procmailrc file and add the following line after your filter commands (again adjust the PATH):
If you receive an email at USER@DOMAIN and it is not filtered out by your spam filter, the vacation commands are activated. It checks if the email is for you, does not originate from a mailing list, and has not been processed before. It also creates a file called vacation.cache, where it stores the email addresses to which a vacation message has already been sent, in order to do not send such a message again (don’t forget to delete it when you deactivate the vacation filter). At last it replies with the message stored in vacation.txt.
Precedence: junk (autoreply)” part helps to avoid bouncing messages from other MTAs.