Rename sub.sub.subfolder fails, IMAP 'rename" command sends incorrect command to server (same name for old-name and new-name in rename command, if multiple space exist in parent folder name)

NEW
Unassigned

Status

--
major
11 years ago
3 years ago

People

(Reporter: tengel, Unassigned)

Tracking

1.9.1 Branch
x86
Windows XP
Bug Flags:
blocking-thunderbird3 -
wanted-thunderbird3 +

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [no l10n impact])

Attachments

(1 attachment)

(Reporter)

Description

11 years ago
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.10) Gecko/20070313 Fedora/1.5.0.10-5.fc6 Firefox/1.5.0.10
Build Identifier: 2.0.0.0 (20070326)

Dovecot 1.0.0 IMAP server, but shouldn't matter; reproduced in 1.5.0.10 and 2.0.0.0 releases of Thunderbird on WindowsXP.

The folder setup exists like so:
INBOX
-> [aaa] AaaAaaa
--> Bbbbb Bbbb b Bbbbbb Bbbbbbbb
---> 9717

Rightmouseclick on "9717" and attempt to rename "9717" to "9717 - blah blah". The rename will fail with a "Mailbox Exists" from the server.

Running Thunderbird with the NSPR debug commands, the 'rename' IMAP command being sent to the server is missing the " - blah blah" portions of the new folder name. Snippet (masked for privacy):

4016[23e2ef0]: 23d7f78:mail.xxxxx.com:S-INBOX.[AAA] AaaAaaaa.Bbbbb Bbbb b Bbbbbb Bbbbbbbb.9717:ProcessCurrentURL: entering
4016[23e2ef0]: 23d7f78:mail.xxxx.com:S-INBOX.[AAA] AaaAaaaa.Bbbbb Bbbb b Bbbbbb Bbbbbbbb.9717:ProcessCurrentURL:imap://xxxxxxxx@mail.xxxxx.com:143/rename%3E.INBOX.%5BAAA%5D%20AaaAaaaa.Bbbbb%20Bbbb%20b%20Bbbbbb%20Bbbbbbbb.9717%3E.INBOX.%5BAAA%5D%20AaaAaaaa.Bbbbb%20Bbbb%20b%20Bbbbbb%20Bbbbbbbb.9717%00Projects.9717%20-%20blah%20blah:  = currentUrl
4016[23e2ef0]: 23d7f78:mail.xxxxx.com:S-INBOX.[AAA] AaaAaaaa.Bbbbb Bbbb b Bbbbbb Bbbbbbbb.9717:SendData: 6 lsub "" "INBOX.[AAA] AaaAaaaa.Bbbbb Bbbb b Bbbbbb Bbbbbbbb.9717.*"
4016[23e2ef0]: ReadNextLine [stream=2489a58 nb=22 needmore=0]
4016[23e2ef0]: 23d7f78:mail.xxxxx.com:S-INBOX.[AAA] AaaAaaaa.Bbbbb Bbbb b Bbbbbb Bbbbbbbb.9717:CreateNewLineFromSocket: 6 OK Lsub completed.
4016[23e2ef0]: 23d7f78:mail.xxxxx.com:S-INBOX.[AAA] AaaAaaaa.Bbbbb Bbbb b Bbbbbb Bbbbbbbb.9717:SendData: 7 close
4016[23e2ef0]: ReadNextLine [stream=2489a58 nb=23 needmore=0]
4016[23e2ef0]: 23d7f78:mail.xxxxx.com:S-INBOX.[AAA] AaaAaaaa.Bbbbb Bbbb b Bbbbbb Bbbbbbbb.9717:CreateNewLineFromSocket: 7 OK Close completed.
4016[23e2ef0]: 23d7f78:mail.xxxxx.com:A:SendData: 8 rename "INBOX.[AAA] AaaAaaaa.Bbbbb Bbbb b Bbbbbb Bbbbbbbb.9717" "INBOX.[AAA] AaaAaaaa.Bbbbb Bbbb b Bbbbbb Bbbbbbbb.9717"
4016[23e2ef0]: ReadNextLine [stream=2489a58 nb=22 needmore=0]
4016[23e2ef0]: 23d7f78:mail.xxxxx.com:A:CreateNewLineFromSocket: 8 NO Mailbox exists.

Note that on line #2 the currentURL includes the proper " - blah blah" new folder name, but that it's lost on line #9, Thunderbird is sending the same FROM and TO folder name for the operation; the server correctly responds 'Mailbox Exists' because in fact it does, given the wrong command from the client.


Reproducible: Always

Steps to Reproduce:
1. Create sub.sub.subfolder hierarchy as noted
2. Attempt to rename final subfolder
3. Get Mailbox Exists error
Actual Results:  
Mailbox is not renamed, Mailbox Exists error is returned

Expected Results:  
Mailbox is renamed as intended.


Debug scriptlet used:
== snip ==
set mydate=%date:~-4,4%%date:~-7,2%%date:~-10,2%
set mytime=%time:~0,2%%time:~+3,2%
set NSPR_LOG_MODULES=IMAP:5
set NSPR_LOG_FILE=c:\thunderbird_%mydate%_%mytime%.log
start /d "c:\program files\mozilla thunderbird" thunderbird.exe
== snip ==
(Reporter)

Comment 1

11 years ago
An entire other instance of a user's email can recreate this, yet the bug remains unconfirmed and ignored in the Mozilla bug system. This is a 100% reproducable, verified bug on this end and we need to get it in the queue to be fixed. This problem has been around for quite a long time and a) puts the user at a complete loss, and b) chews up IT resources fixing this bug by hand for people.
Version: unspecified → 2.0
Truncated at space?
What happens when you rename to "9717-BlahBlah" instead of "9717 - blah blah"?
(Reporter)

Comment 3

11 years ago
Sorry for the delay. I just now tested (TB 2.0.0.5, Linux Fedora 7) and it fails both with and without the use of spaces in the rename-to name. In fact I simply cut-pasted out of this bug report and created the folders with AaAaaa and whatnot -- if you do it on your IMAP server with the same values are you saying it's working?

I have reproduced this in 5 minutes using a free IMAP server that you can test as well - go to http://fastmail.fm/ and sign up for a free account. Follow the instructions to set up Thunderbird (you have to edit the namespace for folder to work right) here: http://fastmail.net/docs/imap/thunderbird.htm#tute2

In my above example I used "[" and "]" which Fastmail doesn't support; however it still fails by creating this structure:

-> Inbox
-> aaa AaaAaaa
--> Bbbbb Bbbb b Bbbbbb Bbbbbbbb
---> 9717

Try renaming 9717 to simply 97177 and you'll get permission denied - look at your Thunderbird debug file and it's very obvious that TBird is sending the wrong commands for the folder rename, it's using the old folder name as the new (meaning basically do nothing). Anybody should be able to reproduce this with ease, I sure did. Took 5 minutes.

Updated

10 years ago
Assignee: mscott → nobody

Comment 4

9 years ago
Confirming with Tb 2.0.0.23 Windows and Linux too.

It's sufficient to have a base ordner containing spaces

e.g.

a b c
|-test1

try to rename test1 to test2, does not work (TB Windows will bring up a RENAME failed message, TB Linux (OpenSuSE 11.1 edition) just silently fails and does nothing

if you rename the a b c folder to something without spaces, the renaming of test1 works afterwards

We've got a Courier Imap running, a short test with kmail showed, that it's not the imap server (as it might be obvious reading this bug report ;) )

I just tried too "thunderbird 3.0 beta4 Linux". It does not work either.
This version shows an error message "Der aktuelle Befehl war nicht erfolgreich.  Der Mail-Server antwortete:RENAME failed: Invalid argument", which means something like "the current command was not successfully, mailserver answered...". Again, it works, if you drop the spaces from the base folder.





Christian
Flags: wanted-thunderbird3?
Flags: blocking-thunderbird3?
Christian can you provide a imap log as described at : https://wiki.mozilla.org/MailNews:Logging ?
Component: General → Networking: IMAP
Product: Thunderbird → MailNews Core
QA Contact: general → networking.imap
Version: 2.0 → 1.9.1 Branch

Comment 6

9 years ago
Created attachment 403763 [details]
log from tb 3.0 beta 4 linux

this time it did surprisingly not work in the first subdirectory, but you can see, that it happened in the second subdirectory hierarchy, as described in the original bug report
(In reply to comment #6)
> log from tb 3.0 beta 4 linux

> but you can see, that it happened in the second subdirectory hierarchy, as described in the original bug report

(Log data for the failure)
> SendData: 33 rename "INBOX.a b c.test2 1 3.test 3" "INBOX.a b c.test2 1 3.test 3"
> CreateNewLineFromSocket: 33 NO RENAME failed: Invalid argument
> SendData: 44 rename "INBOX.a b c.test2 1 3.test 3" "INBOX.a b c.test2 1 3.test 3"
> CreateNewLineFromSocket: 44 NO RENAME failed: Invalid argument
(First argument : original name)
> "INBOX.a b c.test2 1 3.test 3"
(Second argument : new name)
> "INBOX.a b c.test2 1 3.test 3"

Your new server seems to return "Invalid argument" instead of "Mailbox exists" when same name is requested.

You said next in comment #0.
> rename "9717" to "9717 - blah blah".
> IMAP command being sent to the server is missing the " - blah blah" portions of the new folder name.
(Log in comment #0)
> 8 rename "INBOX.[AAA] AaaAaaaa.Bbbbb Bbbb b Bbbbbb Bbbbbbbb.9717" "INBOX.[AAA] AaaAaaaa.Bbbbb Bbbb b Bbbbbb Bbbbbbbb.9717"
> 8 NO Mailbox exists.
(First argument : original name)
> "INBOX.[AAA] AaaAaaaa.Bbbbb Bbbb b Bbbbbb Bbbbbbbb.9717"
(Second argument : new name)
> "INBOX.[AAA] AaaAaaaa.Bbbbb Bbbb b Bbbbbb Bbbbbbbb.9717"

What string did you request as new folder name in the new test case?
Can you create "INBOX.a b c.test2 1 3.test-3-XXX-YYY-ZZZ"? (longer one)

Comment 8

9 years ago
> Your new server seems to return "Invalid argument" instead of "Mailbox exists"
> when same name is requested.

courier-imap-4.4.1-1.19 

> What string did you request as new folder name in the new test case?
> Can you create "INBOX.a b c.test2 1 3.test-3-XXX-YYY-ZZZ"? (longer one)

I'm not quiet sure anymore, but it was short. test 34 or test 35 afair. There is a ProcessCurrentURL statement a few lines above:

-1410335856[acc335e0]: b0308800:imap.xxxxxxxxxxx.xx:S-INBOX.a b c.test2 1 3.test 3:ProcessCurrentURL:imap://fertig@imap.xxxxxxxxxxx.xx:143/rename%3E.a%20b%20c.test2%201%203.test%203%3E.a%20b%20c.test2%201%203.test%203%00.test%2035:  = currentUrl

which could prove this.

Christian
I could see similar phenomenon with Gmail IMAP, with Tb 3.0b4(9/30 build).
Folder: "A B C/0 1 2 3 4/5 6 7 8/X Y Z" (max gmail label length=40, so within limit) 
Rename to "P Q R", Rename to "PQR", Rename to "P"
  -> Duplicate folder name A B C/0 1 2 3 4/5 6 7 8/X Y Z (Failure)
New name looks irrelvant. Possibly escaped %20(and may be delimiter of %00) handling related issue - new name is lost, then same name is used as new name.
I'll try to get IMAP log.
If you'll have new findings(number of spaces, number of characters between spaces, ... is relevant or not), report them, please.
Problem occurred with "A B C/X", "A B C D/X". No problem if "A B/X". It may be problem when multiple spaces in parent's folder name.
Confirming by IMAP logs from bug opener and my test results in comment of 9 & 10.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: Rename sub.sub.subfolder fails, IMAP 'rename" command sends incorrect command to server → Rename sub.sub.subfolder fails, IMAP 'rename" command sends incorrect command to server (same name for old-name and new-name in rename command, then "Mailbox exists", "Invalid argument" and so on)
No difference from IMAP log of comment #0 and comment #6 was seen in my test with Gmail IMAP.
Summary: Rename sub.sub.subfolder fails, IMAP 'rename" command sends incorrect command to server (same name for old-name and new-name in rename command, then "Mailbox exists", "Invalid argument" and so on) → Rename sub.sub.subfolder fails, IMAP 'rename" command sends incorrect command to server (same name for old-name and new-name in rename command, if multiple space exist in parent folder name)

Updated

9 years ago
Whiteboard: [no l10n impact]

Comment 13

9 years ago
Not going to block on this - I'll try to investigate it, though.
Flags: wanted-thunderbird3?
Flags: wanted-thunderbird3+
Flags: blocking-thunderbird3?
Flags: blocking-thunderbird3-
Duplicate of this bug: 632536
You need to log in before you can comment on or make changes to this bug.