Score:0

Figure out the processing chain for receiving mail

tz flag

How can I figure out the exact order of transformations and milters in my sendmail setup?

My problem is that I'm getting mail for a deleted account, and it's being spam checked, despite the fact that it ought to tossed the moment it knows the recipient.

AnFi avatar
fi flag
What is reported by the following debug command (executed by root)? `echo "3,0 [email protected]" | sendmail -bt`
Hack Saw avatar
tz flag
It parses down to a local name, but so does a username which has never existed on my box.
AnFi avatar
fi flag
Does `sendmail -bv [email protected]` produce different results? Does "deleted account" mean "deleted **OS** account" or "deleted email account"?
Hack Saw avatar
tz flag
On my box a deleted OS account is also a deleted mail account. -bv gives back "User Unknown"
Score:1
in flag

As far as I recall milters get executed in the order they're defined. i.e. InputMailFilters=milter1, milter2, as do all rules in the sendmail.cf configuration file.

I has been ages since I last configured sendmail and that was always a complete PITA for all things not standard (and even then). As far as I remember sendmail would not check the existence for a recipient immediately, but if the domain is local would accept the message during the SMTP dialog and then do further processing and send a bounce later if the specific user is found to be invalid. That might be the reason your milters get executed even for invalid recipients.

For from ideal, but your best bet might be to enable the blacklist_recipients as IIRC that is a test that gets performed during the SMTP dialog and should prevent the message for named invalid recipients from getting accepted in the first place. Sendmail should reject mail for thus addresses during the SMTP dialog and not do any further processing all:

 FEATURE(`blacklist_recipients')

then you can add entries to the access map for local users and/or addresses in your domain, where the user has been deleted and which should no longer receive mail:

 badlocaluser@                  ERROR:550 Mailbox disabled for this username
 [email protected]        ERROR:550 Mailbox disabled for this username

That adds some overhead as you need to both disable user accounts as well as "document" them as deleted in the access table.

Hack Saw avatar
tz flag
Hadn't thought of putting the ex-user into access, trying that.
Hack Saw avatar
tz flag
blacklist has been enabled for a long time for the Greet Pause facility. And it is before any of the milters.
Hack Saw avatar
tz flag
Oooooh, I think you might have solved a different problem for me. Spamassassin never seemed to care about DKIM. Maybe I know why now...
Hack Saw avatar
tz flag
Or not. Hmmm. Didn't really change anything in the X-Spam-Status. Oh well. If the usual noon time run of crap come, it'll be a more complete test.
HBruijn avatar
in flag
That’s too bad. Good luck with your further investigations
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.