8

I'm on a list-serv that gets emails from crons for several hundred servers. The volume of emails is about 1G/week, so to keep from bumping up against my 15G disk quota, I have to delete messages periodically. I have a filter in Gmail that adds the label 'label:inbox-zbark' to these.

I use a search like this to find a week's worth of emails:

label:inbox-zbark before:2018/12/16 after:2018/12/09

Then I can select a week's worth of messages by using the 'select all' button (which chooses the 100 conversations on the current page), then clicking the 'Select all conversations that match this search' button. I click the delete button and confirm the bulk action.

The problem is that above about 1000 conversations (which may have 100 emails a piece) gmail will either refuse to delete messages, or will throw an oops error. I can usually delete conversations 100 at a time, but this is very time consuming, and, at a certain point, gmail becomes markedly less responsive.

Gmail's trash folder has similar issues. At a certain point, the 'empty trash' button stops working... I can click the button, gmail will report All messages have been deleted., but the messages still show in the trash folder.

I'm looking for a better way to mass delete emails, doing it through inbox is getting painful.

  • Did you ever find a solution? I have the same problem :( – rangfu May 28 '19 at 15:01
0

I don't know if you fixed this or not, but I was running into the same problem. If I choose to "move" the conversations into trash rather than delete them, it works for me. Hope it helps.

| improve this answer | |
0
  • Go to https://script.google.com
  • Create a new script

    function deleteOldEmail() { var batchSize = 100 while (true) { var threads = GmailApp.search('before:2018/10/12'); for (j = 0; j < threads.length; j+=batchSize) { GmailApp.moveThreadsToTrash(threads.slice(j, j+batchSize)); } } }

Save the project and click "run".
You will need to give the script access to your Gmail. It might take a few hours/days to complete running.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.