Closed Bug 349929 Opened 18 years ago Closed 18 years ago

APOP information is reset after stepping up a TLS connection

Categories

(MailNews Core :: Networking: POP, defect)

x86
Windows XP
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: mscott, Assigned: mscott)

Details

(Keywords: fixed1.8.0.7, fixed1.8.1)

Attachments

(1 file, 1 obsolete file)

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);
Status: NEW → ASSIGNED
Flags: blocking-thunderbird2+
Attached patch possible fix (obsolete) — Splinter Review
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.
great idea David.
Attachment #235134 - Attachment is obsolete: true
Attachment #235139 - Flags: superreview?(bienvenu)
Attachment #235139 - Flags: superreview?(bienvenu) → superreview+
fixed branch and trunk.
Keywords: fixed1.8.1
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 1.5.0.7.

Thank you very much for your work!
sorry, I think it's too late for 1.5.0.7 but we can try to get it into 1.5.0.8
Flags: blocking1.8.0.8?
Attachment #235139 - Flags: approval1.8.0.8?
Attachment #235139 - Flags: approval1.8.0.7?
Comment on attachment 235139 [details] [diff] [review]
improved fix per bienvenu

approved for 1.8.0 branch, a=dveditz for drivers
Attachment #235139 - Flags: approval1.8.0.8?
Attachment #235139 - Flags: approval1.8.0.7?
Attachment #235139 - Flags: approval1.8.0.7+
Flags: blocking1.8.0.8? → blocking1.8.0.7+
fixed for 1.5.0.7 as well. 
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Keywords: fixed1.8.0.7
Resolution: --- → FIXED
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: