Three times in the last few days Thunderbird redownloaded old or deleted emails into my inbox.
The suggested remedies on line appear to be out of date as they suggest compacting folders, etc., by right-clicking on the folder name, but no compact option so appears.
Additional System Details
- User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:58.0) Gecko/20100101 Firefox/58.0
Real folders have compact options. Virtual folders such as those used in the unified folder view) do not
If you do not have the main menu bar at the top visible press F10 to make it temporarily appear so you can use it.
Use the View menu to select folder and then all. Now you will have a compact menu. you will also see if the issue is the actual mail folders or the virtual folders as the real folders may not demonstrate the issue.
Using your instructions I compacted my Real Folders, but after shutting down my computer last night and re-starting it this morning, alas, Thunderbird had reloaded some 431 old emails back into my inbox. So compacting didn't solve the problem.