On 6/21/2015 6:55 PM, PGNd wrote: > On Sun, Jun 21, 2015, at 03:15 PM, PGNd wrote: >> The link references will surely provide the solution; just not obvious quite >> yet. > > Attempting to design a config for mail sent from backend valid user > ([email protected]) to 'spam@' address on frontend, specifically to > "[email protected]" to be piped to a script. > > On the frontend > > /main.cf > myhostname = mailhost.DDDD.com > mydomain = mail.DDDD.com > myorigin = $mydomain > mydestination = $myhostname localhost.$mydomain localhost > $mydomain > relay_domains = DDDD.com > DDDD1.com > ... > DDDDn.com > parent_domain_matches_subdomains = > > local transport is enabled > > local_transport = local:$myhostname > > for the recipients 'known' as local > > local_recipient_maps = > lmdb:/usr/local/etc/postfix/local_recipient_map > > /local_recipient_map > [email protected] IGNORED_VALUE > [email protected] IGNORED_VALUE > > In this frontend/backend setup, all outbound mail from the backend is sent > to/via a SMARTHOST service on the frontend. > > I need to conditionally intercept sent-to/via-smarthost email to either > > (1) accept/pipe mail to "[email protected]" or > "[email protected]" to a local SA learn script
For local addresses, use an alias maps entry to pipe the mail to a program during local delivery. main.cf alias_maps = hash:/path/aliases # aliases spam: | /path/spam ham: | /path/ham http://www.postfix.org/aliases.5.html -- Noel Jones
