MPICK(1)

πŸ“¦
version 1.4 Β· 2 versions
, in alpine 3.24, nixos 26.05, nixpkgs unstable

okay so bestie, let me tell you about mpick(1) β€” it's literally the advanced message filter and it's giving main character energy. πŸ’…βœ¨

πŸ’Œ NAME πŸ’Œ

mpick β€” advanced message filter (yes that's the whole name, it's iconic)

πŸŽ€ SYNOPSIS πŸŽ€

mpick [-F file] [-T] [-v] [-t test] [msgs ...]

πŸ’– DESCRIPTION πŸ’–

So mpick prints all matching messages. That's it. That's the vibe.

If you're using it interactively, mpick defaults to the current sequence. Otherwise, it reads filenames from the standard input. Slay.

The options are as follows, bestie:

  • -F file β€” Read the expression from file and only show matching messages, see "TESTS". (so useful)
  • -T β€” Include the whole thread. (not me loving this for organization)
  • -t test β€” Only show messages matching the expression test, see "TESTS".
  • -v β€” Print how many messages were tested and picked to standard error. (the way I need this for debugging)

πŸ¦‹ TESTS πŸ¦‹

mpick tests are given by the following EBNF (no cap, it's real):

<expr>     ::= <expr> ? <expr> : <expr>  -- ternary operator
             | <expr> || <expr>  -- disjunction
             | <expr> && <expr>  -- conjunction
             | ! <expr>          -- negation
             | ( <expr> )
             | <expr> "|"  <str> -- pipe current mail to command
             | <expr> ">>" <str> -- append current mail to file
             | <expr> ">"  <str> -- write current mail to file
             | <flagprop>
             | <timeprop> <numop> <dur>
             | <numprop> <numop> <num>
             | <hdrprop> <decodeop> <strop> <str>
             | <strprop> <strop> <str>
             | prune             -- do not match further messages in thread
             | print             -- always true value
             | skip              -- always false value
             | <let>
             | <ident>

<flagprop> ::= child | draft | flagged | info | new | parent | passed
             | replied  | seen | selected | trashed

<timeprop> ::= atime | ctime | mtime | date

<numprop>  ::= depth | kept | replies | index | size | total

<numop>    ::= <= | < | >= | > | == | = | !=

<dur>      ::= "./path"          -- mtime of relative path
             | "/path"           -- mtime of absolute path
             | "YYYY-MM-DD HH:MM:SS"
             | "YYYY-MM-DD"      -- at midnight
             | "HH:MM:SS"        -- today
             | "HH:MM"           -- today
             | "-[0-9]+d"        -- n days ago at midnight
             | "-[0-9]+h"        -- n hours before now
             | "-[0-9]+m"        -- n minutes before now
             | "-[0-9]+s"        -- n seconds before now
             | [0-9]+            -- absolute epoch time

<num>      ::= [0-9]+ ( c        -- *1
                      | b        -- *512
                      | k        -- *1024
                      | M        -- *1024*1024
                      | G        -- *1024*1024*1024
                      | T )?     -- *1024*1024*1024*1024
             | cur               -- index of cur message

<hdrprop>  ::= from | to | subject | <str>

<decodeop> ::= . addr          -- match address parts
             | . disp          -- match address display parts
             |                 -- empty matches raw headers

<strprop>  ::= path

<strop>    ::= == | = | !=       -- string (in)equality
             | ===    | !===     -- case insensitive string (in)equality
             | ~~     | !~~      -- glob (fnmatch)
             | ~~~    | !~~~     -- case insensitive glob (fnmatch)
             | =~     | !=~ | !~ -- POSIX Extended Regular Expressions
             | =~~    | !=~~     -- case insensitive POSIX Extended Regular Expressions

<str>      ::= " ([^"] | "")+ "  -- use "" for a single " inside "
             | $[A-Za-z0-9_]+    -- environment variable

-- let expressions evaluate the expression following the `in` keyword,
-- the bindings are lazily evaluated.
<let>      ::= { let <ident> = <scope> } in <scope>

-- Inside the scope previously defined idents are replaced with expressions
<scope>    ::= <expr>

<ident>    ::= [A-Za-z_][A-Za-z0-9_]+

πŸ’€ EXIT STATUS πŸ’€

The mpick utility exits 0 on success, and >0 if an error occurs. (so if it's not 0, something went wrong, bestie 😭)

πŸ”₯ EXAMPLES πŸ”₯

You can pick mails to move them into another maildir:

mv $(mlist ./INBOX | mpick -t 'from =~ "@github"') ./github/cur

Or you can use mpick to pick mails from the current sequence:

mpick -t 'subject =~~ "mblaze"' | mscan

A more advanced mpick expression to pick mails in a certain time span, which are flagged as replied or not seen:

mpick -t 'date >= "2016-01-01" && date < "2017-01-01" && (replied || !seen)'

And to find other mblaze users:

mpick -t '"User-Agent" =~~ "mblaze"' | mscan

πŸ‘‘ SEE ALSO πŸ‘‘

lr(1), mailx(1) β€” go check them out, bestie 🫢

🌈 AUTHORS 🌈

  • Leah Neukirchen <leah@vuxu.org>
  • Duncan Overbruck <mail@duncano.de>

πŸ’œ LICENSE πŸ’œ

mpick is in the public domain. That's right, no copyright, it's free.

To the extent possible under law, the creator of this work has waived all copyright and related or neighboring rights to this work.

http://creativecommons.org/publicdomain/zero/1.0/


okay that's it bestie, this iconic manual page is from Debian, dated July 30, 2020, and it's called MPICK(1). slay. πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from