Skip to content
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

Email 1.3.0 ssl smtp bug #370

Open
iifiigii opened this issue Jan 30, 2024 · 3 comments
Open

Email 1.3.0 ssl smtp bug #370

iifiigii opened this issue Jan 30, 2024 · 3 comments
Labels

Comments

@iifiigii
Copy link

iifiigii commented Jan 30, 2024

I used offical Email tool to send email by smtp and get error.

Tool responce and my parameter here:

"Results for email_1":{3 items
"success":false
"reason":"An exception occurred while running this function (2). See exception for more details and contact support if this persists ([email protected])"
"exception":"SMTPServerDisconnected - Connection unexpectedly closed"
}

Variables (click to expand)
username: [email protected]
smtp_host: smtp.exmail.qq.com
smtp_port: 465

recipient: [email protected]

subject: SHuffle Test Email
body: 123

ssl_verify: true

body_type: plain

@iifiigii
Copy link
Author

To use ssl, I change the "s = smtplib.SMTP(host=smtp_host, port=smtp_port)" to "s = smtplib.SMTP_SSL(host=smtp_host, port=smtp_port)" and hot load the python-app. That's working.

@frikky
Copy link
Member

frikky commented Jan 30, 2024

To use ssl, I change the "s = smtplib.SMTP(host=smtp_host, port=smtp_port)" to "s = smtplib.SMTP_SSL(host=smtp_host, port=smtp_port)" and hot load the python-app. That's working.

So this fix worked for you? Maybe we should try to autodiscover it and failover to SSL if need be? 🤔

@iifiigii
Copy link
Author

Yes, that worked for me.
The deep reason maybe is some smtp server expect that client uses an encrypted method to create a connection.(https://stackoverflow.com/questions/59179964/python3-smtp-connection-unexpectedly-closed)

And in Shuffle's scenario, "smtplib.SMTP" cause TIMEOUT(default 300s). This makes autodiscover may not be very easy.

For compatibility, I think you can add a switch parameters and a branch to make smtp connection with " smtplib.SMTP_SSL". But that may compromise the transparency of the tool and make tool hard to understand.

Another way I think is give "smtplib.SMTP(timeout=)" a small timeout parameter, then autodiscover the timeout exception and failover to "smtplib.SMTP_SSL"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Development

No branches or pull requests

2 participants