I'm trying to archive incoming mail by routing it to a PHP script (which inserts it into a database) before sending the email to the destination server.
If I configure my /etc/postfix/transport as such:
example.com smtp:[192.168.1.100]
My email will then be forwarded to the Exchange server (192.168.1.100 for testing) to the appropriate mailbox.
If I configure my /etc/postfix/transport as such:
example.com myarchive:
Then incoming email is piped to a PHP script and inserted into a database, however it never makes it to Exchange.
I've tried adding multiple transports
example.com myarchive: smtp:[192.168.1.100]
But it only makes it to the first one listed (I've tried both ways). Can something like this be achieved to archive a mail before sending it on its merry way?
Note: "myarchive" is set up in /etc/postifx/master.cf
as:
myarchiver unix - n n - - pipe
flags=FR user=mailarchive argv=/home/mailarchive/pipe.php
${nexthop} ${user}