This is a short reminder to me about sendmail aliases.
- look for the file /etc/mail/aliases
- each line has the following format: aliasname : username
- you can regenerate the aliases database by issuing /usr/sbin/newaliases
- check the newly-created aliasas with/usr/sbin/sendmail -bv -v alias, alias, . . .
- There is a user-specific way of defining an alias: ~/.forward , but the system-wide alias file has a higher precedence
The following 5 main categories exist:
- local and remote users
To avoid unnecessary lookups, use backslash:local_users : joe, amy, phil, todd
remote_user: willy@remote.mac
do_not_lookup: \final.user - mailing lists can be created with multiple users in the same line.
RFC822 style addressing is user@host.dom
UUCP-style addressing is user!hostmail_list: joe, mary, kathy, mary!uucpmachine
- filename – sendmail can also act as an MDA, the mail will be appended to the given file. This file must exist and sendmail must have write permission to it. Mustn’t be executable.
nobody: /dev/null
simplejoe: /home/joe/mail
mail_to_console: /dev/console - “| command” - this sequence tells sendmail to pass the mail on to the given command. It is useful e.g. if we want to create a full-automated mailing list. Double quotes are a must, commands must be listed with full path.
cartoon_subscribe: “| /mailing_list/scripts/check_subscription.sh”
- :include:filename - the given file contains the list of recipients. It can be used to safely administer a mailing list so that the subscripe script won't directly edit the aliases file. The "owner-" prefix defines the owner of the mailing list, he gets all the error-related mails subject to this list.
cartoon_list: :include:/mailing_list/cartoon/subscriber_list.lst
owner-cartoon_list: joe
The above aliases will be processed until there is no more alias to refer to. Avoid creation of alias loops. After modification of the aliases file check the mail if we’ve got an error because of an alias loop. Always create a postmaster alias, it is mandatory, and anyway: since RFC822 it is a standard.