|
|
Installing and Administering Internet Services: HP 9000 Networking > Chapter 4 Installing and Administering sendmailCreating sendmail Aliases |
|
The sendmail aliases database stores mailing lists and mail aliases. You create the aliases database by adding aliases to the file /etc/mail/aliases and then running the newaliases script to generate the database from the file. The generated database is stored in the file /etc/mail/aliases.db. The sendmail startup script also generates the aliases database when you reboot your system. Each user on your system can create a list of alternate mailing addresses in a .forward file in his or her home directory. The .forward file allows the user to forward his or her own mail to files or to other mailing addresses. This section contains the following task-related subsections:
Table 4-1 Things That May Be Included in a Mailing List
An alias can be continued across multiple lines in the aliases file. Lines beginning with blanks or tabs are continuation lines. The aliases file can contain comment lines, which begin with #. Blank lines in the aliases file are ignored.
Because the sender of a message often does not control the mailing list to which the message is addressed, sendmail allows you to configure an owner for a mailing list. If sendmail encounters an error while attempting to deliver a message to the members of a mailing list, it looks for an alias of the form owner-mailing_list and sends the error message to the owner. For example, if mike were responsible for maintaining the chess_club mailing list, he could be configured as the owner:
Any errors sendmail encountered while trying to deliver mail to the members of the chess_club mailing list would be reported to mike. You should avoid creating aliasing loops. Loops can occur either locally or remotely. Following is an example of a local alias loop:
When regenerating the alias database, newaliases does not notice a loop like the one shown in the previous example. However, after the alias database is generated, mail addressed to either first or second is not sent. If the only recipients for the message are in local alias loops, the message is returned with the error message All recipients suppressed. In the previous example, if mail is addressed to first, first expands to second, which expands to first. This causes sendmail to remove first from the recipient list as a duplicate.
Following is an example of a remote aliasing loop: Mail sent to dave at either host sage or host basil bounces between the two systems. sendmail adds a tracing header line (Received:) with each hop. When 30 tracing header lines have been added, sendmail recognizes the aliasing loop and aborts the delivery with an error message. RFC 822 requires that a "postmaster" alias be defined on every host. The postmaster is the person in charge of handling problems with the mail system on that host. The default aliases file supplied with HP-UX defines the postmaster to be root. You can change this alias to the appropriate user for your system. After you have created a sendmail alias and regenerated the aliases database, issue the following command to verify that your alias is valid:
The -bv option causes sendmail to verify the aliases without collecting or sending any messages. Any errors in the specified aliases will be logged to standard output. Users can use the HP expand_alias utility to expand an alias or mailing list as far as is possible. For more information on the expand_alias utility, type man 1M expand_alias at the HP-UX prompt. The sendmail aliases database can be managed through the Network Information Service (NIS or NIS+), which is one of the NFS Services. NIS or NIS+ allows you to maintain an aliases database on one server system. All other systems request alias information from the server. In order to use NIS or NIS+, you must set up an NIS or NIS+ domain and configure the machines in your network as NIS or NIS+ servers and clients. For information about the NIS or NIS+ aliases database, see Installing and Administering NFS Services. When you configure NIS or NIS+ in your network, it manages your sendmail aliases by default, so you do not have to make any changes to your NIS or NIS+ configuration. Before you run the NIS ypinit script or the NIS+ nispopulate script, make sure the /etc/mail/aliases file on the NIS or NIS+ master server contains all the sendmail aliases you want to make globally available through NIS or NIS+. The sendmail program uses the Name Service Switch to determine where to look for sendmail aliases. HP provides a method that allows the "From" line on mail to be rewritten. This can be useful where a user's login name does not clearly identify the user to intended mail recipients. For example, mail sent by "bkelley (mailname)" can be changed to read from "Bob_Kelley (maildrop)". To rewrite "From" lines on outgoing mail:
You can redirect your own mail by creating a .forward file in your home directory. If a .forward file exists in your home directory and is owned by you, sendmail will redirect mail addressed to you to the addresses in the .forward file. A .forward file can contain anything that can appear on the right side of an alias definition, including programs and files. (See Table 4-1 “Things That May Be Included in a Mailing List” earlier in this chapter.) Following is an example of a .forward file owned by user alice on host chicago:
Mail sent to alice@chicago will be delivered to alice's accounts on hosts miami and toronto as well as to her account on local host chicago. It will also be delivered to all the recipients of the mailing list mycrew, which must be defined in the local aliases database or in an :include file on host chicago. The aliases database is read before a .forward file. The .forward file is read only if the user's name is not defined as an alias or if an alias expands to the user's name. |
|