trout writes:
[...]
is there a way to make postmaster@the_various_domains.abc go into one
mailbox?
one way is to resort to aliasdir. I use it as follows:
mail-542# cd aliasdir
mail-543# ls -lab
total 20
drwxr-xr-x 2 courier courier 4096 Sep 26 09:24 .
drwxr-xr-x 12 courier courier 4096 Sep 13 11:48 ..
-rw-r----- 1 courier courier 43 Aug 5 2001 .courier-default
-rwxr-x--- 1 courier courier 1443 Sep 28 11:07 courierdefault.sh
...
mail-544# cat .courier-de*
|| /etc/courier/aliasdir/courierdefault.sh
where the relevant script does something like
the following - check the dot-courier(7) page
#!/bin/sh
# work with lowcase local name
LCLOCAL=`echo $LOCAL | tr '[A-Z]' '[a-z]'`
# I can override the following by explicitely adding
# a mailbox for webmaster under some domain, if not...
case $LCLOCAL in
webmaster|postmaster|admin|abuse|operator|sys|system|root)
NEWADDR="theo...@for.me";;
*)
NEWADDR="";;
esac
# other domains can have different preferences
# I fill them in by host, as I have a small number
# of domains
if [ "$NEWADDR" = "" ]; then
case $HOST in
such*|other*)
case $LCLOCAL in
frequentmisspell*)
NEWADDR=`echo $LOCAL | sed ...`
NEWADDR="$NEWADDR@correct.domain";;
*)
NEWADDR="defaultmailbox@foruser";;
esac;;
wrong.domain)
NEWADDR="$LOCAL@correct.domain";;
esac
fi
if [ "$NEWADDR" = "" ]; then
# if not delivering, I can just drop it
if [ somereason ]; then
exit 99
fi
# or I can bounce it
exit 64
fi
# otherwise I send it to the correct recipient
printf "$NEWADDR\n"
exit 0