-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Synapse can't connect to an IPv6-only mail server via hostname #7720
Comments
The answer is probably "Twisted", but we would likely want a workaround in Synapse until people are able to update to a newer Twisted. A (not awesome) workaround might be to put the IPv6 literal into the Synapse config instead of the hostname. |
Just ran into this myself; confirmed the problem by adding an A record for my outbound mail server, and then Synapse was able to send my users email. |
Is the workaround with the IPv6 literal still working?
with the literal configured as |
The brackets in a ipv6 literal is mainly for HTTP URLs, what happens if you don't include brackets? |
Has this one been filed on the Twisted side? |
Raised as https://twistedmatrix.com/trac/ticket/10258. Sorry it's a bit terse. |
@evilham did you by any chance have a solution for this one in your stack? |
Any news? This bug has been open 2.5y now... Tried IPv6 address directly, but then I get: |
While there, do it in such a fashion that we both document and prepare the groundwork for similar issues relating to direct usage of reactor.connectTCP, which lead to IPv6 incompatibilities. Closes matrix-org#7720 Signed-off-by: Nico Schottelius <[email protected]>
While there, do it in such a fashion that we both document and prepare the groundwork for similar issues relating to direct usage of reactor.connectTCP, which lead to IPv6 incompatibilities. Closes matrix-org#7720 Signed-off-by: Nico Schottelius <[email protected]>
While there, do it in such a fashion that we both document and prepare the groundwork for similar issues relating to direct usage of reactor.connectTCP, which lead to IPv6 incompatibilities. Closes matrix-org#7720 Signed-off-by: Nico Schottelius <[email protected]>
While there, do it in such a fashion that we both document and prepare the groundwork for similar issues relating to direct usage of reactor.connectTCP, which lead to IPv6 incompatibilities. Closes matrix-org#7720 Signed-off-by: Nico Schottelius <[email protected]>
While there, do it in such a fashion that we both document and prepare the groundwork for similar issues relating to direct usage of reactor.connectTCP, which lead to IPv6 incompatibilities. Closes matrix-org#7720 Signed-off-by: Nico Schottelius <[email protected]>
While there, do it in such a fashion that we both document and prepare the groundwork for similar issues relating to direct usage of reactor.connectTCP, which lead to IPv6 incompatibilities. Closes matrix-org#7720 Signed-off-by: Nico Schottelius <[email protected]>
While there, do it in such a fashion that we both document and prepare the groundwork for similar issues relating to direct usage of reactor.connectTCP, which lead to IPv6 incompatibilities. Closes matrix-org#7720 Signed-off-by: Nico Schottelius <[email protected]>
While there, do it in such a fashion that we both document and prepare the groundwork for similar issues relating to direct usage of reactor.connectTCP, which lead to IPv6 incompatibilities. Closes matrix-org#7720 Signed-off-by: Nico Schottelius <[email protected]>
While there, do it in such a fashion that we both document and prepare the groundwork for similar issues relating to direct usage of reactor.connectTCP, which lead to IPv6 incompatibilities. Closes matrix-org#7720 Signed-off-by: Nico Schottelius <[email protected]>
While there, do it in such a fashion that we both document and prepare the groundwork for similar issues relating to direct usage of reactor.connectTCP, which lead to IPv6 incompatibilities. Closes matrix-org#7720 Signed-off-by: Nico Schottelius <[email protected]>
While there, do it in such a fashion that we both document and prepare the groundwork for similar issues relating to direct usage of reactor.connectTCP, which lead to IPv6 incompatibilities. Closes matrix-org#7720 Signed-off-by: Nico Schottelius <[email protected]>
While there, do it in such a fashion that we both document and prepare the groundwork for similar issues relating to direct usage of reactor.connectTCP, which lead to IPv6 incompatibilities. Closes matrix-org#7720 Signed-off-by: Nico Schottelius <[email protected]>
While there, do it in such a fashion that we both document and prepare the groundwork for similar issues relating to direct usage of reactor.connectTCP, which lead to IPv6 incompatibilities. Closes matrix-org#7720 Signed-off-by: Nico Schottelius <[email protected]>
Description
Synapse only does IPv4 address resolution for the
email.smtp_host
when sending email.This might be (arguably) an issue on Twisted side though.
Internally, our SMTP server is accessible only with IPv6 (because dual-stack services is not a thing in Kubernetes right now) ; while we could probably work around, I think it's still a bug worth fixing, because IPv6-only environments/clouds are getting more and more traction.
Steps to reproduce
AAAA
) entryemail.smtp_host
on SynapseHere is the error we got from Sentry:
Additional informations
I figured that Synapse was only doing
A
resolution by capturing on the container net interface. I wondered why this was the case for SMTP but not in other parts like the federation HTTP client.It seems that it is because Synapse uses
twisted.mail.smtp.sendmail
to send emails without doing explicit DNS resolution first, andsendmail
directly does areactor.connectTcp
which chooses the address type (IPv4 or IPv6) based on the host. Because the host supplied tosendmail
is a hostname and not an IP, Twisted considers it is an IPv4, not an IPv6.I'm not sure if that should be fixed on Synapse or Twisted side.
Version information
cc @ludovicm67, my colleague who found this issue
The text was updated successfully, but these errors were encountered: