New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix SMTP STARTTLS for Twisted >= 21.2.0 #5386
Comments
|
Scrapy doesn't configure protocol versions explicitly when using Can you show the library versions printed by Scrapy? |
|
It depends on the version of scrapy and which library version it uses for OpenSSL? |
|
I suggest trying newer pyOpenSSL/cryptography/Twisted versions first. |
|
I upgraded the versions to the newest: Now I get a new error: So it definitely looks like the issue is my mail server now. I will close this feature request. |
|
Hi @wRAR I might still need your help. The smtp server supports TLS1.2. I also tested this by creating a script with I can't seem to get it to work with I still get the error: Do you have an idea what I could try next? |
|
Are you using MAIL_TLS and port 587? |
|
Both yes |
|
I'll try to check this later |
|
Hi @wRAR, sorry to bother you. |
|
Actually "Server does not support secure communication via TLS / SSL" is a client error from Twisted and it's misleading because in fact it's the client that doesn't support STARTTLS. Since Twisted 21.2.0 (twisted/twisted@abef121), The fix to this seems to be just passing |
Summary
The Mail settings don't have an option to choose a TLS version. Only to enforce upgrading connections to use SSL/TLS.
Mail servers like smtp.office365.com dropped support for TLS1.0 and TLS1.1 and now require TLS1.2: https://techcommunity.microsoft.com/t5/exchange-team-blog/new-opt-in-endpoint-available-for-smtp-auth-clients-still/ba-p/2659652
It seems that scrapy mail doesn't support TLS1.2. The error message (with
MAIL_TLS = True):[scrapy.mail] Unable to send mail: To=['user@gmail.com'] Cc=[] Subject="Test" Attachs=0- 421 b'4.7.66 TLS 1.0 and 1.1 are not supported. Please upgrade/update your client to support TLS 1.2. Visit https://aka.ms/smtp_auth_tls. [AM6P194CA0047.EURP194.PROD.OUTLOOK.COM]'Motivation
Without TLS1.2 it's not possible anymore to send mails via smtp.office365.com. An option to use TLS1.2 would fix this issue
The text was updated successfully, but these errors were encountered: