I used to use a Thunderbird addon to remove duplicate messages in Thunderbird. This is handy if your mail client becomes “de synced” from your mail server, whether it be an IMAP or POP3 connection. Also this can occur if you restore a backup or import mails and it creates duplicates.
However, after Thunderbird 2.0 was released, this old plugin was not compatible. Eyalroz re-released the plugin under GPL and with updates for Thunderbird 2.0. If you have a need to remove duplicate emails – this is the plugin you need! Get it: