This came from Kazu Yamamoto: Outline: Thunderbird cannot use APOP if TLS is used. Reason: Thunderbird resets APOP information after a TLS connection is created. Yes, information provided by the CAPA command must be reset. And new information must be obtained with the second CAPA command. However, APOP information is provided by greeting and it MUST NOT be reset. Fix: See the following code. Since Thunderbird is too larget, I have not compiled it. (I'm not a C++ programmer, so the syntax may be awkward but I hope you can understand my intention.) mailnews/local/src/nsPop3Protocol.c: + boolean has_apop = TestCapFlag(POP3_HAS_AUTH_APOP); m_pop3ConData->capability_flags = // resetting the flags POP3_AUTH_MECH_UNDEFINED | POP3_HAS_AUTH_USER | // should be always there POP3_GURL_UNDEFINED | POP3_UIDL_UNDEFINED | POP3_TOP_UNDEFINED | POP3_XTND_XLST_UNDEFINED; + if (has_apop) SetCapFlag(POP3_HAS_AUTH_APOP);
Created attachment 235134 [details] [diff] [review] possible fix I don't have a POP3 / APOP server I can test this against, but it should do the trick. I could also have written the patch as: m_pop3ConData->capability_flags = // resetting the flags POP3_AUTH_MECH_UNDEFINED | POP3_HAS_AUTH_USER | // should be always there POP3_GURL_UNDEFINED | POP3_UIDL_UNDEFINED | POP3_TOP_UNDEFINED | POP3_XTND_XLST_UNDEFINED | (TestCapFlag(POP3_HAS_AUTH_APOP) ? POP3_HAS_AUTH_APOP : 0); // preserve the APOP flag with the new connection I'm not sure which way is the easier on the eyes.
how about this? PRUint32 preservedFlags = m_pop3ConData->capability_flags & POP3_HAS_AUTH_APOP; and then the rest of your patch. That makes it easier to add flags that need preserving, if any.
Created attachment 235139 [details] [diff] [review] improved fix per bienvenu great idea David.
fixed branch and trunk.
I've tested the latest-mozilla1.8 en-US Mac build and confirmed the bug fix. APOP + TLS works for me. No error message is shown now. Can you also check-in the patch to the 1.8.0 branch if it has no risk? We would appreciate if you can fix this bug for the upcoming Thunderbird 220.127.116.11. Thank you very much for your work!
sorry, I think it's too late for 18.104.22.168 but we can try to get it into 22.214.171.124
Comment on attachment 235139 [details] [diff] [review] improved fix per bienvenu approved for 1.8.0 branch, a=dveditz for drivers
fixed for 126.96.36.199 as well.