Open nike4613 opened 1 year ago
Thanks for reporting. Can you share how you have configured synapse for sending email?
With comments removed:
email:
smtp_host: localhost
smtp_port: 587
require_transport_security: false
enable_tls: true
Note: I have tried with require_transport_security
set to both true
and false
with no difference. Disabling enable_tls
causes failures because Postfix is configured to require TLS.
File "/opt/venvs/matrix-synapse/lib/python3.9/site-packages/service_identity/_common.py", line 398, in _hostname_matches actual_head, actual_tail = actual_hostname.split(b".", 1)
That error happens when a hostname has no .
in it.
Could you post the public part of the mail server's certificate too? In particular, what's the subject field of the certificate?
That error happens when a hostname has no
.
in it.
Can you try changing the Synapse config to smtp_host: localhost.
, with a trailing .
?
Could you post the public part of the mail server's certificate too? In particular, what's the subject field of the certificate?
CN = *.cirr.com
Can you try changing the Synapse config to
smtp_host: localhost.
, with a trailing.
?
This results in a different error in the log:
2023-01-31 13:42:30,925 - twisted - 274 - INFO - sentinel - SMTP Client retrying server. Retry: 5
2023-01-31 13:42:30,977 - twisted - 274 - INFO - sentinel - SMTP Client retrying server. Retry: 4
2023-01-31 13:42:31,030 - twisted - 274 - INFO - sentinel - SMTP Client retrying server. Retry: 3
2023-01-31 13:42:31,080 - twisted - 274 - INFO - sentinel - SMTP Client retrying server. Retry: 2
2023-01-31 13:42:31,136 - twisted - 274 - INFO - sentinel - SMTP Client retrying server. Retry: 1
2023-01-31 13:42:31,185 - synapse.handlers.identity - 395 - ERROR - POST-425 - Error sending threepid validation email to <redacted>
Traceback (most recent call last):
File "/opt/venvs/matrix-synapse/lib/python3.9/site-packages/synapse/handlers/identity.py", line 393, in send_threepid_validation
await send_email_func(email_address, token, client_secret, session_id)
File "/opt/venvs/matrix-synapse/lib/python3.9/site-packages/synapse/push/mailer.py", line 210, in send_add_threepid_mail
await self.send_email(
File "/opt/venvs/matrix-synapse/lib/python3.9/site-packages/synapse/push/mailer.py", line 327, in send_email
await self.send_email_handler.send_email(
File "/opt/venvs/matrix-synapse/lib/python3.9/site-packages/synapse/handlers/send_email.py", line 208, in send_email
await self._sendmail(
File "/opt/venvs/matrix-synapse/lib/python3.9/site-packages/synapse/handlers/send_email.py", line 130, in _sendmail
await make_deferred_yieldable(d)
twisted.internet.error.ConnectionAborted: Connection was aborted locally using ITCPTransport.abortConnection.
Can you try changing the Synapse config to
smtp_host: localhost.
, with a trailing.
?
It looks like changing the smtp_host
to use the full domain name of the server works though. This strikes me as a somewhat unhelpful requirement, given that the two servers are running on the same physical machine.
Can you try changing the Synapse config to
smtp_host: localhost.
, with a trailing.
?It looks like changing the
smtp_host
to use the full domain name of the server works though. This strikes me as a somewhat unhelpful requirement, given that the two servers are running on the same physical machine.
Notably, it seems like doing this only works when sending mail to local recipients. It seems like because its connecting via full domain, Postfix isn't recognizing it as local and as such is refusing to act as a relay like it should be.
Description
When I make Synapse try to send an email (e.g. by adding one to my account in the Element UI), it reports an internal error, with the attached error in the logs (duplicated 5 times, with the
Retry:
line counting down from 5.Steps to reproduce
Homeserver
cirr.com
Synapse Version
1.75.0
Installation Method
Debian packages from packages.matrix.org
Database
PostgreSQL. Single server, no porting, no backups.
Workers
Single process
Platform
Debian 5.10.127-1 VPS
Configuration
No response
Relevant log output
Anything else that would be useful to know?
The target mail server is a Postfix server configured to only accept TLS. I do not have issues sending mail through this server from any other application; I am able to send mail using Thunderbird, and my Nextcloud instance is able to send mail through it.