[Mimedefang] Running SA checks on specific users only

Jason Englander jason at englanders.cc
Thu May 29 11:52:01 EDT 2003


On Wed, 28 May 2003 listuser at numbnuts.net wrote:

> filtering.  Is it possible to only run SA checks on those users and not
> the rest (which are Sendmail aliases)?  It's not really hurting anything
> like it is now.  I thought I'd ask though.

Something like this will set it to use SA if the e-mail is going to any
of the following envelope recipient addresses (which may not be the same
as the To: header address(es)):

user1 at foo.org
user2 at blah.net
joeschmo at abcd.com
*@mydomain.org
jason at abcd.net
joe at abcd.net
jason at efgh.net
joe at efgh.net

my $use_spamassassin = 0;
foreach my $recip (@Recipients) {
  $recip = lc($recip);
  $recip =~ tr/<>//d;
  $use_spamassassin = 1 if $recip eq 'user1 at foo.org' ||
    $recip eq 'user2 at blah.net' || $recip eq 'joeschmo at abcd.com' ||
    $recip =~ /@mydomain\.org$/ ||
    $recip =~ /^(jason|joe)@(abcd|efgh)\.net$/;
}
if ($use_spamassassin) {
  # use SpamAssassin
}


If you truly only want it run on certain users, and not just messages
where one of those users is one of the recipients, use
stream_by_recipient()  Then you just have to check this:

my $recipient = lc($Recipients[0]);
$recipient =~ tr/<>//d;
if ($recipient eq 'joe at foo.org') {
  # use SpamAssassin
}

Don't use it unless you have to though.  Remailing a message with 40
recipients (to become 40 messages with 1 recipient) will add load to your
box.

  Jason

-- 
Jason Englander <jason at englanders.cc>
394F 7E02 C105 7268 777A  3F5A 0AC0 C618 0675 80CA




More information about the MIMEDefang mailing list