Installing and Administering Internet Services
166 Chapter4
Installing and Administering sendmail
Creating sendmail Aliases
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.
NOTE You cannot address messages directly to file names, command lines, or
:include files. sendmail will deliver messages to these only if they
appear in the right side of an alias definition.
"|
command
" sendmail pipes the message as standard input to the specified
command. The double quotes are required to protect the command line
from being interpreted by sendmail. Commands must be listed as full
pathnames.
If stdout and stderr are not redirected, they are not printed to the
terminal, and they disappear. However, if a command returns a
non-zero exit status, its output to stderr becomes part of the
sendmail error transcript.
The command is executed by the prog mailer defined in the
configuration file. In the configuration file supplied with HP-UX, the
prog mailer is configured as “sh -c”. Example:
prog: "| / usr /bin/cat | / usr /bin/sed
's/Z/z/g' > /tmp/outputfile"
Mail addressed to prog is saved in /tmp/outputfile with all
capital Z’s changed to lowercase z’s.
:include:
filename
Any mail addressed to the alias is sent to all the recipients listed in the
included file. The file must be a full path name. Non-root users can
create :include files for maintaining their own mailing lists. An
:include file can contain anything that can be specified in the right
side of an alias definition. Example alias definition:
dogbreeders: :include:/users/andrea/dogbreeders
Example :include file:
#file included in dogbreeders alias definition:
terriers@akc.ny.com, coonhounders@ukc.sc.com
Table 4-1 Things That May Be Included in a Mailing List