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 > (us...@dddd1.com) to 'spam@' address on frontend, specifically to > "spam.1...@mail.dddd.com" 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 > spam.1...@mail.dddd.com IGNORED_VALUE > ham.1...@mail.dddd.com 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 "spam.1...@mail.dddd.com" or > "ham.1...@mail.dddd.com" 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