From MozillaZine Knowledge Base
popstate.dat is a file in the Mail folder of a POP account. It stores the state of messages that Thunderbird has downloaded and left on the POP server.
The purpose of popstate.dat
The file records the information that Thunderbird needs to implement the following choices in your account settings for the POP server:
Messages that are downloaded as headers-only are known as truncated messages.
The file is designed to be used by Thunderbird internally, not for users to edit. Even so, you can edit or delete the file to achieve certain results:
To find the file, open Thunderbird's Account Settings. Go to the account that you want to work with, then to that account's Server Settings page. Look at the Local Directory field (at the bottom of the window pane, next to a browse button) to see the location of the popstate.dat file for the account. Use Windows Explorer (or your operating systems equivalent) to go to that directory.
If the Local Directory setting is not visible see Dialog too small or too large
If you delete the file, then Thunderbird has no record of messages that it has downloaded. Normally you only do this if the file is corrupted and you keep getting duplicate messages when checking for new mail. The downside is the next time you get mail for the account, Thunderbird will download all the messages on the server (one last time). You could avoid downloading the messages again if you edited each messages status in popstate.dat but that usually is more work than its worth.
If you are using Windows 7 rather than deleting a corrupt popstate.dat file see if you can restore a recent version of it. That would download far fewer messages than if you delete the file. If you're not using Windows 7 see if you have a recent backup of your profile. You could copy that popstate.dat file over the existing one.
Hacking popstate.dat (Advanced)
Before you hack the file, ensure that Thunderbird is not in the process of getting mail for the account, and that it will not automatically get mail for the account after a certain time interval. You might need to change your account settings to make sure of this.
You do not need to close Thunderbird, but you can if you prefer.
To hack the file, first identify the messages that you want to change (unless you want to change all the messages). Then find the right file for the account, edit it and save it. Immediately get mail for the account to make your changes take effect.
The following sections describe these steps in more detail.
The file identifies a state for each message that Thunderbird has downloaded and left on the POP server. Each state specifies what Thunderbird will do with the message the next time it gets mail from the POP server. The states are:
When a message does not appear in the file at all, then its state is unspecified. This normally means that the message has been downloaded and deleted from the POP server. However, if you remove a message from the file and it does exist on the server, then Thunderbird will download the message again.
You can change the message states manually, as described in the next section.
Note: The file also contains a time stamp for each message, in a numeric format. Thunderbird uses the time stamp to decide when to delete old messages from the server, if you have specified that in the account settings.
Identifying messages to act on
To identify a message manually:
Example: The message headers look like this:
From - Mon Jan 01 09:00:00 2007 X-Account-Key: account10 X-UIDL: APaxktkAACMqRZj0Jw8jZjL3J7E X-Mozilla-Status: 0401 X-Mozilla-Status2: 00000000
You note the value APaxktkAACMqRZj0Jw8jZjL3J7E (but in most cases you only need to note the last few characters: ...3J7E
You can edit the file using any text editor. Ensure that the editor you use saves the file as plain text, not in any wordprocessing format.
You do not need to exit Thunderbird before editing this file.
Here are some techniques that you can use:
After you edit the file, save it and immediately get mail for the account. Thunderbird processes the actions that you have specified.