[Mimedefang] Block all spam from one user?
Rick Mallett
rmallett at ccs.carleton.ca
Thu Nov 28 14:28:00 EST 2002
Rich West writes:
>
> I'm sure this has come up before, but I couldn't find exactly what I was
> looking for in the archives. Basically, what I am trying to do is blow
> ANYTHING that SpamAssassin (or that contains a virus) from going to one
Huh? I'm having a bit of trouble deciphering that sentence, but I presume
you mean "blow away anything that Spamassassin flags as spam, or anything
that contains a virus", although that interpretation is somewhat at odds
with the observation "no matter where they are" which doesn't seem to
have any relevance.
> particular email address hosted by us. That email address is a helpdesk
> which provides support for end users (no matter where they are).
>
> The snippet that I have tried is below.. it is from filter_end(), and,
> unfortunately, it is not working as expected... Any ideas as to how to
> do this properly?
>
> Thanks!
> -Rich
>
You probably want action_discard rather than action_bounce and and I
don't know where you came up with the variable $recipient but unless its
a global variable you set in the filter_begin routine, it doesn't exist and
you have to check against the @Recipients array, and you might want to take
note that variables in Perl are case sensitive. There are many ways to do it
in Perl, but the most straightforward is probably
foreach $recipient (@Recipients) {
action_discard() if $recipient =~ /support\@mydomain.com/i;
}
> # Spam checks if SpamAssassin is installed
> if ($Features{"SpamAssassin"}) {
> if (-s "./INPUTMSG" < 100*1024) {
> # Only scan messages smaller than 100kB. Larger messages
> # are extremely unlikely to be spam, and SpamAssassin is
> # dreadfully slow on very large messages.
> my($hits, $req, $names, $report) = spam_assassin_check();
> if ($hits >= $req) {
> md_log('spam', $hits, $RelayAddr);
> return action_bounce("Message Detected As SPAM -
> Delivery Denied") if ($recipient =~ /support\@MYDOMAIN.COM/i );
>
>
> _______________________________________________
> MIMEDefang mailing list
> MIMEDefang at lists.roaringpenguin.com
> http://lists.roaringpenguin.com/mailman/listinfo/mimedefang
>
- rick --
More information about the MIMEDefang
mailing list