[Mimedefang] filter by final recipient

Dave O'Neill dmo at roaringpenguin.com
Wed Sep 21 11:55:36 EDT 2005

On Wed, Sep 21, 2005 at 11:43:15AM -0400, Joseph Brennan wrote:
> I think filtering by final recipient can't be done in a practical way.
> There, if someone takes that as a challenge, good.  By final I mean by
> recipient after aliases and .forward files have been applied.

It's a bit of a hack, but you can find where a local recipient actually
gets delivered after aliases, virtusertable, and .forward are applied
	sendmail -bv user at yourdomain.com

if user at yourdomain.com has their mail sent to otheruser at aol.com, you'll
get output like:
  user at yourdomain.com... deliverable: mailer esmtp, host aol.com, user otheruser at aol.com

If it's locally deliverable, you'll get:
  user at yourdomain.com... deliverable: mailer local, user user

and if it's bogus:
  user at yourdomain.com... User unknown

It will add some overhead to your filter, but it's fairly simple to
invoke sendmail -bv on each recipient address and check for aol.com.
You'd probably want to cache the results for a short period of time to
avoid fork-bombing your server with sendmail processes, though.

Dave O'Neill <dmo at roaringpenguin.com>    Roaring Penguin Software Inc.
+1 (613) 231-6599 ext. 104               http://www.roaringpenguin.com/
For CanIt technical support, please mail: support at roaringpenguin.com

More information about the MIMEDefang mailing list