# E-mail mystery



## mefizto (Mar 25, 2021)

Greetings all,

as per other thread, I needed a local copy of the provider's server for archiving.  Eventually, I settled on isync and downloaded the e-mail messages.  To my surprise, I found messages more than a year old that I distinctly remember as either deleting or sent automatically to a trash by a filter.  When I checked _via _the web interface these messages were not present.

Since the web interface does not show the total number of messages, I installed Thunderbird downloaded and counted the messages.  To my surprise, the number of messages reported by Thunderbird was order of magnitude less than the number of messages downloaded by isync, the messages in Thunderbird matching the messages of the web interface.

I considered a possible error, so I repeated the experiment with the same result (apart of the number of messages since some additional e-mail arrived in-between). 

Am I missing anything obvious? Anybody has an explanation?
Kindest regards,
M


----------



## msplsh (Mar 25, 2021)

Probably a function of UIDL lists on webmail and Thunderbird marking the message as deleted and then not deleting it (or often, forgetting to).


----------



## mefizto (Mar 25, 2021)

Hi msplsh,

thank you for the reply.

Since I had been using only the web interface, as I understand your reply, when I delete a message, the server marks is a deleted and does no longer show it, but it is not yet removed from the server.  So should the isync not ignore a message marked as deleted?  And if isync does not, why does a fresh installation of Thunderbird?  Perhaps a different implementation of the IMAP in the two applications?

Kindest regards,

M


----------



## msplsh (Mar 25, 2021)

Forgetting this is IMAP, the answer is probably that isync must be ignoring flags marking mail as deleted.


----------



## mefizto (Mar 25, 2021)

Hi msplsh,

thank you for the hint.  I can test that by moving e-mail to Trash and re-downloading with both applications.

Kindest regards,

M


----------



## SirDice (Mar 26, 2021)

The trash is just a folder where deleted emails get moved to. Empty your trash to really delete those messages.


----------



## Mjölnir (Mar 26, 2021)

Depending on which data format the mail software uses (_mbox_ or _maildir_), messages will not be deleted immediately, but only marked for deletion.  Then when a treshold of deleted messages in each _mbox_ has been reached, that _mbox_ gets copied message-by-message to a shadow copy, purging the marked entries.  That's why occasionally you see deleted messages when accessing a _mbox_ with another tool that does not use the same list of deleted entries.


----------



## usdmatt (Mar 26, 2021)

If you were using IMAP in the days of Outlook 2000/2003 or so, deleting messages back then would mark them as deleted, but continue to show them in red with a line through them. Bit of a pain as nobody liked it so you had to apply a filter to hide them. You actually had access to various account settings back then though and there was one called 'Purge messages when changing folders' that would clear them off the server when changing folders.

Think it was mainly an efficiency thing although it did mean you would often find that messages deleted years ago still exist. Even today deleting messages on IMAP is a bit of a mess. Most clients use a trash/deleted items folder, which would work well if they could all agree on how to use it. I'm sure clients like Outlook are intentionally hobbled these days to make their own cloud offering more appealing.

Obviously makes sense that an IMAP sync program would download these messages. Just as Outlook used to display them, these are just normal messages, marked in a similar way to any other flagged message.


----------



## Jose (Mar 26, 2021)

When is What ... Deleted, Expired, Expunged or Purged? — Cyrus IMAP 3.6.0 documentation


----------



## mefizto (Mar 26, 2021)

Greetings all,

thank you for all your replies; however, I still cannot find any relationship between them and what I observe through my two experiments yesterday.

I moved message into a Trash folder at the server _via _the web interface. Then I started Thunderbird, which showed the message in its local Trash folder and when I clicked on it, Thunderbird downloaded and displayed it. Isync just downloaded the message, but, interestingly it was not marked as deleted.

I then deleted the message from Trash folder at the server _via _the web interface.  Upon synchronizing Thunderbird, the message was no longer shown in the local Trash folder.  Isync again dutifully downloaded the message again not marked as deleted.

The Thunderbird's behavior seems consistent with your replies, the isync's does not.

I read my provider's policies, and as I understand it, they allow a certain time-window after I delete - and thus do not see the deleted messages i the Trash folder - to email them and they will recover the messages.  So, the best explanation I have is that Thunderbird cannot access these messages, but isync can.  It is still weird.

Kindest regards,

M


----------



## SirDice (Mar 26, 2021)

mefizto said:


> Upon synchronizing Thunderbird, the message was no longer shown in the local Trash folder.


Don't know the details on how Thunderbird handles this but it's possible it works the same, the email is still there (it was already sync'ed before) but marked as deleted and the interface just doesn't show it. The actual copy on disk might still exist until it's purged. The Trash folder is a folder like every other folder with IMAP. It's the client that gives this folder special meaning. Nothing is actually deleted (or marked), the email is just moved from INBOX to a "Trash" folder. Deleting it in the "Trash" folder will mark it as deleted. 

Thunderbird does allow different settings for it, have a look at the account preferences, server settings. There's an option to _move_ deleted mail to a "Trash" folder, mark it as deleted or remove it immediately.


----------



## mefizto (Mar 26, 2021)

Hi SirDice,

that is an interesting idea; I used Thunderbird with the defaults as installed, which is "Move to this folder : Trash on name@provider.com".  All the other ones are unchecked.

However, other idea occurred to me.  Could it be that Thunderbird does download all the messages as isync, just not display them?  Is there other tool to look at the Thunderbird's mailbox?

Kindest regards,

M


----------



## SirDice (Mar 26, 2021)

mefizto said:


> Could it be that Thunderbird does download all the messages as isync, just not display them?


That's certainly a possibility. 


mefizto said:


> Is there other tool to look at the Thunderbird's mailbox?








						Profiles - Where Thunderbird stores your messages and other user data | Thunderbird Help
					

Thunderbird saves personal information such as messages, passwords and user preferences in a set of files called a "profile".




					support.mozilla.org


----------



## mefizto (Mar 26, 2021)

Hi SirDice,

thank you.  Of course the:


> In the Application Basics section, Profile Folder, click on Open Folder.


does not work.  I have found the folders, but, no messages in trash.

Kindest regards,

M


----------



## SirDice (Mar 26, 2021)

Like I said, I don't know the specifics of the implementation of Thunderbird. It's also possible it's marked as deleted first, then purged when you close the application. Or it's purged as soon as you delete it. It does keep track of it because the marked as deleted message is still present on the server. So there has to be a mechanism that will prevent it from being downloaded to your local profile storage when Thunderbird connects to your IMAP mailbox again.


----------

