This post will show how to setup an auto-reply message using vacation on a debian etch server running postfix. This should work in the same way using other email servers, but this was tested with postfix. I’ll assume that you have postfix already running properly on the server. The first step is to install the vacation package. Since vacation is available in etch we can install it just by running:
aptitude install vacation
and this will install vacation version 3.3.0 on the system
The next step is to activate the auto-reply for some user/s. This will require to create a vacation message and to enable it when an email is received for the account. For the first step, using your preferred text editor create a file called .vacation.msg in the home of the user; for example this might look like:
Subject: Re: $SUBJECT I am on vacation until November 14 and will not be reading my emails during this time. If you have any urgent messages for me during this time please call me directly on my mobile.
Any occurrence of the string $SUBJECT in .vacation.msg will be replaced by the original subject of the message.
Next you will have to initialize the vacation db, by running:
as the respective user. This will result in the creation of the file ~/.vacation.db Please ensure that both files .vacation.msg and .vacation.db are owned by the respective user if not, you will have permission problems and this will not work as expected.
Finally you need to trigger the activation of the vacation auto-reply when an email is received by the user. This can be done in different ways, using a .forward file or procmail, etc. For ex. using .forward to keep one copy of the email local and to pipe it also to vacation you would need to create the file (replace username with the actual user name):
\username, "|/usr/bin/vacation username"
If for some reason this is not working as expected you can check the system logs to see what is wrong.