37.4. Managing Email Aliases

A mail alias specifies that email received by your server for a particular mailbox should be forwarded to a different destination instead. That destination can be another email address, a file of addresses, a local file, or even the input to a program. They can be useful for setting up pseudo mailboxes that actually send email to a real person, such as [email protected] or [email protected]. An alias can have the same name as a UNIX user, in which case it will intercept all mail to that user and forward it to a different destination.

On most operating systems, Sendmail has several aliases defined by default for system users like bin, nobody, and uucp, all of which forward mail to root. There will also be a postmaster alias, which every mail server must have, and which should forward messages to someone responsible for the mail server. Typically, this will be the root user, as well.

To create a mail alias of your own using Webmin, follow these steps:

1.
On the module's main page, click on the Mail Aliases icon. You will be taken to a page listing all existing aliases and their destinations, with a form at the top for adding a new one. Figure 37.2 shows an example.

Figure 37.2. The mail aliases list.


2.
In the Address field of the Create Alias form, enter the user or mailbox name for this alias (the part of the address to the left of the @). If your server hosts multiple domains, the alias will forward email sent to the entered name at any of those domains. For example, if your server accepts mail for foo.com and bar.com, then an alias called sales will forward email to both [email protected] and [email protected].

If you want to be able to forward the same mailbox name differently at multiple domains, see Section 37.6 “Managing Virtual Address Mappings”.

3.
Assuming you actually want this alias to be used by Sendmail, leave the Enabled? field set to Yes. Changing it to No will cause the alias to be ignored. This field can be used when editing an alias to temporarily disable it, rather than totally deleting it.

4.
The Alias to field determines where email to this alias will be sent. The following options are available from the menu:

<None> Nothing at all will be done with received email. It makes no sense to select this option when creating a new alias.

Email address Email will be forwarded to the user or address that is entered into the adjacent field. Be careful not to set up a forwarding loop by sending email back to the alias' address again! If you are creating an alias that has the same name as a UNIX user and really do want email to be delivered to his mailbox as well as some other destinations, enter the username preceded by a backslash (like jcameron) into this field. The backslash tells Sendmail to bypass alias checking.

Addresses in file Email to the alias will be sent to all the addresses in the text file whose file path is entered into the adjacent text field. Each address must be on a separate line. This option can be useful for creating a simple mailing list, and the Majordomo list manager uses aliases of this type (covered in Chapter 34).

Write to file The full text—including all headers—of email received by the alias will be appended to the file whose path is entered into the text box.

Feed to program The program whose path and parameters are entered into the text box will be run and the full text—including all headers—of email received by the alias will be fed to it as input. This kind of alias is most useful to programmers who want to perform their own custom processing or filtering of email messages. The program is usually run as the UNIX user daemon, not root, or the user with the same name as the alias.

Autoreply from file When email is sent to the alias, the contents of the file specified in the adjacent text box will be sent back to the original sender. See Section 37.12 “Creating Autoreply Aliases” for more information on using aliases of this type.

Apply filter file Email sent to the alias will be processed according to the rules in the filter file entered into the text box, which can forward to different destinations depending on the message contents. See Section 37.13 “Creating Filter Aliases” for more details. It is possible for an alias to have multiple destinations. To add more than one, you will need to re-edit this alias after saving it and fill in the row with <None> selected at the bottom of the Alias to table.

5.
Click Save to have the alias added to the list and immediately made active.

6.
As is usual in Webmin, you can edit an existing alias by clicking on its name in the list on the Mail Aliases page. This will bring up an editing form that contains all the same fields as the creation form, but has Save and Delete buttons at the bottom. The first of these will update the alias with any changes that you have made, while the second will permanently delete it.

If a UNIX user has a file named .forward in his home directory, email that would normally be delivered to his mail file will be sent to the addresses listed in the .forward file. In many ways, these files are equivalent to aliases that can be created by individual users instead of by the system administrator. It is even possible for a .forward file to contain entries that tell Sendmail to send email to a list of addresses in another file, feed it to a program as input, or append it to a file.

This module does not support the editing of .forward files. Usermin (covered in Chapter 47), however, does allow normal users to edit their own forwarding files using a web-based interface almost identical to the one described in this section.

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

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