?????? ?????:
> Thanks for the answers.
> 
> About domain name - the thing is that right now i see exactly the next
> message (except ip address) "Received: from mail.localdomain
> ([ip.add.re.ss]) by mx.google.com..". And "mail.localdomain" is a

Most SMTP servers including Postfix will log TWO NAMES:

    Received: from mail.localdomain (reverse-name [ip.add.re.ss]) ...

where reverse-name is taken from the DNS PTR record for the SMTP
client IP address. If the TWO NAMES differ then some receivers
consider that a sign of spamminess. To fix that each domain would
need its own IP address.

> local alias. So, it cant be resolved from external network. So, it
> cant depend from real ip address. So, only postfix can say to
> mx.google.com that postfixbox is "mail.localdomain".

As Noel suggested, you can use sender_dependent_default_transport_maps,
but most people think it is not worth the trouble.

UNTESTED example:

/etc/postfix/main.cf:
    sender_dependent_default_transport_maps = hash:/etc/postfix/def_transport

/etc/postfix/def_transport:
    @example.com        smtp-example-com
    @example.net        smtp-example-net

/etc/postfix/master.cf:
    smtp-example-com   unix  -       -       -       -       -       smtp
        -o myhostname=mail.example.com
        -o smtp_header_checks=pcre:/etc/postfix/example-com.pcre
        #-o smtp_bind_address=ip.addr.for.example-com

    smtp-example-net   unix  -       -       -       -       -       smtp
        -o myhostname=mail.example.net
        -o smtp_header_checks=pcre:/etc/postfix/example-net.pcre
        #-o smtp_bind_address=ip.addr.for.example-net

/etc/postfix/example-com.pcre:
    /^(.*)\bmail\.local\.domain\b(.*)$/ ${1}mail.example.com${2}

/etc/postfix/example-net.pcre:
    /^(Message-ID:.*)\bmail\.local\.domain\b(.*)$/ ${1}mail.example.net${2}

Clearly, most of this can be generated mechanically.

References:
http://www.postfix.org/postconf.5.html#sender_dependent_default_transport_maps
http://www.postfix.org/master.5.html
http://www.postfix.org/header_checks.5.html
http://www.postfix.org/pcre_table.5.html
http://www.postfix.org/postconf.5.html#smtp_bind_address

        Wietse

Reply via email to