20210419: This looks promising, and it is what I’ve done today.
20190129: This process ended up having many issues, opted for gyb instead.
Steps
- Connect to account via Thunderbird IMAP
- To help see progress, configure TB server delete settings to
Just mark it as deleted
- In TB, open
All Mail
, Quick Filter byAttachment
, Sort byDate
- For one year at a time, one message at a time, select message, and save all attachments to a folder, then delete (not detach, using Delete causes TB to create a ~250 byte (Gmail still reads as 1K) attachment with
Deleted: [filename]
as the filename in place of the original larger attachment. This file can be opened in a text editor to reveal more info about the original attachment. This creates a duplicate email in Gmail to the one that had the original attachments. - In Gmail, turn off conversation view so that the next step only removes specific messages with attachments, not entire threads.
- Search for
has:attachment size:20k before:2010/1/1 -Deleted
to get a pretty close list of message threads that are the originals that had attachments. Delete or preTrash as you see fit. - Turn conversation view back on
- Delete IMAP account from TB so you can have a fresh start next time.
ISSUES
Some labels may be lost. Message with replaced Attachments will not be in-thread as original was. Thunderbird doesn’t think messages with inline’d images are “attachments”, but Gmail does