37.12. Creating Autoreply Aliases

The Sendmail Configuration module lets you easily create an alias that triggers an automatic reply to anyone who sends email to it. When you do this, Webmin creates a simple script that is run from the alias and receives the contents of email sent to it as input, just like a command specified using the Feed to program alias type.

To set up an autoreply alias, follow these steps:

1.
On the module's main page, click on the Mail Aliases icon.

2.
In the Create Alias form, enter a name for the alias, and select Autoreply from file from the type menu. The name can be that of an existing UNIX user if you want to set up an automatic reply to any message sent to him—for example, if he is on vacation.

3.
In the field next to the type menu, enter the path to a file that will contain the autoreply message, such as /home/someuser/autoreply.txt. The file does not have to exist yet.

4.
Click the Create button to add the alias, then click on its name in the list to edit again.

5.
Follow the Edit link next to the autoreply filename field. This will bring up a page containing a large text box for entering the contents of the reply message.

6.
After entering the text that you want sent back to any sender, click Save at the bottom of the page. The autoreply alias is now fully active.

The reply text can contain several special macros that start with $, such as $SUBJECT, $TO, $FROM, $DATE, and $BODY. When the reply is sent, these will be replaced with the original message's subject, destination address, sender address, sending date, or body, respectively. Be careful using the $BODY macro though, as it will be replaced with the entire unencoded contents of the email to which you are replying.

You can also add to, or override, the headers used in the reply message by starting the autoreply text with one or more lines in standard SMTP header format, followed by a blank line. For example, to set the subject of the automatic reply you could enter Subject: This is an automatic reply at the top of the text box, with an empty line after it.

One problem with Webmin's autoreply script is its inability to reliably determine the From: address to use when sending the reply. This is normally just taken from the To: address of the original message, but this is not possible when replying to a message that was sent to multiple people. Even though the code attempts to find the right address automatically, it can sometimes get the wrong one and send an automatic reply that appears to be from the wrong person. For this reason, you should set the correct address by including a header line like From: Jamie Cameron <[email protected]> at the top of your reply text.

If you are setting up an automatic reply alias for a UNIX user, it is usually a good idea to have a copy of all email sent to the user stored in his mailbox as well. To do this, re-edit the alias and select Email address from the second type menu. Then enter the user's name, preceded by a backslash, into the text field next to it (like jcameron) and hit Save.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.143.214.56