Open Cameo007 opened 6 months ago
What does your e-mail sending config look like? Feel free to redact the values that are sensitive but at least show what's there.
A quick poke shows we do send a Date header and we don't put From, To or Subject more than once.
This is my email config.
I wonder if this is because, unless I'm mistaken, Synapse sends e-mails with a LF line ending whereas the standard says it should use CRLF.
Are you happy to try applying and running a patch?
In synapse/handlers/send_email.py
, at the very bottom,
await self._sendmail(
self._reactor,
self._smtp_host,
self._smtp_port,
raw_from,
raw_to,
multipart_msg.as_string().encode("utf8"),
username=self._smtp_user,
password=self._smtp_pass,
require_auth=self._smtp_user is not None,
require_tls=self._require_transport_security,
enable_tls=self._enable_tls,
force_tls=self._force_tls,
)
could be replaced with
await self._sendmail(
self._reactor,
self._smtp_host,
self._smtp_port,
raw_from,
raw_to,
multipart_msg.as_string().encode("utf8").replace(b"\r", b"").replace(b"\n", b"\r\n"),
username=self._smtp_user,
password=self._smtp_pass,
require_auth=self._smtp_user is not None,
require_tls=self._require_transport_security,
enable_tls=self._enable_tls,
force_tls=self._force_tls,
)
Though to be honest, I don't know if I'm correct or not; likely I'd need to spend more time with this.
I'm right now building a custom docker image with this change. We will see if it works or not.
No, it doesn't help.
Thanks for trying that, sorry it didn't help.
I'm not really sure what to suggest here; I don't have any direct suggestions with that error.
You could try to intercept the connection (tcpdump or Wireshark) and exactly what it's sending, byte-for-byte? I guess you will need something like MITM proxy since the SMTP traffic is encrypted.
There is probably going to be a fair amount of staring at it and maybe comparing it against another application that does manage to send e-mail through this SMTP host.
Description
I am using a mail account at IONOS for my Matrix instance. It worked in the past but for some time I see an error message in Synapse that the email cannot be sent.
When I open a ticket I receive the information from IONOS that the email was rejected by our SMTP server because it does not comply with the defined standards from RFC5321 and RFC5322.
Steps to reproduce
Use IONOS to send emails
Homeserver
mintux.de
Synapse Version
1.102.0 (also before)
Installation Method
Docker (matrixdotorg/synapse)
Database
single PostgreSQL (not restored or ported)
Workers
I don't know
Platform
NixOS 23.11 via Docker on a DELL Laptop
Configuration
No response
Relevant log output
Anything else that would be useful to know?
No response