Using sendmail, I am trying to setup a catchall address to silently discard spam mail sent to undefined users. I don't want to bounce a reply for "no user" as this often goes back to munged or innocent addresses.
I have a number of domains, so my virtuser table currently looks rather like this:
Code:
# map my_domain.com to my_domain.co.uk
@my_domain.com %1@my_domain.co.uk
user1@my_domain.co.uk user1
user2@my_domain.co.uk user2
# etc...
@my_domain.co.uk catchall
The last line is the "catchall" which is intended to ensure that any undefined users from either my_domain.com or my_domain.co.uk is forwarded to the non-existent "catchall" user account. Note that all mail sent to my_domain.com is passed across to my_domain.co.uk at the very start so all the following rules should apply to messages received at both domains. (Both of these domains appear in the
Being non-existent, I setup the following rules in the access data table:
Code:
# Check the /usr/share/doc/sendmail/README.cf file for a description
# of the format of this file. (search for access_db in that file)
# The /usr/share/doc/sendmail/README.cf is part of the sendmail-doc
# package.
#
# by default we allow relaying from localhost...
Connect:localhost.localdomain RELAY
Connect:localhost RELAY
Connect:127.0.0.1 RELAY
catchall@ DISCARD
This way, if I send an email to 'user1@my_domain.com' it is received and delivered to
user1@my_domain.co.uk, but if I send an email to 'rubbish@my_domain.com' it *should* be received and silently discarded.
Unfortunately what actually happens is the server responds with:
Final-Recipient: rfc822;
rubbish@my_domain.com
Action: failed
Status: 5.0.0
Diagnostic-Code: X-Postfix; host pbx.check-flight.com[xx.xx.xxx.xx] said: 550
5.1.1 <rubbish@my_domain.com>... User unknown (in reply to RCPT TO
command)
Now, (just for testing), I made "catchall" an alias for the "postmaster" account and the mail was then received and delivered into the postmaster mailbox. So I know the virtuser rule is working. The account "catchall", however, is not being silently dropped as desired in either configuration.
Anybody have any ideas how to make this work as intended?
Thanks.
Andy Woolford