24.6 Prevent Aliasing with -nAt times it is desirable to run sendmail so that it does not perform aliasing. When aliasing is disabled, sendmail uses the recipient address as is. No addresses are ever looked up in the aliases file, even if they are local.
The 24.6.1 Is an Alias Bad?In tracking down delivery problems, it can be difficult to determine where the problem lies. If you suspect a bad alias, you can force aliasing to be skipped and see whether that causes the problem to go away:
%
This tells
sendmail
to send an empty mail message (one containing
mandatory headers only) to the recipient named
Other switches, such as 24.6.2 Filtering Recipients with a Shell Script
The
#!/bin/sh EX_OK=0 # From <sysexits.h> EX_NOUSER=67 # From <sysexits.h> EX_SOFTWARE=70 # From <sysexits.h> if [ ${#} -ne 2 ]; then echo Usage: $0 list-name exit $EX_USAGE fi trap "exit 70" 1 2 13 15 LIST= "`/usr/lib/sendmail -bv $1 \ | grep "mailer local" 2>&1`" \ | sed 's/\\.\\.\\..*$//' if [ -z "$LIST" ] echo "$1 expanded to an empty list" exit $EX_NOUSER fi if /usr/lib/sendmail -n $LIST >/dev/null 2>&1 then exit $EX_OK fi exit $EX_SOFTWARE
The
sendmail
program is called twice inside this script. First, it
is given the
user1... deliverable: mailer local, user user1 user2@otherhost... deliverable: mailer smtp, host otherhost, user user2@otherhost
The
grep
(1) program selects only those lines that
contain the expression
The
sendmail
program is called with the
Note that this script should not be used as is because it checks only for the delivery
agent named |
|