Haraka config for controlling outbound SMTP interface
-
Since https://forum.cloudron.io/topic/10871/smtp-using-wrong-ip-address-on-interface-with-multiple-addresses/ was never solved, and we currently resort to disabling IPv6 on the server or worse, moving entire Cloudrons to non IPv6 hosts just to fix email deliverability issues with Microsh0ft and Gmail domains, I went looking how to keep IPv6 enabled and have outbound SMTP work over IPv4.
Starting with asking a lot of questions around how to specify the outbound SMTP interface, which led nowhere.
Then I thought to ask why is a IPv6 SMTP server at Google/MS responding and rejecting mail. It must be getting contacted first somehow. Cloudron doing something we don't want or expect.
Then looking at Haraka and how it handles outbound SMTP, I found this:
- `ipv6_enabled` When this has a "true" value inside (usually a `1`), it defaults to an 'AAAA' lookup first for each MX record, and uses those hosts to send email via.
This explains why it's intermittent delivery issues, since the MX lookup varies at different email providers and only fails at IPv6 nodes.
All this happens in the
outbound.ini
file.@girish can we have a default to disable this or a toggle in the Mail UI?
This would solve all the current problems since it defaults to attempt sending to IPv6 servers FIRST which is where all the delivery problems stem from.
And we can keep IPv6 enabled on the server even with no RDNS configured.
-
G girish moved this topic from Support
-
G girish marked this topic as a regular topic
-
I wonder if this would be helpful for this other issue too which I reported back in March but no real progress beyond my workaround yet: https://forum.cloudron.io/topic/13458/use-floating-ip-address-only-for-outbound-cloudron-docker-container-communication?_=1750223095929
Ideally, I want to pick the specific interface / IP address being used for outbound communication.
It was mostly because I wanted to prevent the IPv6 address from being used, and apparently disabling IPv6 in Cloudron doesn't achieve that result as I guess it's just for inbound traffic / DNS records, not for outbound traffic.It was the result of needing to avoid blocking in Gmail for traffic when the outbound SMTP IP used isn't the same one in the DNS record / or the one that's set in the Cloudron IPv4 address settings. -
I wonder if this would be helpful for this other issue too which I reported back in March but no real progress beyond my workaround yet: https://forum.cloudron.io/topic/13458/use-floating-ip-address-only-for-outbound-cloudron-docker-container-communication?_=1750223095929
Ideally, I want to pick the specific interface / IP address being used for outbound communication.
It was mostly because I wanted to prevent the IPv6 address from being used, and apparently disabling IPv6 in Cloudron doesn't achieve that result as I guess it's just for inbound traffic / DNS records, not for outbound traffic.It was the result of needing to avoid blocking in Gmail for traffic when the outbound SMTP IP used isn't the same one in the DNS record / or the one that's set in the Cloudron IPv4 address settings.@d19dotca AFAIK this is the same issue, except it's not solved by choosing the interface, but by changing the unexpected default behavior for using IPv6 in the Haraka config.
You should be able to test it by making the single config change in the mail container and restarting Haraka.