Author Topic: Postfix uses wrong IP address  (Read 1405 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
Postfix uses wrong IP address
« on: August 28, 2023, 06:15:18 PM »
When i send an email, i have a PTR record for my hostname server.domain.com it has IP 192.168.0.1
I also have an addon IP address 192.168.0.2
IPs and hostname is changed to make this simple.

When i send an email it uses the 192.168.0.2 IP address and not the one for the hostname, this has the "wrong" PTR record, and so gmail blocks the email because its not "correct" ptr and several other parameters.

How do i change this so it doesnt happen? server sends around 1000-2000 mail a day and about 50-100 are blocked. this is quite irritating that it does not use hostname and server IP in CWP for sending email. it uses ANY ip address!

Offline
*****
Re: Postfix uses wrong IP address
« Reply #1 on: August 28, 2023, 07:08:32 PM »
By Default Postfix uses the base IP (which needs to resolved to a FQDN to the IP), unless you config Postfix to do otherwise.
So it's odd that it is using your add-on IP.

Check your Postfix configuration file, it can be found & edited at: /etc/postfix/main.cf

e.g. if using nano: nano /etc/postfix/main.cf

UNDER # Rules Restrictions, under the line smtpd_helo_required = yes
ADD:
smtp_helo_name = $myhostname

Then restart postfix using: systemctl restart postfix

Offline
*
Re: Postfix uses wrong IP address
« Reply #2 on: September 11, 2023, 04:02:41 PM »
I have added that to my postfix configuration but it still sends messages with the addon IP address.
Here are some of the output from the Undelivered Mail Returned to Sender emails
Code: [Select]
    gmail-smtp-in.l.google.com[108.177.15.27] said: 550-5.7.1 [xx.xx.xx.xx
    18] Our system has detected that this message is 550-5.7.1 likely
    suspicious due to the very low reputation of the sending IP 550-5.7.1
    address. To best protect our users from spam, the message has been
    550-5.7.1 blocked. Please visit 550 5.7.1
    https://support.google.com/mail/answer/188131 for more information.
    z5-20020a05600c0a0500b003fbef8ad8f5si3205315wmp.40 - gsmtp (in reply to end
    of DATA command)