[Mimedefang] How do you block all outgowing spam?

Matthew.van.Eerde at hbinc.com Matthew.van.Eerde at hbinc.com
Wed Oct 13 19:18:18 EDT 2004


scohen wrote:
> Hello,
> 
> I am trying to find a way to drop all outgoing mail that gets
> marked as
> spam while still passing along incomming mail. I realize that I can
> do something like this: 
> 
> if ( $Sender=~/\@domain.com/ ) {
> 	action_quarantine_entire_message();
> 	action_discard();
> }
> 
> underneath the section that begins with:
> if ($hits >= $req) {
> 
> But what do I do if I have outgoing mail from many different domains?
> 
> Steve Cohen

You could do this (untested)

at top slave level:
my @localdomains = (...)

in filter_end:
	for my $recip (@Recipients)
	{	my $islocal = 0;
		for my $domain (@localdomains)
		{	if ($recip =~ /[\@\.]$domain>?$/i)
			{	$islocal = 1;
				last;
			}
		}

		if (not $islocal)
		{	action_quarantine_entire_message();
			delete_recipient $recip;
		}
	}

If an email is to some local and some nonlocal recipients I believe this does what you mean
I believe that if all recipients are deleted this has the same effect as an action_discard

Matthew.van.Eerde (at) hbinc.com                 805.964.4554 x902
Hispanic Business Inc./HireDiversity.com         Software Engineer
perl -e"map{y/a-z/l-za-k/;print}shift" "Jjhi pcdiwtg Ptga wprztg,"



More information about the MIMEDefang mailing list