Discussion:
Mutt mail pattern search
(too old to reply)
Michael Dansie
2023-11-10 04:04:54 UTC
Permalink
I'm new to using Mutt, and would like to sort emails and delete them based on various fields.

Currently I am using the following steps:

1. Sort by sender using "s" -> "f"
2. Delete by pattern using "D" and typing in the pattern, regex if needed

I would optimally like to delete all emails based on the fields in the highlighted email.

For instance, if I have multiple emails from "***@IFTTT.com" I would like to highlight the email, then insert that field into the "D" command to delete all mail from that address.

Is there a command or tool that works like this? I was hoping that something like a tag would work but I can't find a useful option
Roger Bell_West
2023-11-10 09:08:06 UTC
Permalink
Post by Michael Dansie
I'm new to using Mutt, and would like to sort emails and delete them based on various fields.
1. Sort by sender using "s" -> "f"
You're not using the same keybindings as me, and I thought I was using
default ones; your "s" is my "o". For clarity I'm going to use
internal command names (in this case "sort-mailbox"; the "help"
command, which for me is "?", will show the current bindings, and I'll
put mine below.
Post by Michael Dansie
2. Delete by pattern using "D" and typing in the pattern, regex if needed
I would optimally like to delete all emails based on the fields in the highlighted email.
I'm not aware of anything that will do "delete messages that look like
this one", but there are several ways mutt can do something a bit like
this.

(1) delete by pattern.

delete-pattern ~***@IFTTT.com
D

(2) tag individual messages or by pattern, then delete tagged messages
en masse.

tag-entry
t

tag-pattern ~***@IFTTT.com
T

tag-prefix delete-Message
;d

You might also consider automatically sorting messages into dedicated
mailboxes, e.g. with procmail.
Matthew Ernisse
2023-11-14 01:02:44 UTC
Permalink
On Fri, 10 Nov 2023 09:08:06 -0000 (UTC), Roger Bell_West wrote:

[ snip ]
Post by Roger Bell_West
(2) tag individual messages or by pattern, then delete tagged messages
en masse.
tag-entry
t
T
tag-prefix delete-Message
;d
I use this pattern constantly, often also with tag-prefix save (;s) to
file messages. I find it extremely useful.
Post by Roger Bell_West
You might also consider automatically sorting messages into dedicated
mailboxes, e.g. with procmail.
I strongly endorse this as well. I tend to file automatic notifications
and search them if I end up looking for something. Procmail can have
fairly complex recipes so if you really want urgent notifications to hit
your inbox you can do that too, or even pipe the message to a script and
use something like Twilio SMS you.
--
"The avalanche has started, it is too late for the pebbles to vote."
--Kosh
Loading...