@alvaro
sign in · lmno.lol

Marking 20k emails as read

Mbsync and mu4e are great for syncing and handling IMAP email. I've now migrated 4 email addresses, including an old Yahoo account.

I wanted to mark all my Yahoo unread emails as read. Yahoo's webmail enables marking 500 emails at a time, making the process a little tedious.

Mu-discuss has a handy thread, highlighting that moving/renaming synced messages (in your local file system) would do the job. This worked well for me.

Let's do just that…

WARNING: Copy a small sample of your mails to a separate directory and run some trials until you feel comfortable.

Find your mail directory.

cd path/to/mail

Peek at the messages you'd like to mark unread:

ls -1 new/

Rename message files by appending "S" to their filename and moving from new/ to cur/ directory.

for FILE in new/*; do mv "${FILE}" cur/$(basename "${FILE}")S; done;

We can verify the move.

ls -1 cur/

Let's sync the local changes.

mbsync -Va

…and we're done ;)