Follow

I have over one milion emails in my inbox in GMail, is there a way to delete them all without doing it 50 by 50 in the UI?

ยท 8 ยท 0 ยท 2
@jeena @selea better to let a program take its time while you do other stuff, then having to do it manually

@opal @selea ah, perhaps there is some code available on GitHub which can do that?

@opal @selea yeah but there I would need to download one million emails with attachments before I can delete them, and then I would need to mark one million emails, I don't think they're made for that.

@jeena @selea i havent used gmail much lately so im not sure if theres an in-house way of deleting all mail from inbox... perhaps setting up a filter to delete all messages from inbox, then disabling the filter afterward, or something like that

just looked online actually, try searching "is:inbox" and see if it gives you an option to select all results and delete

@opal @selea so there seems to be a way theoretically youtube.com/watch?v=paH1eCvURc but when I do it it runs for some time and then it says "oops something went wrong" and it just moves 400 emails or something like that to the bin.

@jeena @selea seems like its overall just difficult to deal with lol

i remember having issues moving my gmail stuff over to another account, ended up just exporting a mbox file instead of trying to use imap. hopefully you find a solution that actually works and doesnt error out

@opal @selea yeah, there seem to be apis and libs so I can write something which runs slowly

@selea @jeena No, there used to be another way. I deleted my account a while ago, but I remember being faced with the same problem once. IIRC use the advance search and "select all" results for a certain action - like "delete".

@guido ah haha, you answered to a 3 moths old question, now I get it.
But now that you mention it I need to check how it went for the script which deleted everything: gist.github.com/jeena/6f510fdd

@guido ah it only deleted 10k mails and stopped for some reason.

@jeena
Enable IMAP and use Thunderbird or other email client to delete them all at once

@nikolal I don't think Thunderbird will be able to hold over 15 GB of the emails in ram so I can select them on my 16 GB RAM laptop.

@nikolal I guess I'm looking for a more automated way, I think I'll try my luck with the gmail API and a python script.

@jeena
That might work, but I guess their API also limits you to some degree

@nikolal might be, but if so then I'll try my luck with a IMAP lib ^^

@jeena
Lol, you can just make that gmail account to forward your emails to new email account, I recommend switching away from google. With that you have empty inbox and you can see all new incoming mail

@nikolal I don't need the email account, I need the space for google drive

@jeena Enable pop3 access and install thunderbird?

@silver I would guess that Thunderbird won't be able to handle selecting one million emails, let alone processing the deletion.

@cjk101010 no, I just have an old account for the house in Poland where it send about 1k emails with attachments from the CCTV cams per day for years and I never deleted it, now I want to use the 15 GB for google drive instead to store video of movement from monionEye offsite on that account but it's full already ^^

@Xjs I fear that they don't release the username for quite some time after you delete it

@jeena Maybe a python script that interacts with the smtp server would work.

Though I don't really have experience with python and smtp.
@jeena meant imap instead of smtp of course ๐Ÿคฆโ€โ™‚๏ธโ€‹

@jeena There might be something important in there. Check the spam folder too.

@Jeena @selea :trisquel: Just delete the inbox. It's really fast because the client doesn't have to process expunge notifications for every message.  I think most software will re-create an empty one, but if necessary you might need to perform this step manually.

@mike the question is how to do it. Is there a way in the gmail UI? Or can I do it in Thunderbird?

@Jeena It's been a while, but I've done it Thunderbird. I think it's available via a right-click on the mailbox name in the folder list. I don't know about gmail; which I've never used. I'd look for some kind of folder management menu. I'm reasonably certain there's a way to delete folders in gmail, but the only question is whether they allow it for inbox.
Sign in to participate in the conversation
Jeena's

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!