• Mutt mail pattern search

    From Michael Dansie@21:1/5 to All on Thu Nov 9 20:04:54 2023
    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 "[email protected]" 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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Roger Bell_West@21:1/5 to Michael Dansie on Fri Nov 10 09:08:06 2023
    On 2023-11-10, Michael Dansie wrote:
    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"

    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.

    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 "[email protected]" I would like to highlight the email, then insert that field into the "D" command to delete all mail from that address.

    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 ~[email protected]
    D

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

    tag-entry
    t

    tag-pattern ~[email protected]
    T

    tag-prefix delete-Message
    ;d

    You might also consider automatically sorting messages into dedicated mailboxes, e.g. with procmail.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Matthew Ernisse@21:1/5 to All on Tue Nov 14 01:02:44 2023
    On Fri, 10 Nov 2023 09:08:06 -0000 (UTC), Roger Bell_West wrote:

    [ snip ]

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

    tag-entry
    t

    tag-pattern ~[email protected]
    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.

    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)