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.
FAILED - Poplib outcome with 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:
output for the successful manual test
Reference to the github issue in cpython: