Ron Garret:
> Is there an easy way to tell postfix to send a copy of every message
> it receives to a ?shadow server? in a way that preserves the SMTP
> envelope?  I?m trying to tune a spam filter on actual data, but I
> don?t want to do it on my production server because the tuning is
> likely to break things.

Add a BCC recipient in an invalid domain, route the invalid domain
to the shadow server, then strip that domain during delivery. This
works as long as you don't receive mail for the invalid domain.

        Wietse

Modulo some typos:

/etc/postfix/main.cf:
    recipient_bcc_maps = pcre:/etc/postfix/recipient_bcc.pcre
    smtp_generic_maps = pcre:/etc/postfix/smtp_generic.pcre
    # Use a hash: map if you're stuck with 7+ year old Postfix 2.x.
    transport_maps = inline:{{invalid = smtp:shadow.example.com}}

/etc/postfix/recipient_bcc.pcre:
   /^(.+@my\.domain)$/ $1.invalid

/etc/postfix/smtp_generic.pcre:
   /^(.+)\.invalid$/ $1


Reply via email to