[Mimedefang] Ignoring Filtering to Individual Recpients

Jim McCullars jim at info.uah.edu
Tue Jun 24 16:15:06 EDT 2008



On Tue, 24 Jun 2008, Richard J. Kieran wrote:

> Jim McCullars wrote:
> >
> >sub filter_recipient {
> >  my ($recipient, $sender, $ip, $hostname, $first, $helo,
> >        $rcpt_mailer, $rcpt_host, $rcpt_addr) = @_;
> >
> >  if($recipient =~ /^<?postmaster\@/i) { # don't filter mail to postmaster
> >    return('ACCEPT_AND_NO_MORE_FILTERING', "ok")
> >  }
> >}
> >   Just replace postmaster in the regexp above with the name of the user
> >you don't want to filter.

   As was pointed out previously, you need this line:

        return ('CONTINUE', 'ok');

above the final closing brace.  I had copied that snippet from my
filter_recipients and forgot to include it.

>
> This sounds very cool. Makes me wonder if it would avoid the problem that occurs with
> SpamAssassin wherein whitelisting a recipient causes mail addressed to them to go to
> all recipients on the message. This "feature" makes whitelist_to kind of unusable.
> Would this method suffer from the same problem?

   Yes, if there were 5 recipients and postmaster was one of them, all
would get the unfiltered email.

> Could a routine be written to
> remove all recipients and then add only the one tested for? If so, a snippet of code
> would be helpful. TIA.

   I dunno, David, does ACCEPT_AND_NO_MORE_FILTERING work from anywhere in
the filter, or just from the filter_sender/recipient/relay/helo subs?

Jim





More information about the MIMEDefang mailing list