I need to set up a mail server config for a test environment which would accept all mail (i.e. for all users and all domains, even non-local ones) and put it into a single local catchall mailbox.
What I have is SLES 11 with Sendmail (8.14) where I tried modifying /etc/mail/virtusertable to look like
@ catchall
or like
@* catchall
but to no avail - destination mail addresses (e.g. "santa@northpole.org") are not rewritten to catchall@, so delivery is tried to the appropriate MX:
# sendmail -bt
ADDRESS TEST MODE (ruleset 3 NOT automatically invoked)
Enter <ruleset> <address>
> 3,0 santa@northpole.org
canonify input: santa @ northpole . org
Canonify2 input: santa < @ northpole . org >
Canonify2 returns: santa < @ northpole . org . >
canonify returns: santa < @ northpole . org . >
parse input: santa < @ northpole . org . >
Parse0 input: santa < @ northpole . org . >
Parse0 returns: santa < @ northpole . org . >
ParseLocal input: santa < @ northpole . org . >
ParseLocal returns: santa < @ northpole . org . >
Parse1 input: santa < @ northpole . org . >
MailerToTriple input: < > santa < @ northpole . org . >
MailerToTriple returns: santa < @ northpole . org . >
Parse1 returns: $# esmtp $@ northpole . org . $: santa < @ northpole . org . >
parse returns: $# esmtp $@ northpole . org . $: santa < @ northpole . org . >
It seems like wildcards are not supported in the source domain part of the lookup table.
How would I implement this with Sendmail?
Edit: As per Andrzej's comments I have tried a mailertable entry of
. local:catch-all-outgoing
as well as
.. local:catch-all-outgoing
and received identical output for sendmail -bv
in both cases:
# sendmail -d60.5 -bv jd@example.net
map_lookup(dequote, root, %0=root) => NOT FOUND (0)
map_lookup(host, example.net, %0=example.net) => example.net. (0)
jd@example.net... deliverable: mailer esmtp, host example.net., user jd@example.net
(yes, root, as sendmail
seems unable to run as non-root)
Edit: it turned out, the mailertable feature has not been enabled in the macro file, thus sendmail.cf did not contain the appropriate rewrite rules for it to work.