Emmett Culley via Postfix-users:
> I have a long time running Postfix server (version 2.10) where I need to send 
> from specific IP addresses for some virtual domains.
> 
> I have it working, sort of.  If I send email from this server to another 
> server running postfix, it all seems to work.  The sent email shows the 
> transport required IP address in the header and all is well.  DMARC, SPF and 
> DKIM all pass.
> 
> However, most times I send an email from that server to any gmail account, 
> that email is bounced with the following error from gmail:
> 
> 
> The IP address sending this message does not have
>      a PTR 550-5.7.25 record setup, or the corresponding forward DNS entry 
> does
>      not point 550-5.7.25 to the sending IP. As a policy, Gmail does not 
> accept
>      messages from 550-5.7.25 IPs with missing PTR records. For more
>      information, go to 550 5.7.25
> 
> The email is sometime accepted, but put in the SPAM folder. When I look at 
> the headers for the email sent to SPAM I see that it is not sent from the 
> specified IP address.  When checking the headers in the email that was 
> successfully received by my other postfix server I see that that email is 
> sent from the specified IP address, which is why it passes SFP and FQDN.
> 
> Before I set up the transports to specify different IP addresses for some 
> domains this was all working.  The problem I am attempting to fix it that one 
> of the domains sends out an opt-in newsletter three or four times a month, 
> and so sometimes causes it's IP address to be placed on one or more RBLs.  Of 
> course when that happens all of the other email domains sending on that IP 
> address fail spam checks. So we want to send the newsletters from their own 
> IP address.
> 
> In main.cf:
> 
> myhostname = animalshelter.tld
> mydomain = animalshelter.tld
> mydestination = localhost, ###.##.##.40, ###.##.##.38
> 
> sender_dependent_default_transport_maps = hash:/etc/postfix/sender_transport

Note that this mapping is based on the envelope.from address, not
based on header.from.

> In sender_transport:
> 
> @newsletterdomain.tld    domain_hm
> @animalshelter.tld    domain_vo
> @dogtrainer.tld    domain_vo
> 
> In master.cf:
> 
> domain_hm unix -       -       n       -       -       smtp
>        -o syslog_name=postfix-HM
>        -o smtp_helo_name=newsletterdomain.tld
>        -o smtp_bind_address=###.##.##.38
> 
> ###.##.##.38:smtp inet  n  -  n  -  -  smtpd
>    -o smtpd_sasl_auth_enable=no
>    -o content_filter=amavisfeed:[127.0.0.1]:10040
> 
> domain_vo unix -       -       n       -       -       smtp
>        -o syslog_name=postfix-VO
>        -o smtp_helo_name=animalshelter.tld
>        -o smtp_bind_address=###.##.##.40
> 
> ###.##.##.40:smtp inet  n  -  n  -  -  smtpd
>    -o smtpd_sasl_auth_enable=no
>    -o content_filter=amavisfeed:[127.0.0.1]:10040
> 
> I ran postmap sender_transport and restarted postfix.
> 
> Note that when sending to my other postfix server I see "postfix-HM" in the 
> this server's log, and when sending to gmail "postfix-HM" is not there.
> 
> Sending from any of the other domain on that server to gmail seems to work 
> OK. However, they all send from the animalshelter.tld host which is at 
> ###.##.##.40, and that is that is the IP address that shows up in the 
> received header as the sending IP address.
> 
> I've been beating my head against this wall for a while.  There is clearly 
> something I am not understanding.  Any help would be appreciated.
> 
> TL;DR
> 
> Why is mail received by gmail different than those received by Postfix.

First, verify that your sender_dependent_default_transport_maps is not
pre-empted by a higer-precedence mechanism:

* In order of decreasing precedence, the delivery transport is
  taken from 1) $transport_maps, 2) $sender_dependent_default_transport_maps,
  or $default_transport.

Then, the clue is in the from=<envelope.from> that Postfix logs for
those messages. The envelope.from address determines the transport_maps
entry, and by implication, the smtp_bind_address value.

        Wietse
_______________________________________________
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org

Reply via email to