[Mimedefang] filter_recipient is never called

Fernando Gleiser fgleiser at cactus.fi.uba.ar
Thu Oct 2 13:27:00 EDT 2003


I'm having some problems trying to filter by recipient.

The server runs FreeBSD 4.8, mimedefang-2.37.

We have a list of users who are allowed to receive mail from the
Internet, and a few "for internal use only" ones.

I added the following su to mimedefang_filter:

sub filter_recipient {
        my ($recipient, $sender, $ip, $hostname, $first, $helo,
            $rcpt_mailer, $rcpt_host, $rcpt_addr) = @_;

        if ( $ip eq "10.186.12.47" ) {
                return ('CONTINUE', "ok");
        }
        open ALLOW, "/etc/mail/usr-allow" or return ('CONTINUE', "ok");

        $recipient=~tr/A-Z/a-z/;
        $recipient=~s/<>//g;

        while (<ALLOW>) {
                if ($_ eq $recipient) {
                        close ALLOW;
                        return ('CONTINUE', "ok");
                }
        }

        md_syslog('notice', "Usuario $recipient no esta en la whitelist");
        return ('REJECT', "$recipient esta bloqueado");
}

The problem is, it never gets called. I've added a md_syslog at the top
of it, just before the "if ( $ip...", to check this, but it doesn't log
anything.

Before you ask, yes I'm calling mimedefang with the -t switch, I've
added MX_SENDER_CHECK=yes to the rc script.

These are the full command lines of both mimedefang and the multiplexor:

/usr/local/bin/mimedefang-multiplexor -p /var/spool/MIMEDefang/mimedefang-multiplexor.pid -m 2 -x 10 -U mailnull -b 600 -R 10000 -M 30000 -l -s /var/spool/MIMEDefang/mimedefang-multiplexor.sock

/usr/local/bin/mimedefang -P /var/spool/MIMEDefang/mimedefang.pid -m /var/spool/MIMEDefang/mimedefang-multiplexor.sock -U mailnull -t -p /var/spool/MIMEDefang/mimedefang.sock

Any help would be greatly apreciated.
Thanks in advance.



				Fer





More information about the MIMEDefang mailing list