Can one delete a Gmail attachment but keep the email? – Web Applications Stack Exchange

(2022 update on edition below)

a chrome extension was said to do this, but it wasn’t clear to me (didn’t find the answer on their website) if the content and attachments of our emails, i.e. our personal data, transit to through the servers of this third-party company. or not when using it. Since it could be potentially dangerous to open our data to a third party company, I never used it.

As mentioned in @igorischuk’s answer, it is possible to remove attachments in emails (and keep the original text) by enabling imap in gmail + thunderbird, but the workflow is quite long.

so, here’s a detailed workflow explaining how to bulk delete attachments for, say, all emails in your gmail that are > 1mb. in my case I had ~1050 of those emails.

  1. first enable imap in gmail settings. also create a gmail tag called bigattachments and set it to be visible from imap.

    install thunderbird (tested with thunderbird 60.5.0.exe setup) and setup gmail account.

    in thunderbird, go to all mail, right click the columns and enable column size display. click the size column header to sort all your emails by size. then select all emails that have a size > 1mb, and move them (by dragging and dropping) to the bigattachments folder.

    now create a local folder in thunderbird called temp. drag and drop to copy all emails from bigattachments (imap, on a distant server) to temp (local). this step can take a long time depending on the size of the data to be downloaded.

    then install the plugin attachment extractor (continued) (the original plugin attachment extractor no longer works in thunderbird 60).

    now select all the emails in the local temporary folder. right click, select “extract attachments”, select a destination path for the attachments. Wait. Please check carefully that attachments are removed from emails (you can check the size column) and that they are also saved to the destination path.

    now go to the gmail web (https://mail.google.com/mail), go to settings, temporarily switch to conversation mode and save the settings. go to the bigattachments tab. check that the number of emails here is equal to the number of emails you processed in thunderbird. (Note: If you don’t turn off conversation mode, you won’t be able to see the correct email count, you’ll get a conversation count.) now delete all these emails in the large attachments tag. this is scary the first time, but it works. wait few minutes refresh gmail web and enjoy 5gb change from 15gb used to 1gb used 🙂

    return to thunderbird. select all emails in the local temporary folder. drag and drop them onto the bigattachments (imap) tag. wait for it to upload.

    That’s it! you can check on gmail web that the large attachments contain the same emails, but with the attachments removed. now you can do the cleanup: a) remove this tag from large attachments (removing a tag does not delete your emails), b) switch back to conversation view on, c) delete thunderbird temporary local folder or even delete thunderbird.

    notes:

    • for me, the attachment extractor continued to work for normal attachments, but not for “inline images” (even if I checked to also extract embedded ‘inline’ images), maybe this function is not working yet. If you have a solution for this, please post a comment.

      why copy the emails to a local temp folder, extract the attachments there, delete the original emails in gmail and move the content from temp to gmail? this seems unnecessarily complicated, and we might think “let’s apply the attachment extractor below directly to the bigattachments imap folder”! short answer: the latter doesn’t work, already tested! this is due to a thunderbird bug.

      If you only have a few emails to process (less than 10), there is no need to install the additional attachment extractor (continued). you can skip steps 5 and 6, and just click on each email in the temporary folder and click on the bottom right of the screen (can’t remember the name of this option, maybe it’s in more…), you have a separation feature. the only drawback is that this cannot be done for multiple emails at the same time.

      don’t forget to enable “remove message attachment” in tools > additional options > attachment extractor menu. if not, attachments will not be removed from emails. i don’t know which of the 3 options is the best (normal thunderbird code vs. delete with ae internal routine vs. disconnect with ae internal routine, by the way, does anyone know what is the difference between the last 2: delete versus disconnect? ?), though.

      enter image description here

      update 2022-07-29

      1. only works with older specific versions of mozilla thunderbird and addedextractor (add-on for the former). thunderbird 68.9.0 downloads can be found here. attachment extractor 2.0.12 can be found here.
      2. enable imap in gmail settings.
      3. create a new tag called something like “attachments_to_remove”. if this is an infrequent administration task, you can remove this tag when you’re done.
      4. install thunderbird. when asked if you want to set up with a particular email, do so. follow everything related to passwords and authentication (needed my phone to confirm with google).
      5. very important! you have to stop tbird from automatically updating right away. the little devil will start trying to do it the moment you start it, so here are precise instructions: click on the hamburger icon (top right) -> options -> options -> advanced (icon at the bottom) -> “update” tab. check “check for updates but let me…” and uncheck “use a background service…”. it will still ask to update at least once, but will ignore (obviously).
      6. add the “attachmentextractor” plugin in tbird: hamburger icon (top right) -> plugins -> plugins gear icon -> install plugins from the file. browse to the file downloaded in step 1.
      7. “restart” when tbird asks if you want to do so.
      8. select (in tbird) the emails you want to process in the “folder” “inbox” (or any other “folder”, each representing a label in your account) under your account. if you want to see the size (data) of emails, for example, click the little icon on the far right (to the right of the “date” column) in tbird and check “size”. then you can, for example, sort by size, by clicking on the corresponding column. then select.
      9. create a local folder in the thunderbird app (right click “local folders”) called “temp”.
      10. drag and drop (in tbird) to copy the emails you have selected from “attachments_for_deletion” (this folder icon is on the distant server) to temp (local folder). this step can take a long time depending on the size of the data to be downloaded. there is no indication that things are happening. try a few emails initially until you are sure it works.
      11. select (in tbird) all emails in the local temp directory.
      12. right click and choose “extract ae from messages” -> “just delete the attachments…”. confirm (click ok when it says “are you sure?”)
      13. select all these emails in temp, and drag and drop them back into the “attachments_for_deletion” folder. this should take minimal time because your attachments are gone!
      14. select emails in “attachments_for_deletion” and return (drag and drop) them to account folders as appropriate. what you’re actually doing with this process is, for each message in question, removing the “attachments_to_delete” tag and adding the tag for the “subfolder” in question.
      15. done! now check your emails in your gmail web client. initial disappointment: attachments appear to still be there. but take a closer look: now they say “deleted: my_file_you_used_to_exist.doc”. if you click on the attachment icon, google will respond with a confusing message: “could not preview file…”
      See Also:  How It Works | Fun Rewards

Leave a Reply

Your email address will not be published. Required fields are marked *