Kenneth Porter wrote:
I've got the following function for bouncing spam/viri in my office server. This gets invoked whenever the filter would bounce or discard, such as when the spam score is over 10.

If the mail was addressed to a legitimate local mailbox (other than info or hostmaster) I want to quarantine instead of drop, but I'm still getting quarantines for a single local recipient of info or hostmaster, so I've got a bug in that expression I need help with.

sub action_discard_bounce ($) {
       my($message) = @_;
       # don't quarantine if all recipients are @sewingwitch.com
       my $non_sewingwitch =  grep !/[EMAIL PROTECTED]/i, @Recipients;
       # check for only recipient being
       # hostmaster or info (almost certain spam so don't quarantine)
       if ( $non_sewingwitch &&
            ( (scalar @Recipients != 1) ||
              ($Recipients[0] !~
/^(info|hostmaster)[EMAIL PROTECTED]/) )) {
               action_quarantine_entire_message(
"action_discard_bounce $message");
       }
       if (MTA_is_domain_MX($MyDomain,$RelayAddr)) {
               # don't pester mx backup
               return action_discard();
       } else {
               return action_bounce($message);
       }
}

Kenneth,

I think something similar has recently come up on the list. what's the actual value of $Recipients[0]? if it's '<[EMAIL PROTECTED]>' (no quotes) then it won't match, and it'll call action_quarantine_entire_message. (because you're testing for with !~)

hope this helps

alan
_______________________________________________
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