On 8/17/2010 4:37 PM, Wietse Venema wrote:
Zhou, Yan:
Hi there,
I have defined my own process to handle all incoming emails, by using a
local transport.  My master.cf has entry like this, where the Python
script delegates each mail processing to somewhere else.

connector     unix  -       n       n       -       -       pipe
    flags= user=testuser argv=python /usr/local/bin/connector.py


A problem I run into is that if I am sending an email out, and it gets
bounced back, it is going through the above transport.

Does Postfix see regular incoming mail and bounced mail (bounced by
remote SMTP server) the same?  Can we somehow separate their processing
into two different transports?
By default, Postfix delivery decisions are based solely on envelope
recipient addresses. If you send mail to a non-existent address,
then the non-delivery report will be sent to your email address.

You can configure Postfix via access(5), header_checks(5) and
body_checks(5) tables to make delivery decisions based on other
message properties than the envelope recipient address; in addition
some Postfix features provide mail handling that is controlled by
the envelope sender address.

        Wietse
you can also use it how you have it configured but do not use 'connector' as a domain transport (transport_map). Instead, find (omitting the **'s) in your master.cf:
smtp      inet  n       -       n       -       -       smtpd
               -o content_filter=connector

and add the -o content_filter like above

If you have spamassassin or some other filter, add -o content_filter=spamassassin in your connector section like:
connector     unix  -       n       n       -       -       pipe
     flags= user=testuser argv=python /usr/local/bin/connector.py

-o contect_filter=spamassassin (or whatever process spamassassin is named)
This causes postfix to send it to spamassassin first and then connector, 
because you sent postfix from the smtp to the connector and the 
connector said to go to spamassassin first, come back to connector, and 
then go back to postfix. If you want to do multiple checks with several 
different processes, add an -o content_filter to each process's section 
until you have one that does not have a content filter.
Jerrale G.
SC Senior Admin

Reply via email to