python / cpython

The Python programming language
https://www.python.org
Other
62.17k stars 29.88k forks source link

smtplib.SMTP.sendmail: mta status codes only accessible by local variables #80329

Closed 70c5da61-99e4-4e03-8993-245df88cdc07 closed 5 years ago

70c5da61-99e4-4e03-8993-245df88cdc07 commented 5 years ago
BPO 36148
Nosy @warsaw, @bitdancer, @sls89
PRs
  • python/cpython#12104
  • Superseder
  • bpo-29539: [smtplib] collect response data for all recipients
  • 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: ```python assignee = None closed_at = created_at = labels = ['3.8', 'type-feature', 'library', 'expert-email'] title = 'smtplib.SMTP.sendmail: mta status codes only accessible by local variables' updated_at = user = 'https://github.com/sls89' ``` bugs.python.org fields: ```python activity = actor = 'r.david.murray' assignee = 'none' closed = True closed_date = closer = 'r.david.murray' components = ['Library (Lib)', 'email'] creation = creator = 'sls' dependencies = [] files = [] hgrepos = [] issue_num = 36148 keywords = ['patch'] message_count = 3.0 messages = ['336864', '336871', '336872'] nosy_count = 3.0 nosy_names = ['barry', 'r.david.murray', 'sls'] pr_nums = ['12104'] priority = 'normal' resolution = 'duplicate' stage = 'resolved' status = 'closed' superseder = '29539' type = 'enhancement' url = 'https://bugs.python.org/issue36148' versions = ['Python 3.8'] ```

    70c5da61-99e4-4e03-8993-245df88cdc07 commented 5 years ago

    MTA status codes (visible via setdebuglevel(1)) are not accessible as the sendmail-method stores them only locally (code, resp).

    I suggest to store the mta status codes, for instance: "250, b'2.0.0 Ok: queued as XYZ" etc. in an instance attribute (tuple) to access them on smtp-sessions.

    As an email developer those information are very important to me.

    bitdancer commented 5 years ago

    Thanks for the PR, but this is a duplicate of bpo-29539, which I think has a better API proposal. Since the original author never actually submitted a PR there, perhaps you could pick up his work (after pinging the issue).

    bitdancer commented 5 years ago

    Sorry, that should be bpo-29539.