[Mimedefang] md_check_against_smtp_server and md_graphdefang_log

kd6lvw at yahoo.com kd6lvw at yahoo.com
Tue Mar 26 14:53:34 EDT 2013

--- On Tue, 3/26/13, James Curtis <jameswcurtis at hotmail.com> wrote:
> sub filter_recipient
> {
> my ($retval, $code, $dsn, $text) =
> md_check_against_smtp_server($sender, $recip, "localhost", "");
> #     my($recip, $sender, $ip, $host, $first, $helo, $rcpt_mailer, $rcpt_host, $rcpt_addr) = @_;
> #     return
> md_check_against_smtp_server($sender, $recip, "mail.hml.com", "");
>       if ($retval eq "Reject") {
>         md_graphdefang_log('notauser', $recip, $sender);
> }else{
>         md_graphdefang_log('valid', $retval, $code);
>         }
> }

How does that prove that the rejection was for the unknown recipient mailbox?  One needs to inspect the actual rejection code to determine this; not merely that a rejection occurred.  The sending address could have been blacklisted.

Extended codes:
5.1.1 - No such destination mailbox.
5.1.3 - Bad destination mailbox syntax (should have been checked by the current relay MTA but wasn't)
5.1.4 - Destination mailbox ambiguous (matches multiple possibilities)
5.2.1 - Destination mailbox (valid but) disabled
5.2.2 - Destination mailbox full  (also may be tempfailed)
5.2.3 - Message too big (if the SIZE parameter is used with MAIL FROM)
5.3.1 - Mail system full (usually disk storage full)
5.3.4 - Message too big (systemwide limit, as opposed to a per user limit)

and these which have nothing to do with the recipient:
5.1.7 - Bad sending mailbox syntax
5.1.8 - Bad sending mailbox's system address
5.7.1 - Spam or other similar refusal (mailboxes otherwise valid)

Only the first two indicate a "no valid user," but all of these (and probably others) can occur during such a test.  Can you 100% guarantee that these other error reasons will never occur between your primary and secondaries?  I don't think so....

More information about the MIMEDefang mailing list