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

Fixes smtplib starttls HELO errors #39456

Closed
jdcrunchman mannequin opened this issue Oct 25, 2003 · 6 comments
Closed

Fixes smtplib starttls HELO errors #39456

jdcrunchman mannequin opened this issue Oct 25, 2003 · 6 comments
Assignees
Labels
stdlib Python modules in the Lib dir

Comments

@jdcrunchman
Copy link
Mannequin

jdcrunchman mannequin commented Oct 25, 2003

BPO 829951
Nosy @loewis, @gpshead
Files
  • smtplib: smtplib.py.patch
  • smtplib-startls-discard-knowledge.diff
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/gpshead'
    closed_at = <Date 2008-01-17.07:44:21.294>
    created_at = <Date 2003-10-25.02:49:54.000>
    labels = ['library']
    title = 'Fixes smtplib starttls HELO errors'
    updated_at = <Date 2008-01-17.07:55:19.512>
    user = 'https://bugs.python.org/jdcrunchman'

    bugs.python.org fields:

    activity = <Date 2008-01-17.07:55:19.512>
    actor = 'gregory.p.smith'
    assignee = 'gregory.p.smith'
    closed = True
    closed_date = <Date 2008-01-17.07:44:21.294>
    closer = 'gregory.p.smith'
    components = ['Library (Lib)']
    creation = <Date 2003-10-25.02:49:54.000>
    creator = 'jdcrunchman'
    dependencies = []
    files = ['5656', '8666']
    hgrepos = []
    issue_num = 829951
    keywords = ['patch']
    message_count = 6.0
    messages = ['44827', '44828', '56828', '56967', '60020', '60021']
    nosy_count = 4.0
    nosy_names = ['loewis', 'gregory.p.smith', 'jdcrunchman', 'fenner']
    pr_nums = []
    priority = 'normal'
    resolution = 'accepted'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue829951'
    versions = ['Python 2.6', 'Python 2.5', 'Python 2.4', 'Python 2.3']

    @jdcrunchman
    Copy link
    Mannequin Author

    jdcrunchman mannequin commented Oct 25, 2003

    smtplib.starttls() needs to include does_esmtp=0. Without
    this, the "size=" suffix on MAIL FROM lines causes server
    errors since the MTA defaults to HELO mode. This is also
    necessary in order to conform to RFC 2487 section 5.2,
    which states after TLS is started, all prior knowledge
    (including esmtp capability) must be discarded.

    This bug exists in Python 2.3.2 and earlier.

    @jdcrunchman jdcrunchman mannequin added stdlib Python modules in the Lib dir labels Oct 25, 2003
    @loewis
    Copy link
    Mannequin

    loewis mannequin commented Oct 31, 2003

    Logged In: YES
    user_id=21627

    Shouldn't you also reset other state, such as esmtp_features?

    @fenner
    Copy link
    Mannequin

    fenner mannequin commented Oct 26, 2007

    Yes, the state that should be reset includes helo_resp, ehlo_resp,
    esmtp_features, and does_esmtp.

    The workaround commonly proposed is to always call ehlo() after starttls()
    . While this works (most of the time?), it seems arbitrary to require an
    explicit ehlo() call in this case but not other cases.

    @fenner
    Copy link
    Mannequin

    fenner mannequin commented Oct 30, 2007

    I've attached an updated diff, against the 2.4.3 smtplib.py, which forgets
    all of the relevant pieces of information. The line numbers are offset
    from the standard lib because the original file has my patch for issue
    1339 applied, but there is no overlap so this patch should apply cleanly.

    @gpshead
    Copy link
    Member

    gpshead commented Jan 17, 2008

    Fixed in trunk (2.6) r60015.

    @gpshead
    Copy link
    Member

    gpshead commented Jan 17, 2008

    and in r60017 on release25-maint for inclusion in 2.5.2.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    stdlib Python modules in the Lib dir
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant