Sitelet https://github.com/Shuffle/python-apps/issues/370
Skip to content

Email 1.3.0 ssl smtp bug #370

Description

@iifiigii

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 (support@shuffler.io)"
"exception":"SMTPServerDisconnected - Connection unexpectedly closed"
}

Variables (click to expand)
username: secux@xxx.com
smtp_host: smtp.exmail.qq.com
smtp_port: 465

recipient: xxxx@xxxx.com

subject: SHuffle Test Email
body: 123

ssl_verify: true

body_type: plain

Activity

  1. iifiigii commented on Jan 30, 2024

    @iifiigii
    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.

  2. frikky commented on Jan 30, 2024

    @frikky
    Member

    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? 🤔

  3. iifiigii commented on Jan 30, 2024

    @iifiigii
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions