Closed Bug 497096 Opened 15 years ago Closed 11 years ago

Unable to delete folders when IMAP server supports folders with messages and sub-folders

Categories

(MailNews Core :: Networking: IMAP, defect)

1.9.1 Branch
x86
Windows XP
defect
Not set
major

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 301714

People

(Reporter: tje1, Unassigned)

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:1.9.0.4) Gecko/2008111710 Firefox/3.0.4
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1pre) Gecko/20090609 Shredder/3.0b3pre

Using the dovecot IMAP server and Maildir format folders, deleting a folder does not work.

With 'Move to Trash' set, the deleted folder appears as a sub-folder of Trash and then performing an 'Empty Trash' operation causes it to disappear from the list of folders.  However, collapsing and expanding the folder list causes it to re-appear (with all its messages intact).

The same happens with 'Delete Immediately' set.  With this you also get the error message 'The current command did not succeed.  The mail server responded:Invalid mailbox name.'

For completeness, setting 'Mark as Deleted' does not work either.



Reproducible: Always

Steps to Reproduce:
1.See 'Details'
2.
3.
Actual Results:  
See 'Details'

Expected Results:  
See 'Details'

Happens on all versions of Thunderbird I've tried and on several different operating systems.

Performing the same operation using a Webmail client or MS-Outlook works correctly, so it doesn't appear to be a problem with the IMAP server.

If there is a way of getting Thunderbird to display the folder name it is sending to the IMAP server which is then saying it is invalid might help.
yes there is using logging  see https://wiki.mozilla.org/MailNews:Logging on how to enable it. Can you reproduce the issue and add the log to this bug using the add new attachment link on this page ?
Attached file Thunderbird debug log
I've deleted lines containing message data and also obfuscated login ID and server name.

Looking at the output it appears that Thunderbird is appending a folder separator character ('/') at the end of the foldername to be deleted.
Attachment #383260 - Attachment mime type: application/octet-stream → text/plain
Component: General → Networking: IMAP
Product: Thunderbird → MailNews Core
QA Contact: general → networking.imap
Version: unspecified → 1.9.1 Branch
> 1 capability
> * CAPABILITY IMAP4rev1 SASL-IR SORT THREAD=REFERENCES MULTIAPPEND UNSELECT
>              LITERAL+ IDLE CHILDREN NAMESPACE LOGIN-REFERRALS UIDPLUS
>              LIST-EXTENDED I18NLEVEL=1 QUOTA STARTTLS AUTH=PLAIN AUTH=LOGIN
> 1 OK Capability completed.
>(snip)
> 4 list "" "Trash/*"
> * LIST (\HasChildren) "/" "Trash/"
> * LIST (\HasNoChildren) "/" "Trash/emu2000"
> * LIST (\HasNoChildren) "/" "Trash/agresso"
> 4 OK List completed.
> 5 list "" "Trash/emu2000/*"
> * LIST (\HasNoChildren) "/" "Trash/emu2000/"
> 5 OK List completed.
> 6 delete "Trash/emu2000/"
> 6 NO Invalid mailbox name

Which fault?
  a) Tb who issued 5 list "" "Trash/emu2000/*"
     even though response of * LIST (\HasNoChildren) "/" "Trash/emu2000".
  b) IMAP server who returned * LIST (\HasNoChildren) "/" "Trash/emu2000/"
     to 5 list "" "Trash/emu2000/*".
I think the fault is Thunderbird sending :

delete "Trash/emu2000/"

instead of :

delete "Trash/emu2000"
> IMAP VERSION 4rev1
>   http://tools.ietf.org/html/rfc3501 
> IMAP4 Child Mailbox Extension
>   http://tools.ietf.org/html/rfc3348

(In reply to comment #4)
> I think the fault is Thunderbird sending : delete "Trash/emu2000/"
> instead of : delete "Trash/emu2000"

Where can I see description of "response of Trash/emu2000/ is valid"?
Where can I see description of "IMAP client should remove delimiter at last position of mail box name if server returned delimiter as last character of mail box name"?
RFC 3501 description about mailbox name in LIST response.
> http://tools.ietf.org/html/rfc3501#section-7.2.2
> 7.2.2. LIST Response
>(snip)
>      The name represents an unambiguous left-to-right hierarchy, and
>      MUST be valid for use as a reference in LIST and LSUB commands.
>      Unless \Noselect is indicated, the name MUST also be valid as an
>      argument for commands, such as SELECT, that accept mailbox names.
Please not that "MUST" is used.
For RFC violations.
>(snip)
> 4 list "" "Trash/*"
> * LIST (\HasChildren) "/" "Trash/"
> * LIST (\HasNoChildren) "/" "Trash/emu2000"
> * LIST (\HasNoChildren) "/" "Trash/agresso"
> 4 OK List completed.

> 5 list "" "Trash/emu2000/*"
(A) Even though \HasNoChildren, Tb issues list for childs.
    This is not RFC violation, but this is not good behaviour.
    So this can be said "Tb's bug".
    Note: "response of \HasChildren" and "no folder list to subsequnet LIST
          for childs" is permitted server's behaviour.
          So, Tb possibly issues "list for childs" both when \HasChildren
          and when \HasNoChilren.

> * LIST (\HasNoChildren) "/" "Trash/emu2000/"
(B) This response means folder named <null> under emu2000 under Trash.
    Folder name in response has to be correct name which can be specified in
    SELECT commant etc. So this is apparently server side bug.

> 5 OK List completed.

> 6 delete "Trash/emu2000/"
(C) This is never RFC violation, because "Trash/emu2000/" is folder name in
    LIST command response returned by server.
    But Tb is better to be tolerant with <null> folder name, or Tb is better to
    display appropriate error message to user for server's misbehave.    

> 6 NO Invalid mailbox name
Is this bug related to bug 353771?
Yes, looks similar. I think you need to go into account settings, server settings, advanced, and uncheck the box that says your server supports folders that can both contain messages and sub-folders. That should fix your problem.
Correction of comment #7.

> * LIST (\HasNoChildren) "/" "Trash/emu2000/"
(B) Trailing "/"(delimiter) was permitted for LIST, and had meaning - directory type folder(container of subfolder).

> 6 delete "Trash/emu2000/"
> 6 NO Invalid mailbox name
(C) This is RFC violation by Tb. Client should remove trailing "/".

=> Same issue as bug 301714 which is put in "Depends on:" field of this bug.

(In reply to comment #9)
> and uncheck the box that says your server supports folders
> that can both contain messages and sub-folders.

David, can it be workaround of bug 301714 and some friends?
Status: UNCONFIRMED → NEW
Ever confirmed: true
(In reply to comment #10)

> 
> David, can it be workaround of bug 301714 and some friends?

For the delete folder case, yes. But if the server does support folders that can have messages and sub-folders, I don't think you want to uncheck that box because of the functionality you lose.
Closing as dup of bug 301714. If wrong, re-open, please.
Status: NEW → RESOLVED
Closed: 11 years ago
No longer depends on: 301714
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: