[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.



-----Original Message-----
From: mimedefang-bounces at lists.roaringpenguin.com
[mailto:mimedefang-bounces at lists.roaringpenguin.com] On Behalf Of Jim
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
> 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
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
    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.


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

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