Closed Bug 1504831 Opened 6 years ago Closed 2 years ago

Empty Trash on exit broke ( imap)

Categories

(MailNews Core :: Networking: IMAP, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1745205

People

(Reporter: sj.vegetto, Unassigned)

Details

Attachments

(1 file)

116.75 KB, application/octet-stream
Details
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:63.0) Gecko/20100101 Firefox/63.0

Steps to reproduce:

Gmail
AOL
Outlook

All set to imap all set to expunge and empty trash on exit.


Actual results:

Upon restart of TB trash is still in trash folders


Expected results:

Trash should be empty
Component: Untriaged → Networking: IMAP
Product: Thunderbird → MailNews Core
Works for me with an IMAP provider that is not Gmail, AOL, Outlook. It only appears to be working if you have the "When I delete a message ... Move it to this folder: Trash" option selected. Only then does the folder show the trash icon.
I have Move it to this folder : "trash" and I want it to EMPTY the  trash folders on exit which it is not doing.

It not empty trash on exit for anything, and this is on new profile. IF i manual pick empty trash on them it works, but the auto empty on exit is not
Works for me with gmail and non-gmail accounts. Haven't tried AOL or Outlook yet. 

I assume your gmail trash is located like this under non-selectable (gray) folder [Gmail]:

Inbox
[Gmail]
  Trash

And you have that Trash folder configured in TB as the trash destination folder. If so, you should see a "trash can" icon by Trash and not just the standard folder icon.
Also, I assume you have set this for all 3 accounts since "empty trash on exit" is not a "global" setting but is account/server specific. 

And one more remote possibility: When you restart tb, check to make sure "empty on exit" is still set for all 3 accounts. Then put something in each account's trash and shutdown tb and restart. (Maybe you have to restart tb before this setting takes effect for you, although it worked without a restart for me.)
yes it is, and there is trash can icon next to all folder, the setting sticks. upon restarting, I have tried unchecking them all too to see if settings are reversed 

TB is even saying emptying trash before it exits and closes, but does not actual empty it on exit as they are still there upon restart soon as I right click on the trash can  and pick empty trash it empties it.

for TB  beta change log I seeing a fix for 
"Mails won't get removed from Trash folder using Maildir. Note: Other deletion issues related to Maildir still persist.?"

I wonder if that is why
Maildir is probably why. I think maildir still has some problems but I think they are being addressed, but not sure.

Are you saying you are using the non-default Maildir storage?
I dont know  it say fill per folder (mbox)for message storage  for gmail,aim,outlook

I have not change defualts of anything,
You should be OK unless you did something the choose maildir and it appears you are using mbox which is the default.

All I know to do is for you to record and attach an imap log. You can find how to here:

https://wiki.mozilla.org/MailNews:Logging

Specifically this, do this as described for windows:

set NSPR_LOG_MODULES=IMAP:5,timestamp
set NSPR_LOG_FILE=%USERPROFILE%\Desktop\imap.log
"%ProgramFiles(x86)%\Mozilla Thunderbird\thunderbird.exe"d

This should work for any tb version but if you are using a beta later than 52 or release 60 or later this will work:

set MOZ_LOG=IMAP:5,timestamp
set MOZ_LOG_FILE=%USERPROFILE%\Desktop\imap.log
"%ProgramFiles(x86)%\Mozilla Thunderbird\thunderbird.exe"

Use these commands (or a batch file containing them) to run tb. Put something in trash and then shutdown tb. Find and attach the imap.log file, no need to zip it.
I delete the accounts and change it to MailDIR which fix that, they all now delete trash on exit, but that cause diffrent issue.

I use unified Folders view and now clicking on (trash) not the the gmial/aim/outlook trash folders no longer show trash the main folder should show trash from all account but it no longer does. I will switch back Mbox and see if does it again if so i will grab that.

All i know is when Trash is empty on exit there usual few seconds delay before closes cause it deleting trash, but  when it was not deleting trash on exit, it close TB instantly
You can see if the account is using mbox or maildir in the account settings -> account -> server settings .
So tell us which one is not working.
Mbox isnt working, MailDir works I delete the accounts and switch them back forth between the 2 few times

each time it was Mbox is stopped empty trash folders of imap emailed. and pretty much exited TB instantly

each time it was Maildir it started empty trash folders of imap emialed on exit again. and it had it few second delay (1-3 second) it always had when it was empty trash folders on exit, that delay has been thing only on windows 10 win 7 never had that delay but ans empy trash on exit was working.

Another thing I had the same profile of TB for like 5+ years it was always Mbox then, then all of sudden TB stop empty trash on exit for those imap emails, so deleted the profile and made new one just to find out it still happens I not  sure which  verison it started with it start happen for the last 2 months?. before that imap was empty on exit with mbox.

Now Maildir account only one that works
Reporter, Since I am unable to duplicate the problem, please create and attach the imap.log that was requested in Comment 8 above. Please use maildir profile for recording the log since that is what you say is not working. Thanks.
(In reply to gene smith from comment #12)

Sorry, CORRECTION below, MBOX is not working so make the log with that profile.

> Please use
> MBOX (not maildir) profile for recording the log since that is what you say is not
> working. Thanks.
arg, this is aggravating I back up my profiles before I went to do this.

I then deleted all the account and switched back to MBOX, for outlook/gmail/aim have it set to  expunge on exit and empty trash on exit.

And now it seem to be working correctly. I made bat too to get this log and i find no log either, Im gona try one last thing to see if it starts happen again. Maybe it unified folder or folder view in TB that isnt geting updated correctly? cause as now when I close it they get emptied according to the GMAIL webbrowser views
> "%ProgramFiles(x86)%\Mozilla Thunderbird\thunderbird.exe"d

Just notice a typo (a 'd' at end that shouldn't be there) in case this might be why you see no imap.log on desktop (but probably tb wouldn't run with this).

You have to user the NSPR_* env. vars if your release is below 60. If 60 (or later) you can use MOZ_* env vars. This can cause no log file to appear. Check the logging web page for details. 
https://wiki.mozilla.org/MailNews:Logging

Anyhow, maybe if you go back to saved profile you will see the problem again?
sigh yah I am annoyed right now it seem to be working correct now maybe TB isnt update the trash folder  correctly some times, but open and closing it seem to fix it atm.

For now I gona leave the MBOX account and see what happens, only thing changed is Windows 10 had some update goe threw yesterday, maybe they have something to do with it.

Im keep an eye on for few days and see what happen it starts again I will try grab a log again



set MOZ_LOG=IMAP:5,timestamp
set MOZ_LOG_FILE=%USERPROFILE%\Desktop\imap.log
"%ProgramFiles(x86)%\Mozilla Thunderbird\thunderbird.exe"

using that in .bat
Hard to know why it is not failing now. Yes, if you see it again the log will help us to see why it fails. 

The .bat you have set up will only create the log with tb version 6x, as I mentioned, so I assume you are running the new v60.x.

sorry for the really reopen it this but I notice it still happen, so ran the bat.

Did notice the follow though Manaul click empty trash will emtpy letting TB automaticly does not empty, not IF i put it in the trash then move it back to it original folder then delete again TB will EMpty the trash on exit

Attached file imap.log

For the record I have Redone my profile again I am using Mbox, both empty trash and expunged is check for all account. Only thing I change since noticed this is I changed retention policy on all the trash folders to delete after 1 which wont know if it working that way and wont for atlest 24 hours.

OCD about things is horrid thing

OK so setting the Retention policy for each Trash for Each imap account to 1 day, will DELETE the Trash every day. but Expunge/Empty trash on exit, for each imap account does not empty the trash on exit. Maunal click empty trash will.

This is work around for issue of trash on imap account not being emptied on exit. I Prefer to have the empty/expunge on exit work but this will do for now.

IF need more info let me know.

This version 68.5 which i would assume is in the log i uploaded

I tested this again with gmail and a non-gmail account. I found you have to be careful with what you put in Trash folder since some accounts quickly expunge messages older than, say, 2 weeks. So in the log you don't see tb deleting the messages in Trash on shutdown since they are auto-deleted by the server. When I put only young messages in trash and shutdown tb, the messages are deleted by tb correctly right before shutdown. This is true for gmail and non-gmail accounts and I verified this using imap log.

Also, on restart of tb it may appear that there are messages still in Trash even though you have the account's trash set to delete on tb shutdown. Then when you click on Trash the messages seem to be removed only then. This is because on startup tb doesn't usually automatically make a connection to the Trash mailbox folder so the Trash folder is not "synchronized" with the server until you click on it. (It will auto-connect to Trash if you shutdown tb selected on Trash.) So the messages in Trash were actually deleted on the previous shutdown or auto-expunged by the server due to old age and appear to only go away when you click the Trash folder.

In your log I see a message moved from Sent to gmail Trash. However, I don't see it deleted from trash in the log anywhere like it should if you have "empty trash on shutdown" selected. So I'm tempted to call this INVALID but not sure, even though I can't duplicate it. What were you doing when you recorded the log -- the more details the better.
P/S: I didn't set retention policy to any non-default with my tests. Could you set it back to default and check again if your trash deletes on shutdown and maybe record and attach a log again? Thanks.

One more thing: You should see a lines like this in the log when tb empties the Trash folder for each account. However, it only does this after imap selecting the Trash folder and the "EXISTS" count is non-zero:
[3151:Unnamed thread 0x7821090cf040]: I/IMAP 0x782101563800:mobile.charter.net:S-Trash:SendData: 9 store 1:* +FLAGS.SILENT (\Deleted)
[3151:Unnamed thread 0x7821090cf040]: I/IMAP 0x782101563800:mobile.charter.net:S-Trash:SendData: 10 expunge

sj.vegetto,
Does this also fail for you on a non-gmail account?

Flags: needinfo?(sj.vegetto)

as far as i can tell it does to all account and there all imap, I have since just setup TB to purger trash ever 24h which does work, but not the purge on exit

Flags: needinfo?(sj.vegetto)

I'm marking this as a duplicate of Bug 1745205 even though I (and also Wayne at Bug 1745205 comment 6) were unable to duplicate this on gmail.
I think the reason we are unable to duplicate is because Observe() is not called for gmail so the password is never forgotten (unlike for yahoo which also uses oauth2). See Bug 1745205 comment 41 for more details on Observe() and how it "forgets" the password, possibly unnecessarily.

Status: UNCONFIRMED → RESOLVED
Closed: 2 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: