Closed Bug 202622 Opened 21 years ago Closed 21 years ago

mozilla can't subscribe to existing imap folders

Categories

(MailNews Core :: Networking: IMAP, defect)

x86
Linux
defect
Not set
major

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: b, Assigned: Bienvenu)

References

Details

Attachments

(2 files, 1 obsolete file)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20030225
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20030225

When I try to subscribe to existing imap folders I get:
"The current command did not succeed. The mail server responded: Cannot
subscribe to this folder.."
My imap server is courier-imap 1.7.0 (http://www.inter7.com/courierimap/)
It works to subscribe to existing folders from other mail clients like SquirrelMail.
Strange is that I can see the folder when I choose "Subscribe", but when I mark
its box and presses "OK" I get the above error message.
So now I can't manage folders that already exists (e g when created from other
mail clients). Even if I restart Mozilla its the same.
This has been like this for mane versions of Mozilla (I guess it has never
worked) and it does still not work in Mozilla 1.3 (dled from mozilla.org).
Only way to manage existing folders:
1. delete and recreate the folder or
2. delete the mail profile and create it from scratch

Reproducible: Always

Steps to Reproduce:
See above.
Actual Results:  
When I try to subscribe to existing imap folders I get:
"The current command did not succeed. The mail server responded: Cannot
subscribe to this folder.."

Expected Results:  
Subscribed to the folder so I can manage it.
*** Bug 202623 has been marked as a duplicate of this bug. ***
One thing that is irritating is that some folders are possible to subscribe to
and other folders are not (I get the above errormsg). And the folders that works
and does not work doesn't seem to be any different to me, e g they consist of
just chars a-z and has length between 8-16 chars.
I mailed with the main developer of Courier-IMAP (Sam Varshavchik) and he said
that this is a Mozilla bug after we debuged what happened. From the
courier-imap-admin@lists.sourceforge.net mailinglist:

> Ok, this is what I get, look below and you will see the line with
>     WRITE: 2 NO Cannot subscribe to this folder.
> which is strange to me because the folder is there:

It's a Mozilla bug.

> * LIST (\HasNoChildren) "." "INBOX.dctc"

The IMAP folder name, as you can see above, is "INBOX.dctc".  Courier uses 
a period as a folder hierarchy separator.

> READ: NUMBER: 2
> READ: ATOM: SUBSCRIBE
> READ: QUOTED_STRING: INBOX/dctc

The command issued by Mozilla is "SUBSCRIBE INBOX/dctc", when the right 
command is "SUBSCRIBE INBOX.dctc".
Matthias Versen ("mversen") asked me to attach the Courier IMAP log that shows
what happens, here it follows. In this example I try to subscribe to the folder
"dctc" from Mozilla Mail:

$ ls -la ~/Maildir/.dctc/
total 8
drwx------    5 b        myusr          79 Apr 26 16:59 .
drwx------   36 b        myusr        4096 May 13 22:02 ..
-rw-r--r--    1 b        myusr          86 Apr 26 16:59 courierimapuiddb
drwx------    2 b        myusr          85 Apr 26 16:59 cur
-rwx------    1 b        myusr           0 Apr 26 16:59 maildirfolder
drwx------    2 b        myusr           6 Apr 26 16:59 new
drwx------    2 b        myusr           6 Apr 26 16:59 tmp

This is Maildir/log.txt when I tried to subscribe to the folder "dctc" (I have
removed some lines with a bit sensitive information, and I have there put in
"[...]".)

WRITE: 2 OK LOGIN Ok.

READ: NUMBER: 3
READ: ATOM: NAMESPACE
READ: EOL
WRITE: * NAMESPACE (("INBOX." ".")) NIL (("shared." "."))
3 OK NAMESPACE completed.

READ: NUMBER: 4
READ: ATOM: LSUB
READ: QUOTED_STRING:
READ: QUOTED_STRING: INBOX.*
READ: EOL
WRITE: * LSUB (\HasNoChildren) "." "INBOX.courier.imap"
* LSUB (\HasNoChildren) "." "INBOX.mozilla.bugzilla"
* LSUB (\HasNoChildren) "." "INBOX.courier.users"
[...]
* LSUB (\HasNoChildren) "." "INBOX.Sent"
* LSUB (\Noselect \HasChildren) "." "INBOX.courier"
* LSUB (\Noselect \HasChildren) "." "INBOX.postfix"
* LSUB (\Noselect \HasChildren) "." "INBOX.mozilla"
* LSUB (\Noselect \HasChildren) "." "INBOX.mailman"
* LSUB (\Noselect \HasChildren) "." "INBOX.apache-httpd"
4 OK LSUB completed

READ: NUMBER: 5
READ: ATOM: LSUB
READ: QUOTED_STRING:
READ: QUOTED_STRING: shared.*
READ: EOL
WRITE: 5 OK LSUB completed

READ: NUMBER: 6
READ: ATOM: LIST
READ: QUOTED_STRING:
READ: QUOTED_STRING: INBOX
READ: EOL
WRITE: * LIST (\Unmarked \HasChildren) "." "INBOX"
6 OK LIST completed

READ: NUMBER: 7
READ: ATOM: SELECT
READ: QUOTED_STRING: INBOX
READ: EOL
WRITE: * FLAGS (\Draft \Answered \Flagged \Deleted \Seen \Recent)
* OK [PERMANENTFLAGS (\Draft \Answered \Flagged \Deleted \Seen)] Limited
* 3 EXISTS
* 0 RECENT
* OK [UIDVALIDITY 1047920037] Ok
7 OK [READ-WRITE] Ok

READ: NUMBER: 8
READ: ATOM: UID
READ: ATOM: FETCH
READ: ATOM: 1:*
READ: LPAREN
READ: ATOM: FLAGS
READ: RPAREN
READ: EOL
WRITE: * 1 FETCH (UID 178 FLAGS (\Seen))
* 2 FETCH (UID 191 FLAGS (\Seen))
* 3 FETCH (UID 193 FLAGS (\Seen))
8 OK FETCH completed.

READ: NUMBER: 9
READ: ATOM: LSUB
READ: QUOTED_STRING:
READ: QUOTED_STRING: INBOX.*
READ: EOL
WRITE: * LSUB (\HasNoChildren) "." "INBOX.courier.imap"
* LSUB (\HasNoChildren) "." "INBOX.mozilla.bugzilla"
* LSUB (\HasNoChildren) "." "INBOX.courier.users"
[...]
* LSUB (\HasNoChildren) "." "INBOX.Sent"
* LSUB (\Noselect \HasChildren) "." "INBOX.courier"
* LSUB (\Noselect \HasChildren) "." "INBOX.postfix"
* LSUB (\Noselect \HasChildren) "." "INBOX.mozilla"
* LSUB (\Noselect \HasChildren) "." "INBOX.mailman"
* LSUB (\Noselect \HasChildren) "." "INBOX.apache-httpd"
9 OK LSUB completed

READ: NUMBER: 10
READ: ATOM: LIST
READ: QUOTED_STRING:
READ: QUOTED_STRING: INBOX.%
READ: EOL
WRITE: * LIST (\HasNoChildren) "." "INBOX.xdude"
[...]
* LIST (\HasNoChildren) "." "INBOX.eric"
* LIST (\HasNoChildren) "." "INBOX.dctc"
[...]
* LIST (\HasNoChildren) "." "INBOX.Sent"
* LIST (\HasNoChildren) "." "INBOX.Trash"
* LIST (\Noselect \HasChildren) "." "INBOX.xine"
* LIST (\Noselect \HasChildren) "." "INBOX.courier"
[...]
* LIST (\Noselect \HasChildren) "." "INBOX.mozilla"
* LIST (\Noselect \HasChildren) "." "INBOX.postfix"
* LIST (\Noselect \HasChildren) "." "INBOX.mailman"
10 OK LIST completed

READ: NUMBER: 11
READ: ATOM: LIST
READ: QUOTED_STRING:
READ: QUOTED_STRING: INBOX.%.%
READ: EOL
WRITE: * LIST (\HasNoChildren) "." "INBOX.courier.imap"
* LIST (\HasNoChildren) "." "INBOX.xine.user"
[...]
* LIST (\HasNoChildren) "." "INBOX.courier.users"
* LIST (\HasNoChildren) "." "INBOX.mozilla.bugzilla"
[...]
* LIST (\HasNoChildren) "." "INBOX.mozilla.general"
* LIST (\HasNoChildren) "." "INBOX.postfix.users"
* LIST (\HasNoChildren) "." "INBOX.mailman.users"
11 OK LIST completed

READ: NUMBER: 12
READ: ATOM: LSUB
READ: QUOTED_STRING:
READ: QUOTED_STRING: shared.*
READ: EOL
WRITE: 12 OK LSUB completed

READ: NUMBER: 13
READ: ATOM: LIST
READ: QUOTED_STRING:
READ: QUOTED_STRING: shared.%
READ: EOL
WRITE: 13 OK LIST completed

READ: NUMBER: 14
READ: ATOM: LIST
READ: QUOTED_STRING:
READ: QUOTED_STRING: shared.%.%
READ: EOL
WRITE: 14 OK LIST completed

WRITE: 1 OK LOGIN Ok.

READ: NUMBER: 2
READ: ATOM: SUBSCRIBE
READ: QUOTED_STRING: INBOX/dctc
READ: EOL
WRITE: 2 NO Cannot subscribe to this folder.

READ: NUMBER: 3
READ: ATOM: LSUB
READ: QUOTED_STRING:
READ: QUOTED_STRING: INBOX.*
READ: EOL
WRITE: * LSUB (\HasNoChildren) "." "INBOX.courier.imap"
* LSUB (\HasNoChildren) "." "INBOX.mozilla.bugzilla"
* LSUB (\HasNoChildren) "." "INBOX.courier.users"
[...]
* LSUB (\HasNoChildren) "." "INBOX.Drafts"
* LSUB (\HasNoChildren) "." "INBOX.Trash"
* LSUB (\HasNoChildren) "." "INBOX.postfix.users"
* LSUB (\HasNoChildren) "." "INBOX.mozilla.general"
* LSUB (\HasNoChildren) "." "INBOX.mailman.users"
* LSUB (\HasNoChildren) "." "INBOX.apache-httpd.users"
[...]
* LSUB (\HasNoChildren) "." "INBOX.Sent"
* LSUB (\Noselect \HasChildren) "." "INBOX.courier"
* LSUB (\Noselect \HasChildren) "." "INBOX.postfix"
* LSUB (\Noselect \HasChildren) "." "INBOX.mozilla"
* LSUB (\Noselect \HasChildren) "." "INBOX.mailman"
* LSUB (\Noselect \HasChildren) "." "INBOX.apache-httpd"
3 OK LSUB completed

READ: NUMBER: 4
READ: ATOM: LSUB
READ: QUOTED_STRING:
READ: QUOTED_STRING: shared.*
READ: EOL
WRITE: 4 OK LSUB completed

READ: NUMBER: 5
READ: ATOM: LIST
READ: QUOTED_STRING:
READ: QUOTED_STRING: INBOX
READ: EOL
WRITE: * LIST (\Unmarked \HasChildren) "." "INBOX"
5 OK LIST completed

READ: NUMBER: 6
READ: ATOM: LOGOUT
READ: EOL
WRITE: * BYE Courier-IMAP server shutting down
6 OK LOGOUT completed

READ: NUMBER: 15
READ: ATOM: CLOSE
READ: EOL
WRITE: 15 OK mailbox closed.

READ: NUMBER: 16
READ: ATOM: LOGOUT
READ: EOL
WRITE: * BYE Courier-IMAP server shutting down
16 OK LOGOUT completed

WRITE: 1 OK LOGIN Ok.

READ: NUMBER: 2
READ: ATOM: SELECT
READ: QUOTED_STRING: INBOX
READ: EOL
WRITE: * FLAGS (\Draft \Answered \Flagged \Deleted \Seen \Recent)
* OK [PERMANENTFLAGS (\Draft \Answered \Flagged \Deleted \Seen)] Limited
* 3 EXISTS
* 0 RECENT
* OK [UIDVALIDITY 1047920037] Ok
2 OK [READ-WRITE] Ok

READ: NUMBER: 3
READ: ATOM: UID
READ: ATOM: FETCH
READ: ATOM: 1:*
READ: LPAREN
READ: ATOM: FLAGS
READ: RPAREN
READ: EOL
WRITE: * 1 FETCH (UID 178 FLAGS (\Seen))
* 2 FETCH (UID 191 FLAGS (\Seen))
* 3 FETCH (UID 193 FLAGS (\Seen))
3 OK FETCH completed.
->mailnews
Assignee: asa → bienvenu
Component: Browser-General → Networking: IMAP
Product: Browser → MailNews
QA Contact: asa → gchan
marking NEW (all needed informations are in the bug)
Status: UNCONFIRMED → NEW
Ever confirmed: true
Jan, have you tried removing the .msf files in the imap server sub-directory of
your user profile directory? This works fine for me with a server with a
hierarchy delimiter of '.', so I wonder if somehow the wrong hierarchy delimiter
is cached away in the .msf file for some folders.
I mean to add that this might have happened from running an older version of
mozilla. Also, you might try running a newer build of Mozilla, like 1.4 final.
IMAP log from mozilla 1.4b showing a subscribe to INBOX.xastir failing.
Added an attachment showing a subscribe failing talking to a Courier IMAP
server. I'll try (re)moving my msf file to see if that changes anything. Not
sure where a delimiter of "/" could have come from, as this has always been used
with a Courier server.
'/' is our default hierarchy delimiter and it's possible that the default snuck
into the .msf file. One other question - you're not using an IMAP server
directory in the IMAP server advanced prefs, are you? You're just letting the
IMAP server set the personal namespace to "INBOX." and letting it use that? 

On the cyrus server I have access to, I can subscribe and unsubscribe to
sub-folders of the INBOX w/o a problem.
Personal namespace shows "INBOX." and the allow server to override checkbox is
checked.

While playing with the Courier IMAP server to verify it's behavior, I manually
in a telnet session subscribed myself to INBOX.xastir, and it now shows up in
Mozilla as subscribed, and can be subscribed and unsubscribed without
difficulty. However, using "maildirmake -f mozillatest ~/Maildir" via the shell
to create a new folder then going in to subscribe to it with Mozilla shows the
same behavior. This is with Courier IMAP 1.7.3 over SSL.

Deleting the directories under Imapmail doesn't change this behavior.
using something similar to your steps, I was able to reproduce this. When the
subscribe UI discovers folders (as opposed to the normal imap folder discovery),
it must not be setting the hierarchy delimiter correctly
Status: NEW → ASSIGNED
Attached patch proposed fix (obsolete) — Splinter Review
What I see in the debugger is that the folder cache is getting the unknown
delimiter set and overriding the real delimiter. This should fix it. I still
need to do a little more debugging, however.
Attached patch proposed fixSplinter Review
I think these changes are needed too - we need to make sure that the rdf
resources/imap folder objects stay in memory while the subscribe ui is up,
because otherwise, we set the hierarchy delimiter in the imap folder object and
in some cases, it is deleted immediately.
Attachment #124966 - Attachment is obsolete: true
fix checked in, r/sr=sspitzer
Status: ASSIGNED → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
*** Bug 166934 has been marked as a duplicate of this bug. ***
Comment on attachment 124970 [details] [diff] [review]
proposed fix

yes, r/sr=sspitzer
Attachment #124970 - Flags: superreview+
Attachment #124970 - Flags: review+
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

Creator:
Created:
Updated:
Size: