Wietse Venema: > 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}}
The transport_maps key needs to be ".invalid" unless you tweaked the parent_domain_matches_subdomains setting. > /etc/postfix/recipient_bcc.pcre: > /^(.+@my\.domain)$/ $1.invalid > > /etc/postfix/smtp_generic.pcre: > /^(.+)\.invalid$/ $1 > > >