Bulk email actions with mu4e

35 views
Skip to first unread message

Evan Klitzke

unread,
Mar 17, 2018, 4:46:04 PM3/17/18
to mu-di...@googlegroups.com
Hi,

I just set up mu and mu4e with mbsync and it's really awesome! I was
previously trying to get mutt and notmuch working in a satisfactory way,
and the mu+mu4e seems light-years ahead in terms of usability.

I am coming from Gmail, and want to clean up a lot of old mail I have.
In particular, I used to be subscribed to a lot of email lists that are
taking up a lot of space in my mail directories, and I'd like to delete
these old messages.

I'm a little confused about the best way to do this. When I do a search
using "mu find" on the command line I get back the full set of results
(thousands of results). When I do the same search within mu4e, it limits
the search to a much smaller set of results. I can see why that makes
sense in terms of UI responsiveness, but it makes bulk deleting mail
cumbersome.

How can I delete the full set of results with one query? I would be fine
doing it with regular "mu" on the command line if that's easier.

--
Evan Klitzke
https://eklitzke.org/

Dirk-Jan C. Binnema

unread,
Mar 18, 2018, 3:41:58 AM3/18/18
to mu-di...@googlegroups.com
Hi Evan,
There's `mu4e-headers-toggle-full-search` (Q); but indeed, that makes
the UI a bit slow.

However, doing it from the command-line isn't too hard, e.g., to delete
all before 2018 in some folder.

--8<---------------cut here---------------start------------->8---

mu find maildir:/somefolder AND date:..2017 --exec 'echo rm '

--8<---------------cut here---------------end--------------->8---

(without the echo, obviously -- but it's recommended you do a 'dry run'
first with echo, to ensure it matches the correct messages).

Kind regards,
Dirk.

--
Dirk-Jan C. Binnema Helsinki, Finland
e:dj...@djcbsoftware.nl w:www.djcbsoftware.nl
pgp: D09C E664 897D 7D39 5047 A178 E96A C7A1 017D DA3C

Evan Klitzke

unread,
Mar 18, 2018, 12:20:43 PM3/18/18
to mu-di...@googlegroups.com

Dirk-Jan C. Binnema <dj...@djcbsoftware.nl> writes:
> There's `mu4e-headers-toggle-full-search` (Q); but indeed, that makes
> the UI a bit slow.
>
> However, doing it from the command-line isn't too hard, e.g., to
> delete
> all before 2018 in some folder.
>
> --8<---------------cut here---------------start------------->8---
>
> mu find maildir:/somefolder AND date:..2017 --exec 'echo rm '
>
> --8<---------------cut here---------------end--------------->8---
>
> (without the echo, obviously -- but it's recommended you do a 'dry
> run'
> first with echo, to ensure it matches the correct messages).

Thanks, that works perfectly!
Reply all
Reply to author
Forward
0 new messages