[Mimedefang] Ignoring Filtering to Individual Recpients

Colin Milam milam at bell-group.net
Mon Jun 23 16:36:50 EDT 2008


Hey great answer. Thanks to every ones help...

I had to alter your filter a little as it drops all mail except the
recipient listed. A small addition of a second return ok statement
sorted that a treat.

Regards

Colin

-----Original Message-----
From: mimedefang-bounces at lists.roaringpenguin.com
[mailto:mimedefang-bounces at lists.roaringpenguin.com] On Behalf Of Jim
McCullars
Sent: 23 June 2008 21:06
To: mimedefang at lists.roaringpenguin.com
Subject: RE: [Mimedefang] Ignoring Filtering to Individual Recpients



On Mon, 23 Jun 2008, Colin Milam wrote:

> I'm getting my head around creating the sub filter_recipients but I am
a
> little unsure where about it needs to go in the mimedefang-filter?

   It can go anywhere in the file, in mine it's just below
filter_sender.
All you really need is something like this:

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.  Make sure you enable the mimedefang command
line option to enable recipient checking.

   HTH...

Jim McCullars
University of Alabama in Huntsville

_______________________________________________
NOTE: If there is a disclaimer or other legal boilerplate in the above
message, it is NULL AND VOID.  You may ignore it.

Visit http://www.mimedefang.org and http://www.roaringpenguin.com
MIMEDefang mailing list MIMEDefang at lists.roaringpenguin.com
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang


Bell Microsystems Limited, Registered in England (no: 3102360).
Registered Office: New Hampshire Court, St Pauls Road, Portsmouth, Hampshire, PO5 4AQ.



More information about the MIMEDefang mailing list