Closed Bug 1789314 Opened 3 years ago Closed 3 years ago

POP3 stopped working (getting new messages) if server does not support UIDL

Categories

(MailNews Core :: Networking: POP, defect)

Thunderbird 102
defect

Tracking

(thunderbird_esr102 fixed, thunderbird105 fixed)

VERIFIED FIXED
106 Branch
Tracking Status
thunderbird_esr102 --- fixed
thunderbird105 --- fixed

People

(Reporter: schierlm, Assigned: rnons)

References

(Regression)

Details

(Keywords: regression)

Attachments

(5 files)

Attached file Captured TCP stream

Steps to reproduce:

I am using a local POP proxy (written myself a decade ago) that collects information from forums and social media and provides it as a fake POP3 account. It only supports the bare minimum of the POP3 protocol (USER, PASS, STAT, LIST, RETR, DELE, QUIT) and worked fine with email clients so far. After updating from Firefox 9x to 102, it stopped working. Note that "Leave messages on the server" is NOT checked.

Actual results:

POP3 MOZ_LOGs appear empty, but Wireshark shows that the communication stops after the client calls UIDL command and receives an error code. The connection stays open and email is not retrieved.

Expected results:

The mail client should detect that the server does not support UIDL and instead just retrieve the emails and delete them.

Must be super rare...

You can for the moment still set mailnews.pop3.jsmodule false to get the old implementation.

Thank you, setting the option (as expected) worked around the issue.

It may be rare, but still I think that the implementation should not suddenly hang (and leave the socket open) without showing an error message if the server acts weirdly in any way. (And in this case, it is compliant behaviour as UIDL is an optional POP3 command).

OTOH, on Reddit there have been some threads about some POP3 proxys stop working with the Thunderbird 102. As nobody attached/posted a trace, it is not 100% certain it is the same issue, but it may be.

But you are obviously right, most people will concentrate on a very small amount of POP3 server implementations (Gmail, Office365, Hotmail, Yahoo, ...) and even more people will not use POP3 but IMAP, so the issue probably affects only a tiny subset of the users.

I will try to fix this. I have a question about the old behavior. If "Leave messages on the server" is checked, and you delete a message from the message list, will this message be deleted on server?

I ask because for servers with UIDL, delete a message from the message list doesn't send DELE immediately, but only change a UIDL flag. DELE is sent in the next connection. I'm not sure how it works for servers without UIDL.

I found the answer, an error message is shown if "Leave messages on the server" or some other features are turned on but the server doesn't support UIDL https://searchfox.org/comm-esr102/rev/d9800535d0b488462c8ae64f7fe6647cc42535e1/mailnews/local/src/nsPop3Protocol.cpp#2516

Assignee: nobody → remotenonsense
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Keywords: regression
Regressed by: pop3-js

Michael, is the server you wrote available somewhere to test this live? (Or installable?)

Attached file sample server

The server is not on the internet (it provides no authentication and allows every password), and I cannot really share it as is as it has hard-coded API credentials for social media APIs.

However, I have attached a stripped down version. The POP3 code is unchanged, just the message generation part was replaced by a simple loop that creates one message for every minute between last mail fetch and now.

It is written in Java, tested with Java 8, 11 LTS and 17 LTS. You can compile with Maven or use the included binary jar if you trust it.

Run via the included script and point your Thunderbird to POP3 server localhost:20110 (any username and password).

Target Milestone: --- → 106 Branch

Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/ee629f3bad31
Support server without UIDL capability in Pop3Client. r=mkmelin

Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED

Comment on attachment 9293428 [details]
Bug 1789314 - Support server without UIDL capability in Pop3Client. r=mkmelin

[Approval Request Comment]
Regression caused by (bug #): bug pop3-js
User impact if declined: POP3 server without UIDL capability doesn't work
Testing completed (on c-c, etc.): c-c
Risk to taking this patch (and alternatives if risky): low

Attachment #9293428 - Flags: approval-comm-beta?

Comment on attachment 9293428 [details]
Bug 1789314 - Support server without UIDL capability in Pop3Client. r=mkmelin

[Triage Comment]
Approved for beta

Attachment #9293428 - Flags: approval-comm-beta? → approval-comm-beta+
Summary: POP3 stopped working in Thunderbird 102 if server does not support UIDL → POP3 stopped working (getting new messages) if server does not support UIDL

Comment on attachment 9293428 [details]
Bug 1789314 - Support server without UIDL capability in Pop3Client. r=mkmelin

[Triage Comment]
Approved for esr102, because This may be less rare than we think.

If you disagree with taking this in 102.3.0 to ship next week, please reset the flag.

Flags: needinfo?(remotenonsense)
Attachment #9293428 - Flags: approval-comm-esr102+

Rebased to esr102, thanks.

Flags: needinfo?(remotenonsense)
Attachment #9294579 - Flags: approval-comm-esr102?

Comment on attachment 9294579 [details] [diff] [review]
1789314-esr102.patch

[Triage Comment]
approved for esr102

Attachment #9294579 - Flags: approval-comm-esr102? → approval-comm-esr102+
Attachment #9293428 - Flags: approval-comm-esr102+

[Triage Comment]
Fixes call to pop3Daemon(). Verified working on local build.

Attachment #9294720 - Flags: approval-comm-esr102+

Can confirm it works again without workaround in Thunderbird 102.3.0.

Status: RESOLVED → VERIFIED

I just noticed a small glitch. When there are many new messages, the "receiving message x of y" status bar messages alway show y as 0 (i.e. "receiving message 147 of 0"). But I can live with that :)

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: