Force outgoing SMTP to use IPv4

fharvell

New Member
Feb 15, 2024
2
0
1
How can I configure PMG to use IPv4 for the outgoing SMTP connections?

I'm trying to use PMG as an outgoing SMTP relay and it is working except it prefers to connect using IPv6 instead of IPv4. Because of this, google, etc. is bouncing the email due to mismatched PTR (which I cannot get delegated):

----
Jan 16 00:06:54 rml postfix/smtp[967]: 98DB340383: to=<xxx@gmail.com>, relay=gmail-smtp-in.l.google.com[2607:f8b0:4002:c0c::1b]:25, delay=1.6, delays=0.07/0.01/0.52/1, dsn=5.7.1, status=bounced (host gmail-smtp-in.l.google.com[2607:f8b0:4002:c0c::1b] said: 550-5.7.1 [2600:1fff:f371:821e:be24:11ff:fe64:e890] Gmail has detected that this 550-5.7.1 message does not meet IPv6 sending guidelines regarding PTR records 550-5.7.1 and authentication. For more information, go to 550 5.7.1 https://support.google.com/mail/?p=IPv6AuthError 00721157ae682-6f546d10a77si116296777b3.256 - gsmtp (in reply to end of DATA command))
-----

P.S.: I have tried configuring the /etc/gai.conf file to use "precedence ::ffff:0:0/96 100". With that change, most unix tools are using the IPv4 addresses, but PMG continues to prefer IPv6 over IPv4. :(
 
Set firewall to block outgoing ipv6 on port 25.
or
https://www.postfix.org/IPV6_README.html
etc.
Unfortunately, blocking IPv6 port 25 causes the connection to time out and the message remains in the outgoing queue.

The link you provided, however, does appear to have the needed information. It appears that I need to add the following stanza to /etc/postfix/main.cf to enable IPv4 only:

inet_protocols = ipv4

It appears that this needs to be changed in /etc/pmg/templates/main.cf.in as described in https://pmg.proxmox.com/pmg-docs/pmg-admin-guide.html#pmgconfig_template_engine.

Note, I found this information from this post in thread 'custom parameters on postfix to avoid PMG overwrite'
https://forum.proxmox.com/threads/c...fix-to-avoid-pmg-overwrite.159106/post-729903
 
Last edited:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!