[Mimedefang] greylisting

David F. Skoll dfs at roaringpenguin.com
Fri Nov 28 08:20:04 EST 2003


On Fri, 28 Nov 2003, Lee Dilkie wrote:

> $SendmailMacros{'auth_authen'} doesn't seem to be set to anything for an
> authenticated connection during filter_recipient(). This macro does exist
> during filter_begin(). Is there a reason why it gone during
> filter_recipient()

Efficiency.  We don't necessarily want to parse the COMMANDS file for
filter_relay, filter_sender and filter_recipient.

If you need to access auth_authen during filter_recipient, you can open
the COMMANDS file and look for the appropriate line (as documented in
mimedefang-protocol(7)).

Something like this:

sub is_authenticated () {
    open(COMM, "<./COMMANDS") or return 0;
    while(<COMM>) {
        if (/^=auth_authen/) {
            close(COMM);
            return 1;
        }
    }
    close(COMM);
    return 0;
}

Then in filter_recipient:

    if (is_authenticated()) {
        # Skip greylisting
    } else {
        # Do greylisting
    }

--
David.



More information about the MIMEDefang mailing list