| Vacation Auto-reply |
|
Introduction The program vacation is used to send an email auto-reply when someone is away from the office. A small database is setup to ensure that each sender only received the auto-reply once. I will be out of the office from (START DATE) until (END DATE). I will address your message when I return to the office. Thanks. Before you Change Anything This is good advice if you are setting this up for yourself, but it is especially important when you are setting up an auto-reply for someone else. Before you do anything, make sure the user does not already have a .forward or a .qmail. Most users who purposefully forward their email will never ask for a email auto-reply. There is plenty of reasons for other users to have a .qmail file though. If the file already exists, you need to either preserve it, or modify it to work with the vacation program. An existing file will require you to treat the automatic enable and disable differently. Use your best judgement and if necessary, ask the user how they want to treat the functionality of their .qmail file while they are gone. Note: The rest of the document will assume no .qmail or .forward file exists. Setting Up the Email Auto-reply Log on as the user If you are setting up the auto-reply for another user, su to their account. For this example, we will use a fictional user, Alpha B. Charlie, who's username is abc1234 and home directory is /cis/staff/abc1234. The full command, to switch to that user would be su - abc1234. This is best done from root on saturn. .vacation.qmail First create, or verify the file .vacation.qmail in their home directory. This file, as that name is not used by either qmail or vacation. As part of its activation, it will be renamed. For the sample user, the file will look like: |/usr/local/bin/vacation abc1234 /cis/staff/abc1234/.mailbox Note: Historically the first line would look like: |preline vacation abc1234. This is no longer correct. The vacation program we are using, the one who's path is /usr/local/bin/vacation was designed to work with qmail and will actually break if used with preline. .vacation.msg Create a .vacation.msg file that will contain the user's vacation message. The user will usually give the necessary text and it will usually be a matter of a text replacement. The format of the file is 2 header lines, one for the From header and one for the Subj header, a blank line, and the message text. Do NOT forget the blank line after the headers, it's important! A sample .vacation.msg file: From: Alpha B. Charlie < This e-mail address is being protected from spam bots, you need JavaScript enabled to view it > Subject: I am away from the office
after I return. Thanks.
Test account who's vacation mail auto-reply should be ignored
/usr/bin/vacation -I
mv .vacation.qmail .qmail and the command to manually disable the auto-reply is: mv .qmail .vacation.qmail Rather than trying to remember to turn on vacation mail on and off, it would be best to schedule the job with at(1). To find out more information, read the at(1) man page. To to create a scheduled job with at(1), enter the at command, and at the at> prompt, enter the command(s) and end entering commands with a control-D. You will receive feedback telling what shell will be used to execute the command and what time it will execute. If it does not look right, you need to correct the command and remove the incorrect at job. Let's say, for example, that User abc1234 wants to turn on his auto-reply at 6:00 PM on February 21 and have it stop at 7:00 AM on February 28. The 2 at commands would look like: at 6pm Feb 21 at> mv .vacation.qmail .qmail at> <EOT> commands will be executed using /usr/bin/tcsh job 1140562800.a at Tue Feb 21 18:00:00 2006 and: at 7am Feb 28 at> mv .qmail .vacation.qmail at> <EOT> commands will be executed using /usr/bin/tcsh job 1141128001.a at Tue Feb 28 07:00:00 2006 Test It! If you were requested to immediately turn on the email auto-reply, you can test it by sending the user email telling them you enabled it. You'll know it is enabled when you get the auto-reply. If the auto-reply is to be enabled later, still tell the user you enabled it, and test it at a later time if you get the chance. Alternate Methods of Email Auto-replies These are included to list alternate ways vacation auto-replies were setup. This is here for historical record. Preline and Sendmail Version of Vacation Before we installed Peter's vacation program, we had to use the Solaris sendmail version of vacation. The major difference is that the .vacation.qmail from the above example would look like: |preline vacation abc1234 /cis/staff/abc1234/.mailbox When saturn was an Alpha, this worked just fine. However, under Solaris, there is the very real potential to cause a loss of mail. Any message over 20KB caused a broken pipe error and therefore the mail was help in the queue. If the user was on vacation for longer than the queue lifetime (1 week), mail was rejected. This is why we went with the other version of the vacation program. Using a .forward file and the Sendmail Version of Vacation Another method of setting up a email auto-reply is to use a .forward file and the Sendmail version of vacation. That program lives at /usr/bin/vacation which is really a link to /usr/ucb/vacation. To do this, the .forward file is setup like: \abc1234, "|/usr/bin/vacation abc1234" The rest of the setup instructions are the same. Note: With this, there is no .vacation.qmail file. You could instead have .forward saved as .vacation.forward when it is not in use. The only people who will use this method are the ones who know how to do it themselves. This method does not have the risk of mail loss seen with preline and the Sendmail vacation program. |