Closed Bug 180806 Opened 22 years ago Closed 22 years ago

IMAP backend should avoid unnecessary logout

Categories

(MailNews Core :: Networking: IMAP, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: KaiE, Assigned: Bienvenu)

Details

Attachments

(1 file)

I'm not perfectly sure what I propose is a good idea. Suppose you are connecting to a server using IMAP/SSL. Suppose your configuration is to use client authentication with the server, where the authentication happens on the SSL layer around the connection. Suppose when the user opens the connection, the prompt comes up that asks the user to enter the password to unlock self's certificate for authentication. Suppose the user decides to cancel. In the above scenario, when the user quits the application, one can see the mail code is attempting another connection to the server on exit. This happens because the imap protocol code is trying to send a "1 logout" command, which agains triggers the attempt to establish a crypto communication. I want to suggest we prevent sending the logout command on closing, if it would be the first command to the server.
Attached patch Proposed PatchSplinter Review
Small change, large context, patch ignoring whitespace. What do you think?
Summary: IMAP backend should avoid unnecessary commands → IMAP backend should avoid unnecessary logout
Comment on attachment 106719 [details] [diff] [review] Proposed Patch can we get authenticated without ever sending a command? e.g., the pre-auth stuff? Even if we could, I guess we'd immediately try to send some commands anyway, so it might be a moot question. If that seems OK to you, then it's fine with me.
Attachment #106719 - Flags: review+
> can we get authenticated without ever sending a command? > e.g., the pre-auth stuff? Yes. The SSL authentication completes without having sent any IMAP command. An IMAP server can query its crypto engine, whether authentication already happened for the given server - and that is why one does not see a password prompt when connecting to our corporate internal mail servers with a personal certificate installed (or when going to aka using https). > Even if we could, I guess we'd immediately try to send some > commands anyway, so it might be a moot question. > If that seems OK to you, then it's fine with me You sound like you are concerned about not sending a logout command although we are authenticated with the server using a non-IMAP protocol mechanism? I suppose, the worst that can happen is the server continues to have us authenticated as long as we keep our socket up.
Attachment #106719 - Flags: superreview?(sspitzer)
Kai, yeah, that's what I was worried about, but I think we'll pretty much always send at least one command to an imap connection - in other words, we only open connections in order to send commands to them.
Comment on attachment 106719 [details] [diff] [review] Proposed Patch sr=sspitzer
Attachment #106719 - Flags: superreview?(sspitzer) → superreview+
Fixed on trunk.
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
QA Contact: huang → gchan
Product: MailNews → Core
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: