Delete very large number emails

I have a phone with over 22,000 emails in the inbox that I want to delete. If do a “select all” and then “delete”, K-9 basically “hangs”. Any other suggestions would be appreciated.

The approaches differ based on whether this is an imap or pop account. If imap, there’s a “clear local messages” option. You can then repopulate the inbox (or any mail “folder”) from the server. If pop, well…

When asking questions or reporting problems … please always, at minimum, include information on the K9 release, android version and mailbox type.

Well it’s setup as pop. Any suggestions?

POP3 doesn’t support batch operations. So a client will have to send 22,000 delete commands to the server. K-9 Mail will wait for the answer to the previous command before sending another one. If we are generous and assume that each operation will complete in 100 ms that’s 220 seconds or 3.7 minutes total. Chances are operations are quite a bit slower, so you’ll easily end up with 30+ minutes to just delete the messages from the server.
In addition to that K-9 Mail will perform at least 3 local database operations per delete. If a local Trash folder is used, even more. That quickly adds up.

To summarize: neither POP3 nor K-9 Mail are a great fit for this type of operation.

If the provider supports it, use IMAP to connect to the server and delete the messages. You’ll want to use a client that doesn’t download all messages before it allows you to delete them.
Synchronizing the inbox in K-9 Mail afterwards will probably still be slow. But it should be much faster than trying to delete the messages using K-9 Mail.

Thanks for your suggestions - all fixed