[Mimedefang] all_spam_to and mimedefang - accessing envelope sender addresses

Jan Pieter Cornet johnpc at xs4all.nl
Fri Aug 15 16:20:18 EDT 2008

On Fri, Aug 15, 2008 at 02:12:19PM -0400, Mark G. Thomas wrote:
> Is there some way I can use spamassassin rules to match the envelope 
> recipient instead of TO/CC/BCC headers, for recipient-specific rules
> like all_spam_to?  Alternatively, does anyone have any examples of

Yes, see $AddApparentlyToForSpamAssassin in the mimedefang-filter
manpage. This header won't be visible in the messages that are
delivered, so you aren't disclosing Bcc details.

> accomplishing this in mimedefang-filter (via filter_recipient?)?
> I see the example in mimedefang-filter(5), but I really just want
> to bypass all SpamAssassin tests for some given list of possible 
> recipients, or compensate the score.
> Sure, I could configure sendmail to stick it in a header, then use a 
> SpamAssassin header rule, but then that would disclose BCC recipients.
> There are really two related things I'd like to accomplish:
> - Whitelist all inbound messages to certain recipients, using envelope
>    information instead of TO/CC/BCC headers.
> - Be able to accept a whitelisted recipient copy, but still reject
>    for other recipients of that same message.

As Joseph also notes, that might not be possible. There is
stream_by_recipient, but that will cause you to bounce the message,
not reject it.

The only way you can possibly reject it, is by not accepting 
recipients with "mixed" filtering criteria during filter_recipient.
But that's hairy, and can even lead to the loss of email for certain

Jan-Pieter Cornet <johnpc at xs4all.nl>
!! Disclamer: The addressee of this email is not the intended recipient. !!
!! This is only a test of the echelon and data retention systems. Please !!
!! archive this message indefinitely to allow verification of the logs.  !!

More information about the MIMEDefang mailing list