question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Fix SMTP STARTTLS for Twisted >= 21.2.0

See original GitHub issue

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

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
wRARcommented, Feb 5, 2022

I’ll try to check this later

0reactions
wRARcommented, Apr 10, 2022

You can read my previous comment to get the answer.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Sending Mail — Twisted 21.2.0 documentation
The SMTP/ESMTP server you are sending the message to. The email address you are sending from. A list of email addresses you are...
Read more >
Re: [Twisted-Python] startTLS errors not propagating to Factory
At this point I'm struggling. Is the SMTP code holding the Factory wrong? Or > is it reasonable to expect the verification error...
Read more >
Twisted Mail Tutorial: Building an SMTP Client from Scratch
This tutorial will walk you through the creation of an extremely simple SMTP client application. By the time the tutorial is complete, you...
Read more >
Twisted Python ESMTP mail server / dump with TLS
I believe I need to modify the "TLSServer" class in my server code below to be inherited from twisted.mail.smtp.ESMTP instead of twisted.protocols.basic.
Read more >
Sending emails asynchronously using Twisted - Part 1
For this tutorial we are going to use Twisted framework. ... Header from twisted.mail.smtp import ESMTPSenderFactory from twisted.internet ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found