-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Jeroen Geilman Sent: Thursday, March 10, 2011 4:44 PM To: [email protected] Subject: Re: Running a script, archiving, then forwarding.
On 03/11/2011 12:26 AM, Alan Fullmer wrote: > > > -----Original Message----- > From: [email protected] > [mailto:[email protected]] On Behalf Of Wietse Venema > Sent: Saturday, March 05, 2011 6:26 PM > To: Postfix users > Subject: Re: Running a script, archiving, then forwarding. > > Alan Fullmer: > >> I am attempting to receive mail from one or many domains. I am then >> trying to run a script that [essentially] archives all mail coming >> > through. > >> Lastly, forwarding the messages onto another server. >> > Use the Postfix built-in recipient_bcc_maps feature to ADD a recipient > that resolves to your script. > > /etc/postfix/main.cf: > recipient_bcc_maps = pcre:/etc/postfix/recipient_bcc > transport_maps = hash:/etc/postfix/transport > script_destination_recipient_limit = 1 > > /etc/postfix/recipient_bcc: > /(.*)@(the\.example\.com)$/ $1-$2@some-domain-here > > /etc/postfix/transport: > some-domain-here script: > > /etc/postfix/master.cf: > script unix - n n - - pipe > flags=FR user=some-user-here argv=/some/where/script $recipient > > References: > http://www.postfix.org/postconf.5.html#recipient_bcc_maps > http://www.postfix.org/postconf.5.html#transport_maps > http://www.postfix.org/postconf.5.html#transport_destination_recipient > _limit http://www.postfix.org/transport.5.html > http://www.postfix.org/master.5.html > > > Wietse > > > ------------- > > So this works wonderfully. It does everything as expected, except the > forwarding after the script has run. I added the IP of the server in > relayhost: > relayhost = [192.168.10.1] > > But it acts like it's not even paying attention to that. > > This is the only thing that doesn't seem to be working properly. > > Any thoughts? > What are you trying to do here ? You want to relay the original message offsite, or the copy ? The original message will go where it will go, you don't have to do anything for that. Since you archived the copy, what else do you want to do with that ? -- J. ----------------------- after much persuading, I think this thing is working. Sorry for the false alarm on this last part. Thanks for everyone's help, it's greatly appreciated.
