Poplib issue with LIST/STAT (-ERR Command not understood)

Open
#94,019 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
python
Domain
networking

Research direction

Start with poplib.POP3_SSL and the reproducible LIST call, comparing its debug-level command exchange with the successful TELNET session. Reproduce the behavior on the reported Python versions and environments; done means identifying why LIST/STAT differ and confirming that the reported mailbox commands work as expected.

Written by the indexing model from the issue text.

Description

stdlib topic-email type-bug

Bug report

The GMAIL POP3 server does not understand the LIST/STAT command when being sent via poplib. Sending those commands on the same exact mailbox via TELNET works. Initially, I thought this is a GMAIL issue, but after doing the manual TELNET login and message retrieval, it seems something else is going on.

I tried for several days to find a solution via StackOverflow, Google and Discord, but no one could give me an answer.

Reproducible code:

import poplib
mail_box = poplib.POP3_SSL(SERVER, PORT)
mail_box.set_debuglevel(2)
mail_box.user(USER)
mail_box.pass_(PASSWORD)
mail_box.list()[1]

SUCCESS - Manual TELNET test for the mailbox:

image

FAILED - Poplib outcome with reproducible code:

image

Your environment

  • CPython versions tested on: Python 3.8.10, Python 3.9.7
  • Operating system and architecture: Win11, Win10, Ubuntu 20.04.3 LTS
Dominant language
Python
Stars
77.2k
Forks
36k
Avg merge
1d 9h
Merged PRs (30d)
558

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from python/cpython

All issues in python/cpython

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.