Skip to content

Add support for AUTH command to poplib #64551

Open

Description

@dveeden
mannequin
BPO 20352
Nosy @warsaw, @bitdancer
Files
  • poplib_auth.patch: Initial patch
  • 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 = None
    closed_at = None
    created_at = <Date 2014-01-22.18:17:39.924>
    labels = ['easy', 'type-feature', 'library', 'expert-email']
    title = 'Add support for AUTH command to poplib'
    updated_at = <Date 2014-01-23.13:55:51.385>
    user = 'https://bugs.python.org/dveeden'

    bugs.python.org fields:

    activity = <Date 2014-01-23.13:55:51.385>
    actor = 'r.david.murray'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Library (Lib)', 'email']
    creation = <Date 2014-01-22.18:17:39.924>
    creator = 'dveeden'
    dependencies = []
    files = ['33651']
    hgrepos = []
    issue_num = 20352
    keywords = ['patch', 'easy']
    message_count = 4.0
    messages = ['208837', '208841', '208904', '208923']
    nosy_count = 3.0
    nosy_names = ['barry', 'r.david.murray', 'dveeden']
    pr_nums = []
    priority = 'normal'
    resolution = None
    stage = 'needs patch'
    status = 'open'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue20352'
    versions = ['Python 3.5']

    Linked PRs

    Activity

    1. dveeden commented on Jan 22, 2014

      dveedenmannequin
      MannequinAuthor

      I use 'AUTH PLAIN <secret>' to login to a POP3 server with a proxy user. I can't use 'pass_()' as I need to supply a admin user and the user to proxy into.

      class adminpopserver(poplib.POP3):
          def auth(self, method, secret):
              return self._shortcmd('AUTH %s %s' % (method, secret))
      
      secret = "{user}\0{adminuser}\0{password}".format(
          user=user, 
          adminuser=adminuser, 
          password=password)
      secret = secret.encode('base64').strip('\n')
    2. added
      stdlibStandard Library Python modules in the Lib/ directory
      on Jan 22, 2014
    3. bitdancer commented on Jan 22, 2014

      @bitdancer
      Member

      This is basically rfc 5034 support? Sounds like a good idea.

      I'm going to mark this issue as 'easy' because it isn't a whole lot of code, but for anyone who wants to tackle it, know that understanding the RFC and getting it *right* is not necessarily trivial, because: rfc :)

    4. dveeden commented on Jan 23, 2014

      dveedenmannequin
      MannequinAuthor

      As far as I understood the RFC:

      A client should send CAPA and check if there is a SASL tag in the response (e.g. "SASL PLAIN").

      ===============================
      +OK Dovecot ready.
      AUTH PLAIN base64_encoded_info
      +OK Logged in.
      LIST
      ===============================
      I've replace the base64 encoded authentication info with 'base64_encoded_info'

      For other authentication mechanisms the response can be longer (it may contain a challenge) and the request may only contain the mechanim.

      I don't have a server which supports anything else than AUTH PLAIN, so I could verify/test this.

    5. bitdancer commented on Jan 23, 2014

      @bitdancer
      Member

      imaplib has an API for handling that kind of thing. Maybe we can model the poplib support off of that API. It would be nice to be consistent, assuming it in fact makes sense for poplib as well.

    6. transferred this issue fromon Apr 10, 2022
    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

      easystdlibStandard Library Python modules in the Lib/ directorytopic-emailtype-featureA feature request or enhancement

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions