Created attachment 704299
Test extention : Change arbitary IMAP folder to trashFolderName folder and 
SpecialUse=Trash folder by ToolBar button click

This test extension is for seeing Tb's behavior on "trash", and merely
does following when customized ToolBar button-1 is clicked.

(1) Puts currently selected folder name to incomingServer.trashFolderName
    if IMAP account. (call ABC/DEF for later reference)
(1-A) Use string in msgFolder.URI instead of msgFolder.prettiestName
    for setting incomingServer.trashFolderName, in case of localized special
    folder name by localized Tb.
(1-B) Remove personalNamespace from string set in msgFolder.prettiestName,
    because Tb's current logic which uses mail.server.serverN.trash_folder_name
    requests "Mbox name without namespace" in trash_folder_name setting.
Note: This test extension doesn't care about "IMAP server directory:" of Server 
Settings/Advanced.

By (1), Tb automatically updates mail.server.serverN.trash_folder_name and is 
automatically reflected to trash folder selection UI at Server Settings.
This works very well, as far as problem of bug 831664 is bypassed by operation 
like "write very long text to Error Console".

(2) Request msgFolder.setflag(Trash) for selected folder of ABC/DEF
    and msgFolder.clearflag(Trash) for all other folders under the IMAP account.
    (this is opposite action to DiscoveryDone().)

By (2), icon of selected folder of ABC/DEF is changed to trash-can-icon,
and trash-can-icon is removed from any other folder including
[Gmail]/[Trash] of Gmail IMAP.

Even when Gmail IMAP, folder of ABC/DEF is used by Tb as "trash for Tb"
when IMAP delete model of "Move to trash" and mails are moved to ABC/DEF
when delete is requested, until collapse/re-expand, subscribe,
unsubscribe etc. is executed,

When Gmail IMAP account is collapsed/re-expanded, following is observed.
  Upon re-expand, trash-can-icon is removed from ABC/DEF,
  and icon of [Gmail]/Trash is changed to trash-can-icon.
This is done by following.
> http://mxr.mozilla.org/comm-central/source/mail/base/content/folderPane.js#881
>  881       if (aExpandServer) {
>  882         if (folder.isServer)
>  883           folder.server.performExpand(msgWindow);
> http://mxr.mozilla.org/comm-central/source/mailnews/imap/src/nsImapIncomingServer.cpp#941
>  941 nsImapIncomingServer::PerformExpand(nsIMsgWindow *aMsgWindow)
>  962   rv = imapService->DiscoverAllFolders(rootMsgFolder,
> http://mxr.mozilla.org/comm-central/source/mailnews/imap/src/nsImapService.cpp#1811
>  1811 NS_IMETHODIMP nsImapService::DiscoverAllFolders(nsIMsgFolder 
> *aImapMailFolder,
>  1834       urlSpec.Append("/discoverallboxes");
>  1838         rv = GetImapConnectionAndLoadUrl(imapUrl, nullptr, aURL);
After completion of the discoverallboxes request,
> http://mxr.mozilla.org/comm-central/source/mailnews/imap/src/nsImapIncomingServer.cpp#2331
>  2331 nsImapIncomingServer::OnStopRunningUrl(nsIURI *url, nsresult exitCode)
>  2350     case nsIImapUrl::nsImapDiscoverAllBoxesUrl:
>  2351       if (NS_SUCCEEDED(exitCode))
>  2352         DiscoveryDone();

Test result of (1) indicates possible new/easy trash selection for user,
  Context menu of "Use this folder as Trash".
although it's perhaps merely wasting of valuable context menu space.
Because this works only on existent folder, this way can do noting for 
"automatic folder creation of trash which is set in 
mail.server.serverN.trash_folder_name or default of it(==Trash)".

Because "trash for Tb" can be set by the test extension even when IMAP delete 
model of "Just mark it as deleted" or "Remove immediately", "Empty Trash after 
copy/move mail to [Gmail]/Trash for immediate/permanent removal of mails" is 
possible, even with "Just mark it as deleted" or "Remove immediately".
Because Tb currently doesn't change SpecialUse=Trash setting of any folder if 
"Just mark it as deleted" or "Remove immediately", this works even with Gmail 
IMAP and current Tb.

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to thunderbird in Ubuntu.
https://bugs.launchpad.net/bugs/885525

Title:
  Deleting a Gmail Message Always Sends Item to [Gmail]/Trash

Status in Mozilla Thunderbird Mail and News:
  Confirmed
Status in “thunderbird” package in Ubuntu:
  New

Bug description:
  Thunderbird 7.0.1, Ubuntu 11.10

  Gmail accounts do not obey the setting in Account Settings -->
  [Account] --> Server Settings --> When I delete a message

  I changed this to move the message to Gmail's "All Mail" folder,
  attempting to imitate the Gmail web interface's "Archive" option.
  However, regardless of setting, the item always moved to Trash. This
  persisted after restart of the client. The settings save, but have no
  effect.

  Caveat: This was tested on two Google Apps for Domains accounts,
  though I suspect this behavior will happen with gmail.com accounts as
  well.

To manage notifications about this bug go to:
https://bugs.launchpad.net/thunderbird/+bug/885525/+subscriptions

-- 
Mailing list: https://launchpad.net/~desktop-packages
Post to     : desktop-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~desktop-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to