-- Jan Pieter Cornet <[EMAIL PROTECTED]> wrote:
I just checked the sendmail 8.13.3 source to really confirm what I know about recipient processing in sendmail. This is what actually happens after RCPT To: (see sendmail/srvrsmtp.c, search for "case CMDRCPT:" if you want to read along. I'll skip anything not related to verifying the recipient).
1) lexical validation of the address (this actually happens inside parseaddr() in the parseaddr.c file). 2) call ruleset 3 3) call ruleset 0 4) resolve to (mailer, host, address) triple. 5) in case of the #$error mailer, PROCESS THE ERROR. 6) call check_rcpt 7) call any Milters (the xxfi_envrcpt callbacks). 8) check illegal mailer attempts (eg RCPT To:/etc/passwd) (this step and below are from recipient.c:recipient()) 9) if the select mailer wants any of the following, do so: alias processing, userdb lookups, ruleset 5 (in that order, btw) 10) lookup the target in the passwd file if the selected mailer wants that.
This list is an excellent clarification that should be in the sendmail documentation somewhere! But there's more to this. Check the smtp conversation:
mail from:<> 250 2.1.0 <>... Sender ok rcpt to:<[EMAIL PROTECTED]> 250 2.1.5 <[EMAIL PROTECTED]>... Recipient ok rcpt to:<[EMAIL PROTECTED]> 550 5.1.1 <[EMAIL PROTECTED]>... User unknown
Clearly it checks all the way to step 10 per recipient, in order to see that the first address is good and the second address is unknown. And it does not have the message body yet. So the milter call in the list is the one that Mimedefang filters call filter_recipient.
But after the DATA command, it calls the milter again, and we do most of the Mimedefang work at that time.
What I wish we knew at that point is how many recipients were tried and not just how many were valid. But I think sendmail only stores the valid ones, as it has already taken care of the invalid ones with 550 response. Either in milter or sendmail, it would be useful to count bad addresses and take some action on that.
Joseph Brennan Academic Technologies Group, Academic Information Systems (AcIS) Columbia University in the City of New York
_______________________________________________ Visit http://www.mimedefang.org and http://www.canit.ca MIMEDefang mailing list [email protected] http://lists.roaringpenguin.com/mailman/listinfo/mimedefang

