-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
SMTP cannot send mails #13686
Comments
Are Is Synapse containerized? I'm assuming not since What do Is Are there any firewalls that might block traffic? If possible, it may be helpful to take a packet capture to find out what synapse is trying to connect to. |
They are not present. I tried it also with them being 25 and false.
No only a venv directly on the host.
It's the same for
filtered with grep 25
ufw is running on mail.lan, but not blocking. (ssmtp is working from synapse.lan to mail.lan)
Ok. I just collected all information from above, installed tcpdump, and started the capture. But then it worked! |
It's good to hear that things are working for you now. If it happens again and it can be tracked down to an issue in Synapse, please feel free to file a new issue. |
@squahtx I hope you don't mind if I investigate here a little more. It would be nice to get your opinion before creating a new issue, if necessary. AnalysisAs stated in the manual:
So my mailserver rejects the TLS requests, which looks like this #6211 issue, which then leads to the ip from synapse being banned by fail2ban. After allowing TLS1.0 again sending is possible: WorkaroundAfter reading through #6211, which is closed, I still don't know what to do about the TLS1.0 problem? In my case of no authentication, plain connection and fail2ban on the mail server, I needed to add
to my config to prevent TLS connection attempts all together, which is not ideal but it works. Config giving the error stated above
Error because of TLS1.0mail.log on mail.lan
repeats 6 times |
sorry, can you get a raw dump with |
Here it is: dump.zip |
thanks. Yes, that's certainly a TLS 1.0 handshake. I can only imagine this must be something to do with the library versions installed on your Synapse server. Are you using a virtualenv? Do you have up-to-date versions of |
Yes. I installed it around December 2020. And upgrade synapse via:
I though that all dependencies will update according to what synapse requires? |
This is the problem. #6211 was a bug in Twisted, fixed in Twisted 21.2.0. Upgrade Twisted and I think the problem will go away.
What synapse requires, yes, but Synapse doesn't require anything in Twisted 21.2. #13315 is related here. |
Ok, I will do this.
Well, I read the ticket and was not aware of that problem with pip. Especially because during
So there is the pyproject.toml, and with the change in 1.66 to remove delegates, having the email settings work in the homeserver.yaml is even more important. Which, as seen in here, requires Twisted at some higher version. I do get that maintaining the latest versions in that file can be troublesome. But for me the installation method with pip is the easiest one, because I don't use docker on small single board computers like raspberry pi. Let me quote you from #11581 and refer to the "useful to us" part. Which would be given here? (I hope I'm not way out of context with the quote):
|
Our policy is not to force a dependency on particular versions of underlying libraries just to resolve some esoteric problem that will hit a tiny minority of users. The reason for this is to make it possible for Linux distributions to package Synapse. This is not the place to debate that policy; I have already pointed you to the issue where we are discussing potential alternatives. If you have good ideas, feel free to weigh in there. I'll close this issue since we have identified that it was caused by your use of an old version of Twisted. |
Duplicate of #6211 |
Of course, I agree. It was never my intention to start a discussion here. Just to follow up and conclude what I did to make it work in the end:
Now I can send mails using these synapse email settings:
Many thanks @richvdh for your time and great help. |
Description
Synapse is on a host where I can use ssmtp to a machine "mail.lan" on port 25 without authentication to send mails successfully. If I use the same configuration with Synapse:
In element I get
An error was encountered when sending the email (Status 500)
instantaneously and in the logs I get the error below. It really is suspiciously fast, as if it is not doing a real connection attempt.On mail.lan I don't see any connection attempts. It also doesn't matter if I use the FQDN or the IP address as smtp_host, or if I give the smtp_port and even if I try an external server with username and password. I tried various other things without changing the error message at all.
Has anybody a good hint for me?
Steps to reproduce
Homeserver
my own
Synapse Version
"python_version": "3.7.3", "server_version": "1.66.0"
Installation Method
pip (from PyPI)
Platform
Linux 5.10.103-v7l+ #1529 SMP Tue Mar 8 12:24:00 GMT 2022 armv7l GNU/Linux
Description: Raspbian GNU/Linux 10 (buster)
Release: 10
Codename: buster
Relevant log output
The text was updated successfully, but these errors were encountered: