Open Bug 479226 Opened 15 years ago Updated 1 year ago

Two Trash folders: "Move mail to Trash" does NOT work. (even though namespace is not used, if Inbox.Trash also exists, Tb misuses Inbox.Trash)

Categories

(MailNews Core :: Networking: IMAP, defect)

1.8 Branch
x86
Windows XP
defect

Tracking

(Not tracked)

REOPENED

People

(Reporter: aiko, Unassigned)

References

Details

Attachments

(4 files)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.6) Gecko/2009020409 Iceweasel/3.0.6 (Debian-3.0.6-1)
Build Identifier: Version 2.0.0.19 (20081209)

The normal "Delete" function is configured to "Move it to the trash folder".

While there is only one Trash folder, this option is working fine. The trash folder is located at imaps://hostname:993/Trash

But, creating a second trash folder like imaps://hostname:993/INBOX/Trash makes thunderbird deleting the mail without moving it to the trash folder anymore. The mail doesn't appear in one or the other trash folder. It is simply gone.

Accidentally removed mails are lost.

The workaround is to remove the second trash folder.

(The behavior is different for linux and thunderbird. Then thunderbird simply uses the other trash folder.)

Reproducible: Always

Steps to Reproduce:
1. Create 2nd trash folder.
2. Delete mail.
Actual Results:  
Mails are not moved to at least one trash folder.

Expected Results:  
Moving the mail to the trash folder.
Could you provide us with impa log as documented in https://wiki.mozilla.org/MailNews:Logging ?
Component: General → Networking: IMAP
Keywords: dataloss
Product: Thunderbird → MailNews Core
QA Contact: general → networking.imap
Version: unspecified → 1.8 Branch
The logs show the time between pressing the "Delete" button and the "Close" button.

I started with two trash folders. Later, I removed "INBOX/Trash" with a different IMAP client and refreshed the subscription list within thunderbird. I restarted thunderbird to create the second logfile.

The move command is missing while having two trash folders. Does thunderbird think, there is no trash folder? It looks like thunderbird is figuring out its trash folder by its own. Are there any sanity checks? For example: 
If ( trash_folder == unique() )
  return trash_folder;
else
  return NULL;

As a reminder, "Debian/Icedove-2.0.0.19 (20090103)" behaves differently. It normally uses "Trash" as trash folder. After adding "INBOX/Trash", it starts using "INBOX/Trash" as its trash folder...

Another hind: Zimbra is used as IMAP server.
What is set in next prefs.js entry for the IMAP account?
> user_pref("mail.server.serverN.trash_folder_name", "Trash");
IMAP system with namespace=INBOX?
What is your namespace related settings?
> Account Settings/Server Settings/"Advanced" button.
What is server response relates to greeting, capability, namespace, "Trash", "INBOX/Trash"?

If root level Trash exists, and if namespace=INBOX, and if INBOX/Trash exists, Tb may be confused. And it possibly depends on server response.
If Trash is set in prefs.js, is following workaround? (both Trash & INBOX/Trash case, restart of Tb may be required)
> user_pref("mail.server.serverN.trash_folder_name", "INBOX/Trash");

> As a reminder, "Debian/Icedove-2.0.0.19 (20090103)" behaves differently.

"Debian/Icedove-2.0.0.19 (20090103)" is nightly build or test build?
If yes, difference is possibly produced by Bug 470650. If patch for Bug 401293(foxed on 2008-11-19) is applied to the build, Bug 470650 can occur.
Check IMAP log, please.
(In reply to comment #5)
> What is set in next prefs.js entry for the IMAP account?
> > user_pref("mail.server.serverN.trash_folder_name", "Trash");

trash_folder_name is not set, but I tried this parameter before and it makes no difference.

> IMAP system with namespace=INBOX?
> What is your namespace related settings?
> > Account Settings/Server Settings/"Advanced" button.

The "personal namespace" is set to "". The button for "Allow server to override these namespaces" is set.

> What is server response relates to greeting, capability, namespace, "Trash",
> "INBOX/Trash"?

* CAPABILITY IMAP4rev1 STARTTLS AUTH=PLAIN AUTH=X-ZIMBRA ACL BINARY CATENATE CHILDREN CONDSTORE ENABLE ESEARCH ID IDLE LIST-EXTENDED LITERAL+ LOGIN-REFERRALS MULTIAPPEND NAMESPACE QRESYNC QUOTA RIGHTS=ektx SASL-IR SEARCHRES UIDPLUS UNSELECT WITHIN

> If root level Trash exists, and if namespace=INBOX, and if INBOX/Trash exists,
> Tb may be confused. And it possibly depends on server response.
> If Trash is set in prefs.js, is following workaround? (both Trash & INBOX/Trash
> case, restart of Tb may be required)
> > user_pref("mail.server.serverN.trash_folder_name", "INBOX/Trash");

Namespace is not set. And the Zimbra web interface expects the trash folder at "Trash", not at "INBOX/Trash".

> > As a reminder, "Debian/Icedove-2.0.0.19 (20090103)" behaves differently.
> 
> "Debian/Icedove-2.0.0.19 (20090103)" is nightly build or test build?

It has been the standard Debian/Lenny build.
Do you set "IMAP server directory"?
> Account Settings, Server Settings, Advanced, "IMAP server directory:".
Nope, that field is empty. I reproduced that behavior with plain new profile.

Right now, I reproduced this behavior with the dovecot IMAP server and a plain new thunderbird profile. The dovecot server does not set a namespace by default.

I could prepare a mailbox on a testserver for you.
> I reproduced this behavior with plain new profile.

What is path for "root level Trash" and "INBOX/Trash"?
 - "Copy folder location" at context menu of IMAP folder
 - "Paste" at text editor
Could you please attach IMAP log since intial connection, instead of log for 'uid copy NNNN "Trash" was not issued upon your "Delete" operation' only. (please replace sensitive information such as mail-addr by random string or remove mail data, before attach log file).
Thunderbird + Dovecot IMAP
Thunderbird + Dovecot IMAP
There is code here that checks for multiple folders with the trash flag set, and clears the flag if the name doesn't match the pref:

http://mxr.mozilla.org/comm-central/source/mailnews/imap/src/nsImapIncomingServer.cpp#1513

I suspect this is the cause of the issue. Confirming.
Status: UNCONFIRMED → NEW
Ever confirmed: true
As I wrote in Bug 486604 Comment #1 & Bug 486604 Comment #3, Tb trunk moved mails/issued expunge to "Inbox/Trash", and, "Empty Trash" of "Trash" was executed for "Inbox/Trash". Tb looks to simply misuse Inbox/Trash as trash folder, even though mail.server.serverN.trash_folder_name=Trash is set(Trash is default).
(checked with Tb trunk 2009/3/31 build on MS Win, using Gmail IMAP)

To Aiko Barz(bug opener):
Can you reproduce following phenomenon in your Comment #0 with Tb latest-trunk?
> The mail doesn't appear in one or the other trash folder. It is simply gone.
I used thunderbird-3.0b3pre.en-US.win32.installer.exe. And I cannot reproduce this issue with latest-trunk.

Deleted mails _appear_ in "Inbox/Trash" while "Trash" is not used.
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → WORKSFORME
To ludovic@mozillamessaging.com(who closed this bug as WORKSFORME): 

Really WORKSFORME? If so, which build did you use? 
"Move to 'Trash' doesn't work" is correct bug report and it still occurs, isn't it?
Tb still moves to "Inbox.Trash" instead of "Trash" even though user's request is "move to Trash instead of Inbox.Trash" if Inbox.Trash exists, doesn't it?
To ludovic@mozillamessaging.com who closed this bug as WORKSFORME at 2009-04-16 02:25:03 PDT:

"cannot reproduce" in Comment #14 is only for following phenomenon bug opener said in original report of Comment #0.
> The mail doesn't appear in one or the other trash folder. It is simply gone.
Never misunderstand bug with no testing, please.

Re-open.
Status: RESOLVED → REOPENED
Resolution: WORKSFORME → ---
Removing "dataloss" from summary: & keywords:.
Severity: major → normal
Keywords: dataloss
Summary: Two Trash folders: "Move mail to trash" does NOT work. (Data loss) → Two Trash folders: "Move mail to Trash" does NOT work. (if Inbox.Trash also exists, Tb misuses Inbox.Trash)
(In reply to comment #14)
> I used ...win32.installer.exe.

FYI. You can test latest-trunk by UNZIP only, if you download win32.zip build.
> http://ftp.mozilla.org/pub/mozilla.org/thunderbird/nightly/latest-trunk/
Problem couldn't be observed with Tb trunk 2009/6/21 build, with Gmail IMAP.
- mail.server.serverN.is_gmail=true is set.
- After XLIST support, mail.server.serverN.trash_folder_name=[Gmail]/Trash is set.
- Even when trash-can icon is displayed for (1) Root level Trash, (2) Inbox/Trash,
  (3) [Gmail]/Trash (produced by Tb 2 or older Tb trunk builds),
  icon of (1) Root level Trash, (2) Inbox/Trash was changed from trash-can icon
  to ordinal folder icon after IMAP server access by 2009/6/21 build.

Problem disappeared by XLIST support and changes around it?
Problem has been resolved?
Phenomenon with 2009/6/21 build was as follows:
1. Restart Tb (2009/6/21 build).
   Trash-can icon is displayed for next three folders.
   (1) Root level Trash, (2) Inbox/Trash, (3) [Gmail]/Trash
2. Click Inbox.
   (1) Root level Trash, (2) Inbox/Trash : Trash-can icon => Ordinal icon
   (3) [Gmail]/Trash                     : Trash-can icon is kept
3. Shutdown, restart Tb (2009/6/21 build) => 1. & 2. occurs.

Improved very much. But all problems is not resolved yet.
I'm a little unclear - are the extra trash icons coming back on restart and then going away when you click on the Inbox? When I did the XLIST support, I did add code to remove the trash flag from non-gmail trash folders...
Additional observation.
(1) "Three trash-can after restart" occurs even after delete of panacea.dat,
    delete of Trash, Trash.msf, Inbox.sbd\Trash, Inbox.sbd\Trash.msf.
(2) "Three trash-can" is displayed after each restart of Tb.
    ("Check for new messages at startup" is disabled.)
(3) When a folder other than Inbox(such as Archives/2008, Paierkorb)
    is clicked first, trash-can icon of Trash and Inbox/Trash
    is automatically changed to oridinal-folder icon. 
(4) When Inbox(it was same with Sent, Templates) is clicked first,
    icon is not changed automatically.
    icon is changed upon mouseover of Trash and mouseover of Inbox/Trash.
If "Check for new messages at startup" is enabled, falls back to (4).

I think:
  - (1)/(2) occurs before XLIST support gets control.
    So (1)/(2) can't be bypassed by XLIST support.
  - (4) is folder pane refresh issue around special folder.
I've seen a couple of GS requests that seem to deal with trash-related issues, so I tried myself to move the trash folder.

On 3.0.4 when I created a new folder "FauxTrash" as account/Inbox/FauxTrash then set that as the move-to for trash, at first nothing happened.

On restart, a new folder was created, in folder tree as account/Inbox/INBOX/FauxTrash  Now when I delete a message, it seems to be lost.

Reproduced again, using FauxTrash2 as name.

I tried setting the trash folder back to the original account/Inbox/Trash  Now on restart, new folder account/Inbox/INBOX/Trash is created, and still trash messages are lost.

On SquirrelMail web interface, it shows the following account tree:

INBOX
Drafts
Sent
Trash
FauxTrash
FauxTrash2
  FauxTrash
  FauxTrash2
  Trash
Jani
... and other normal folders

So there are some serious issues here.
When I reset manually the preference, for example:

mail.server.server10.trash_folder_name

then move on delete started to work again, going correctly to the default trash folder Inbox/Trash
Same here, I tried to use a different trash folder ("TrashLT" for "Long Term")

I had the creation of ghost directories like on comment:23.

So, I tried to change the name
Same here, I tried to use a different trash folder ("TrashLT" for "Long Term")

I had the creation of ghost directories like on comment:23.

So, I tried to change trash_folder_name from "INBOX/TrashLT" to "TrashLT" and it is a successful workaround for me.
I still have this problem, on Thunderbird 31.2.0, using IMAP4 to a dovecot server.
Tb displays a (toplevel) Trash and an Inbox/Trash folder (both displayed with trash icon)
The Inbox/Trash folder is greyed and italic, and doesn't exist on the server.
Server Settings->When I delete a message: is setup to move to (toplevel) Trash.
mail.server.server[n].trash_folder_name = Trash
Browsing mail and hitting "delete" fails to delete emails with the following error:

"The current operation on 'Inbox' did not succeed.  The mail server for account xxx@xxx responded: [TRYCREATE] Mailbox doesn't exist: INBOX/Trash."

(Sometimes the mail re-appears, sometimes it is gone for good.  It never goes to either Trash folder.)

Why is Tb trying to locate or create Inbox/Trash on the server?
How do I get Tb to recognise (toplevel) Trash as the correct Trash folder?
(In reply to Patrick from comment #27)
> The Inbox/Trash folder is greyed and italic, and doesn't exist on the server.
> mail.server.server[n].trash_folder_name = Trash
> Browsing mail and hitting "delete" fails to delete emails with the following error:
> "The current operation on 'Inbox' did not succeed.  The mail server for
> account xxx@xxx responded: [TRYCREATE] Mailbox doesn't exist: INBOX/Trash."

If personal namespace="INBOX."(note: path delimiter is dot, intead of slash), some issues may occur.
-  mail.server.server[n].trash_folder_name = Trash means "Trash folder under INBOX" in Tb if namespace is used.
   So, if INBOX.Trash doesn't exist at server, Tb tries to create it.
   Upon this creation, Tb may not use "." as delimiter. Tb may request "create INBOX/Trash" instead of  "create INBOX.Trash".
- Server may use root level Trash as "trash folder" even though personal naamespace="INBOX".
   This may cause confusion in Tb.
- Once "INBOX.Trash" is created, "INBOX.Trash" is subscribed.
   Even if the "INBOX.Trash" is deleted at server, "unsubscribe INBOX.Trash" is not usually executed at server.
   If you use "Show only subscribed folder", and if "INBOX.Trash" is returned as LSUB response from server,
   Tb shows it even when "INBOX.Trash" is not returned  to LIST from server because of "Show only subscribed folder" mode.

If delimiter = "/", and if "INBOX/Trash" is subscribed state, and if "INBOX/Trash" doesn't exist at server, and if "Show only subscribed folder" mode.
-  Tb requests "delete of INBOX/Trash" and "unsubscribe of INBOX/Trash" to server when you request "delete INBOX/Trash".
   And server returns "INBOX/Trash doesn't exist" to "delete of INBOX/Trash" request from Tb.
   This is normal phenomenon when garbage of "subscribed state of non-existent Mbox" remained at server.
   In this case, "subscribed state of non-existent Mbox at server" should be cleared at server first.
   "A way to clear such state using Tb" is already available : unsubscribe the INBOX/Trash. 

Anyway, check namespace in Server Settings/Advanced, and get IMAP log, and check capability response, namespace response, LSUB response etc. by yourself, please.

By the way, this bug is for following issue, as stated in bug summary.
   No namespace is used, so mail.server.server[n].trash_folder_name = Trash means "root level Trash".
   Even so, and even though root level Trash exists, if Inbox/Trash exists too, Tb uses Inbox/Trash as trash folder in Tb.
   This may occur when non-existent Inbox/Trash has garbage of subscribed state at server.
   "Try to use Inbox/Trash or Inbox.Trash" is perhaps for namespace support.
   However, it shouldn't disturb no namespace case.
If your problem is namespace relevant problem, please open separate bug.
Comment to avoid future confusion by bug readers.

(In reply to Kent James (:rkent) from comment #23)
> I tried setting the trash folder back to the original account/Inbox/Trash 
> Now on restart, new folder account/Inbox/INBOX/Trash is created, and still trash messages are lost.
(In reply to Kent James (:rkent) from comment #24)
> When I reset manually the preference, for example: mail.server.server10.trash_folder_name
> then move on delete started to work again, going correctly to the default trash folder Inbox/Trash

It's symptom of bug 491424 when namespace="Inbox." .or "Inbox/" is used. It's not this bug.
Summary: Two Trash folders: "Move mail to Trash" does NOT work. (if Inbox.Trash also exists, Tb misuses Inbox.Trash) → Two Trash folders: "Move mail to Trash" does NOT work. (even though namespace is not used, if Inbox.Trash also exists, Tb misuses Inbox.Trash)
(In reply to WADA from comment #28)
> If personal namespace="INBOX."(note: path delimiter is dot, intead of
> slash), some issues may occur.

In respect of my comment #27, the Personal Namespace setting in my case is empty ("" shows in Server Settings>Advanced>Personal Namespace)

> By the way, this bug is for following issue, as stated in bug summary.
>    No namespace is used, so mail.server.server[n].trash_folder_name = Trash
> means "root level Trash".

Yes.  That's my issue.
Severity: normal → S3
Duplicate of this bug: 1080591
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: