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

Reply via email to