I have sendmail set up to accept mail for a few domains and to relay messages for a few subnets' worth of systems. Recently a particular internal-use-only address has been receiving a lot of spam. I've been asked to simply drop any mail destined for this address unless the mail originated from one of the computers for which this system will relay mail.
I know I can do this with procmail, but I'd prefer to tie it into sendmail so that nonconforming email will be rejected outright at the MTA level. I can't figure out how to get sendmail to do this (or whether it's even possible).
I have sendmail configured with the following settings:
FEATURE(`access_db', `hash -T<TMPF> -o /etc/mail/access.db')` FEATURE(`blacklist_recipients')
example.com RELAY connect:192.168.15 OK to:firstname.lastname@example.org REJECT
And I'm generating
makemap hash /etc/mail/access.db </etc/mail/access.
When I try to use that configuration, however, even local machines get
550 5.2.1 <email@example.com>... Mailbox disabled for this recipient messages when trying to send to the internal address.
Can I configure sendmail to do what I want and, if so, how?