Andrew Embury wrote:
> What I would like to do
> is have a [EMAIL PROTECTED] address for each distinct domain I
> am hosting.� Does anyone have a recipe or other wisdom to share in
> making this happen? 

Hmmm... what would you do if a single piece of spam was addressed to recipients in 
multiple domains?  Forward to both?

Maybe something like this in mimedefang-filter (untested)

# spamdrop is hash; key = domain, value = address
sub load_spamdrops();
my %spamdrops = load_spamdrops();


filter_end()
{       ...
        # inside "well, we know it's spam" block...
        my %recipient_domains = ();
        for my $recip (@Recipients)
        {       delete_recipient($recip); # original recipient should not get it
                $recip =~ /\@(.*?)>?$/; # extract domain
                my $domain = $1 or next; # skip weird emails
                $recipient_domains{$domain}++;
        }
        # at this point %recipient_domains has keys for all recipient domains
        my %spamdrop_addresses = ();
        for my $domain (keys %recipient_domains)
        {       if ($spamdrops{$domain})
                {       my $address = $spamdrops{$domain};
                        $spamdrop_addresses{$address}++;
                }
        }
        # at this point %spamdrop_addresses has keys for all spamdrops
        for my $address (keys %spamdrop_addresses)
        {       add_recipient($address);
        }
        ...
}

sub load_spamdrops()
{       # statically hardcode
        # or pull from LDAP
        # or whatever

        return
        (       "first.example.com" => "[EMAIL PROTECTED]",
                "second.example.com" => "[EMAIL PROTECTED]",
                ...
        );
}

_______________________________________________
Visit http://www.mimedefang.org and http://www.canit.ca
MIMEDefang mailing list
[EMAIL PROTECTED]
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang

Reply via email to