I am trying to issue simple POP3 commands to Gmail like so:
openssl s_client -connect pop.gmail.com:995
+OK Gpop ready for requests from XX.XX.XX.XX
USER [email protected]
+OK send PASS
PASS mypassword
+OK Welcome.
Connection and authentication all works fine. However when I issue a STAT or LIST command I receive the following:
STAT
+OK 345 20351669
This states I have 345 messages in my Inbox. In actuality I have 180, only a few unread. This number couldn't be refering to ALL of my emails... I've had this account for 5 years and definitely have WAY more than 345. So, I started RETR'ing some messages. The newest one (#345) is from Jan 2007 and the oldest one (#1) is from late 2006. Over the course of writing this I've received a few new emails, but even after reconnecting and issuing new LIST commands the 345 number does not change.
I'm no e-mail/pop expert but I'm really stumped here... POP3 is enabled for "all messages" in gmail settings. I even tried doing this same thing with another Gmail account and I get the exact same results; a really low message count and really old messages.
Any ideas?
try
USER recent:my-email
instead of
USER my-email
Seems like the "recent:" prefix on the username re-fetches the most recent messages:
How to re-download recent Gmail messages
GMail itself will only give 300-400 messages when requested. In order to get the others, you need to supply the optional message number argument as specified in RFC1939 "Post Office Protocol - Version 3", section 5 "The TRANSACTION state", LIST command.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With