This site will have limited functionality while we undergo maintenance to improve your experience. If an article doesn't solve your issue and you want to ask a question, we have our support community waiting to help you at @FirefoxSupport on Twitter and/r/firefox on Reddit.

Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

How to make shift-delete actually delete (expunge) and not just mark as deleted?

  • 14 replies
  • 1 has this problem
  • 3 views
  • Last reply by Toad-Hall

more options

For IMAP servers, the default action of Thunderbird's shift-delete is to bypass Trash and mark the message as deleted on the server. Thunderbird then does not show messages that are marked as deleted. This is fine if you are only using Thunderbird because the emails don't appear in Trash and don't appear in the folder they were deleted from.

However, if you are using other mail clients eg Outlook Mobile, Samsung Email client, webmail, these mail clients do not seem to recognise the "marked as deleted" attribute (whatever that is) and they still show the email. So if I shift-delete a mail in Thunderbird these other clients still show the email plus I do not actually save any disk space.

In Thunderbird if I just delete an email (not shift-delete) then the mail is moved to Trash and is actually no longer in the original folder. It is not just marked as deleted from the original folder, it is actually gone. So these other mail clients, also can no longer see the mail.

How can I get Thunderbird to actually delete a mail when I use shift-delete instead of just marking it as deleted? I don't want to have to wait till I exit Thunderbird.

I have tried setting mail.imap.expunge_after_delete to true and mail.imap.expunge_option to 1 but these seem to have no effect

For IMAP servers, the default action of Thunderbird's shift-delete is to bypass Trash and mark the message as deleted on the server. Thunderbird then does not show messages that are marked as deleted. This is fine if you are only using Thunderbird because the emails don't appear in Trash and don't appear in the folder they were deleted from. However, if you are using other mail clients eg Outlook Mobile, Samsung Email client, webmail, these mail clients do not seem to recognise the "marked as deleted" attribute (whatever that is) and they still show the email. So if I shift-delete a mail in Thunderbird these other clients still show the email plus I do not actually save any disk space. In Thunderbird if I just delete an email (not shift-delete) then the mail is moved to Trash and is actually no longer in the original folder. It is not just marked as deleted from the original folder, it is actually gone. So these other mail clients, also can no longer see the mail. How can I get Thunderbird to actually delete a mail when I use shift-delete instead of just marking it as deleted? I don't want to have to wait till I exit Thunderbird. I have tried setting mail.imap.expunge_after_delete to true and mail.imap.expunge_option to 1 but these seem to have no effect

Modified by mjurgens_firefox

All Replies (14)

more options

re :In Thunderbird if I just delete an email (not shift-delete) then the mail is moved to Trash and is actually no longer in the original folder. It is not just marked as deleted from the original folder, it is actually gone. So these other mail clients, also can no longer see the mail.

I'm assuming you are talking about an IMAP mail account and all the other accounts are also accessing same account/email address using Imap. So whilst the email is no longer displayed in the imap Inbox, it will be displayed in the imap 'Trash' folder - that is assuming you are sending it to that account imap Trash folder.

You can select the Trash folder to force a synch with server.

One setting you may want to check:

  • Right click on imap Trash folder and select 'Properties'
  • Select checkbox 'When getting new messages for this account, always check this folder'

Other imap accounts will see the same at this point if they synchronise folders /select the Trash or have the above setting selected. If they are not setting up the Trash to check for new mails put into it - this might be causing you the problem.

In Account Settings > Server Settings If you select 'Clean up (Expunge) Inbox on exit' this compacts the Inbox removing all traces of previously moved emails. When you select to move or delete an email, it is moved to respective folder. In reality, the original copy of email is still in the 'Inbox', but now it is hidden from view and has been marked as deleted from that folder because you put it somewhere else. The expunge means compact, so all those remaining traces of emails you have moved out of Inbox get properly removed from the mbox file and it is cleaned up. This means it is not larger than it needs to be and is less prone to risk of corruption. This is good housekeeping practise as you need that Inbox to be in the best condition.

If you select checkbox 'Empty Deleted folder on Exit', then the Trash will get emptied when you exit Thunderbird. As all emails are saved on the server and all imap folders synchronise with server folders, then the Trash folder on server will get emptied. So no other imap accounts accessing same account will see contents of Trash because they do not exist - you deleted email and then cleared it off server. This may not be desirable.

If you select to delete and by pass the Trash, (Shift+Del) then you deleted it and removed it off server, so no one else using other imap access will see it as it does not exist.

If other people are accessing the imap account then Shift+Del may not be a desirable action to be used by anyone accessing that same imap account.

However, that depends upon the server....If using eg: Gmail who store all the emails in one 'All Mail' folder, the 'Shift+Del' option would by-pass the server gmail Trash folder. So gmail would understand that to mean only delete the label not the actual email. The email would not get put into Trash and would not get deleted off server when gmail auto empty the Trash. The email would become 'Archived' and remain in the 'All Mail' folder.

more options

re :So if I shift-delete a mail in Thunderbird these other clients still show the email

Please note for eg Outlook Mobile, Samsung Email client: if you are accessing the server using POP and keeping copies on server, then you will not be seeing the server folders, so all of these will need to use imap as well.

Modified by Toad-Hall

more options

Thanks for replying but most of your responses do not apply. In fact, you appear to have skimmed my message looking for keys words or something and not even read my message for meaning.

You claim that "If you select to delete and by pass the Trash, (Shift+Del) then you deleted it and removed it off server, so no one else using other imap access will see it as it does not exist." - This is clearly incorrect and I wish this was true. Shift-delete marks the message as deleted and does not delete the message and it is visible by other mail clients.

  • Trash folder has nothing to do with this since Shift-delete bypasses the Trash
  • I already said that I did not want to wait till I exit Thunderbird
  • POP has nothing to do with this as I said this was IMAP
more options

Have you selected Expunge on exit in account settings and then occasionally actually exit Thunderbird?

You might also want to look at the options to remove it immediately under Deletion in server settings. Then you will not need to use Shift at all.

more options

re: In Thunderbird if I just delete an email (not shift-delete) then the mail is moved to Trash

Based on statement, I presumed the option: 'Move it to this folder' and imap Trash was selected.

You said: In Thunderbird if I just delete an email (not shift-delete) then the mail is moved to Trash and is actually no longer in the original folder. It is not just marked as deleted from the original folder, it is actually gone. So these other mail clients, also can no longer see the mail.

Assuming you have the setting to expunge Inbox and empty trash on exit. It would disappear from server Trash after you had exited Thunderbird. At this point other email clients will not see it. However, if they are using imap then they should see it in the imap Trash providing you had not exited Thunderbird. However, those other imap clients may need to have the TRash folder checking for new mail as previously mentioed.

If you deleted an email from Inbox using the 'Shift+Del' to by-pass Trash, compact the Inbox folder to force an update to the server. Then it should remove off server when folder synchronises without waiting for an exit.

  • Right click on Inbox and select Compact'.

Modified by Toad-Hall

more options

I mentioned the weird thing that gmail does - if you Shift+Del thus bypassing Trash, the email does not get deleted, it just has a label removed. So email is still on server in 'All Mail'.

I do not know if you use gmail or whether you are using a server that operates using a gmail style. You have not supplied any information regarding this. But it is entirely possible to delete an email using Shift+Del which removes it from the imap account in your version of Thunderbird, but it will not delete off the server. It just has the 'Inbox' label removed. If other email clients see 'All Mail' then they will still see the email, but it is no longer visible in Inbox.

more options

I appreciate people trying to contribute here with ideas etc. I think the fundamental problem here is that Thunderbird will not Expunge the messages until exit, even though there are settings to enable this per-message behaviour. The settings are just ignored/there is a bug/they are not actually implemented.

Yes, it should work on a per message basis but it just doesn't

more options

perhaps you could enlighten us as to what mail server you are observing your special issue on?

Then perhaps you might file a bug if you are sure you have found one. But you will need to be able to provider steps to reproduce your issue that a developers can follow to actually see it in action. https://bugzilla.mozilla.org/

There is also a preference that can be accessed for the config editor that sets the number of deleted messages that should occur before an expunge is called. mail.imap.expunge_threshold_number which defaults to 20. You might want to try reducing that number and putting up with the increased network overheads.

more options

mjurgens_firefox said

I appreciate people trying to contribute here with ideas etc. I think the fundamental problem here is that Thunderbird will not Expunge the messages until exit, even though there are settings to enable this per-message behaviour. The settings are just ignored/there is a bug/they are not actually implemented. Yes, it should work on a per message basis but it just doesn't

Are you saying you did this: In Thunderbird - you used 'Shift+Del' to delete an email from Inbox and then right clicked on Inbox and selected 'Compact'. Then you logged on to the 'webmail' account accessed via a browser or if already logged on - you refreshed the page to force update and you could still see the email in the Inbox ? Do not test with phone - you have to check the webmail account.

This is a test we need you to perform, it is a very specific method, so please follow it and post results.

more options

Matt said

perhaps you could enlighten us as to what mail server you are observing your special issue on? Then perhaps you might file a bug if you are sure you have found one. But you will need to be able to provider steps to reproduce your issue that a developers can follow to actually see it in action. https://bugzilla.mozilla.org/ There is also a preference that can be accessed for the config editor that sets the number of deleted messages that should occur before an expunge is called. mail.imap.expunge_threshold_number which defaults to 20. You might want to try reducing that number and putting up with the increased network overheads.

The mail server is Dovecot. I think you'll find that this is not a special issue. There is already a bug (https://bugzilla.mozilla.org/show_bug.cgi?id=370509) that is 16 years old for this issue. Those config editor settings do not work.

more options

Matt said

perhaps you could enlighten us as to what mail server you are observing your special issue on? Then perhaps you might file a bug if you are sure you have found one. But you will need to be able to provider steps to reproduce your issue that a developers can follow to actually see it in action. https://bugzilla.mozilla.org/ There is also a preference that can be accessed for the config editor that sets the number of deleted messages that should occur before an expunge is called. mail.imap.expunge_threshold_number which defaults to 20. You might want to try reducing that number and putting up with the increased network overheads.

The mail server is Dovecot. I think you'll find that this is not a special issue. There is already a bug that is 16 years old for this issue. Those config editor settings do not work - I have tried them all already

more options

re :Those config editor settings do not work - I have tried them all already

Setting a lower threshold before compacting does work, but is it enabled ?

Menu app icon > Preferences > General Scroll down to 'Disk Space' section Select the checkbox 'Compact all folders when it will save over' Enter a low MB - 20 has been suggested but you can set lower. If you want to be asked if ok to compact now then select checkbox 'Ask every time before compacting' so you can temporarilly pause until compacting is complete. Then restart Thunderbird to ensure all settings are saved and used.

more options

Toad-Hall said

Scroll down to 'Disk Space' section Select the checkbox 'Compact all folders when it will save over' Enter a low MB - 20 has been suggested but you can set lower. If you want to be asked if ok to compact now then select checkbox 'Ask every time before compacting' so you can temporarilly pause until compacting is complete. Then restart Thunderbird to ensure all settings are saved and used.

This is a work around at best. I had mine set to trigger at the default value of 20MB and interestingly when I compacted my folders manually it saved 3.5GB. No idea why it had apparently never been automatically been triggered. I run Maildir format (file per message) so maybe that's it. Plus emails might only be a few kb is size so even at the lowest setting of 1MB it may take hundreds of messages to trigger. What's the bet that there is code that goes something like - if Maildir then ignore auto compact?

There is conflicting documentation on compact. If you read https://support.mozilla.org/en-US/kb/compacting-folders then you'd think that it would not apply to Maildir format. However, this is not quite true since this is what I found:

- Receive new mail - Mail visible in all clients - Shift-delete the message - Message not visible in TB. File in file system gone. Still referenced in the .msf file for the folder. Message still visible on the server to other mail clients. Message not deleted from server. - Compact run. - Message not visible in TB. File in file system gone. No longer referenced in the .msf file for the folder. Message not visible on the server to other mail clients. Message deleted from server.

So it would appear that there are two manually workarounds: 1) Restart TB. This is 2 clicks plus some possible waiting time in-between 3) From the TB Menu (if displayed): File -> Compact. This is 2 clicks. It seems to run a multi-folder compact but the list of folders that it compacts seems to vary depending on what is selected (Not sure exactly). Seems pretty quick to complete if a unified Inbox folder is selected but a lot slower if just the specific Inbox is selected. 3) Install the Xpunge add-on. Set up the Multi-xpunge button on your mail toolbar in TB. Configure the add-on only to compact folders in accounts of interest. Once set up this is a single click but the downside is that this runs a full compact on all folders and can be a little slow. Make sure that you deselect Xpunge from deleting your trash and junk unless you want it to delete them

Note) I originally thought that using the Compact button on your mail toolbar in TB was a work around but that is cumbersome as it requires you to select the specific folder and then press it. It appears to only compact that single folder. You cannot select a unified folder.

The real fix remains resolution of https://bugzilla.mozilla.org/show_bug.cgi?id=370509

Modified by mjurgens_firefox

more options