[Mimedefang] Failed looping spam

David F. Skoll dfs at roaringpenguin.com
Fri Oct 11 10:39:01 EDT 2002


On Fri, 11 Oct 2002, Tom Horan wrote:

> Nice idea David, never thought of it like that.

> Yes, getting a list of valid smtp address from Exchange onto my sendmail
> boxes wouldnt be a problem.

> So if spam=true, and user=notexist then drop, else relay.

Actually, if you know the user doesn't exist, you can just reject it
in filter_recipient.  There's no point in relaying to the Exchange
machine if you know it will fail.  Something like:

sub filter_recipient {
    my ($recipient, $sender, $ip, $hostname, $first, $helo);
    if (is_for_exchange($recipient) && user_not_exists($recipient)) {
        return(0, "User unknown");
    }
    return(1, "ok");
}

Here, "is_for_exchange" checks the e-mail address and returns true if it
would be relayed to the Exchange box.  If you always relay everything to
the Exchange box, then you can remove that check.

And "user_not_exists" returns true if the user doesn't exist on the
Exchange box.

You have to use the "-t" flag on mimedefang to make it call filter_recipient.

> What does MIMEDefang use for getting list of recipients ? Ie; bcc's, hidden
> recipients etc ...

It uses only the SMTP "RCPT TO:" commands.

Regards,

David.




More information about the MIMEDefang mailing list