Closed lmeunier closed 7 months ago
I don't think this is possible at the moment.
queue/direct.go calls smtpclient/dial.go to make connections (smtpclient.Dial). It has some logic for address selection (for using a specific local ip for outgoing connections, for switching between ipv4 and ipv6). But it currently will attempt to connect to ipv4 and ipv6 connections. It's probably best to either filter out ips from address family that shouldn't be used (ipv6 in this case) before calling smtpclient.Dial, or pass another flag to smtpclient.Dial so it can skip some address families. First option seems preferrable since smtpclient is a reusable component.
By default, mox tries to make outgoing connections from the same explicitly specified listening IP addresses, and only the first for each address family. That could be improved in the future.
Perhaps a good option for now is to just have mox.conf config file option to only make outgoing smtp connections over ipv4 or ipv6.
Some links:
I take a look at config/config.go
, maybe we could add a new transport option in the Transport
struct for direct transports, and a new struct (named TransportDirect
?) similar to the TransportSMTP
struct, but used to give hints to queue/direct.go#deliverDirect()
to, for example, filter out ipv4 or ipv6 addresses from from ips
.
The new "Direct" transport should be handled in queue/queue.go
.
After that, I'll just have to configure mox this way:
mox.conf
: add a TransportDirect
, configured to filter out ipv6 addresses, in the global Transports
mapdomains.conf
: add a global Route
with ToDomain
filled with domains whose SMTP servers reject my ipv6 address, this route is configured to use the previously created transportWhat do you think?
Sounds like a good plan, better than the new option I had in mind!
I think you may still want to disable ipv6 for all deliveries. While some mail servers will reject your messages over ipv6, others may not be giving that feedback but still mark them as spam, not giving you any feedback about it.
Thanks for the feedback. I'll try to push a PR in the next few days.
Some remote SMTP server are rejecting messages sent by mox because the IPv6 address used for outgoing connections does not match the reverse DNS lookup of the same IPv6 address.
My ISP won't let me change the reverse DNS record for my ipv6, so I'm stuck to use only ipv4 for outgoing SMTP connections.
Is it possible the configure mox to use only ipv4 for outgoing SMTP connections? (and still accept incoming connections on ipv4 and ipv6).