[Mimedefang] Fw: whitelisting in mimedefang-filter

tonj tonj at freeuk.com
Sat Jul 17 06:34:51 EDT 2010

> anyway the whitelisting fucntion appears to be working now.

oops, spoke too soon. Now I can't send any mail at all. The whitelisting
'appears' to be working (for incoming mail) but all mail outward bound is
reporting socket error. In etc/sysconfig/mimedefang I did MD_EXTRA="-t" and
this is a snippet of my current md-filter:

# Detect and load Perl modules

$IncomingWhitelist{'whitelisteddomain.com'} = 1;
$IncomingWhitelist{'whitelisted.person at whitelisteddomain.com'} = 1;

sub filter_recipient {
    my ($recipient, $sender, $ip, $hostname, $first, $helo, $rcpt_mailer,
$rcpt_host, $rcpt_addr) = @_;
    my @senderparts = split(/@/, $sender);
    my $senderdom = $senderparts[1];
    $senderdom =~ s/[<>]//g;
    if (
       (exists $IncomingWhitelist{lc($sender)}) ||
       (exists $IncomingWhitelist{lc($senderdom)}) ||
       (exists $IncomingWhitelist{lc($recipient)}) )
    return ('ACCEPT_AND_NO_MORE_FILTERING', "ok");
sub filter {
    my($entity, $name, $ext, $type) = @_;
    if ($type =~ /text.html/i) {
        return action_bounce("HTML mail not allowed here, plain text

More information about the MIMEDefang mailing list