[Mimedefang] Checking Sendmail's /etc/mail/access.db

wrolf.courtney at donovandata.com wrolf.courtney at donovandata.com
Wed Sep 3 12:51:00 EDT 2003




I have just started using this in mimedefang-filter:

# Do not spam check e-mail whitelisted in /etc/mail/access.db
# WC 9/3/2003
use DB_File;

# If SpamAssassin found SPAM, append report.  We do it as a separate
# attachment of type text/plain
sub filter_end ($) {
...
    # Do not spam check e-mail whitelisted in /etc/mail/access.db
    # WC 9/3/2003
    my $access_db = "/etc/mail/access.db";
    tie %access_hash,  'DB_File', $access_db, O_RDONLY;
    my $LHS = $Sender; $LHS =~ s/^<//; $LHS =~ s/>$//;
    $LHS = 'from:' . lc($LHS);
    $RHS = $access_hash{$LHS};
    md_graphdefang_log('access', $LHS, $RHS);
    untie %access_hash;
    return if defined($RHS) and $RHS =~ /^RELAY|^OK/;

    # Spam checks if SpamAssassin is installed
    if ($Features{"SpamAssassin"}) {

Wrolf Courtney
Donovan Data Systems, Inc.
(212) 633-5470




More information about the MIMEDefang mailing list