2020-07-30 20:10:14 +00:00
|
|
|
.Dd July 30, 2020
|
2016-07-27 16:33:46 +00:00
|
|
|
.Dt MPICK 1
|
|
|
|
.Os
|
|
|
|
.Sh NAME
|
|
|
|
.Nm mpick
|
2018-02-04 18:43:49 +00:00
|
|
|
.Nd advanced message filter
|
2016-07-27 16:33:46 +00:00
|
|
|
.Sh SYNOPSIS
|
|
|
|
.Nm
|
2020-07-30 20:10:14 +00:00
|
|
|
.Op Fl F Ar file
|
2016-07-27 16:33:46 +00:00
|
|
|
.Op Fl T
|
2018-09-25 13:14:43 +00:00
|
|
|
.Op Fl v
|
2016-07-27 16:33:46 +00:00
|
|
|
.Op Fl t Ar test
|
2020-07-30 20:10:14 +00:00
|
|
|
.Op Ar msgs\ ...
|
2016-07-27 16:33:46 +00:00
|
|
|
.Sh DESCRIPTION
|
|
|
|
.Nm
|
|
|
|
prints all matching messages.
|
|
|
|
.Pp
|
|
|
|
If used interactively,
|
|
|
|
.Nm
|
|
|
|
will default to the current sequence.
|
2017-07-03 22:18:54 +00:00
|
|
|
Otherwise,
|
2016-07-27 16:33:46 +00:00
|
|
|
.Nm
|
2017-07-03 22:18:54 +00:00
|
|
|
will read filenames from the standard input.
|
2016-07-27 16:33:46 +00:00
|
|
|
.Pp
|
|
|
|
The options are as follows:
|
|
|
|
.Bl -tag -width Ds
|
2020-07-30 20:10:14 +00:00
|
|
|
.It Fl F Ar file
|
|
|
|
Read expression from
|
|
|
|
.Ar file
|
|
|
|
and only show matching messages, see
|
|
|
|
.Sx TESTS .
|
2016-07-27 16:33:46 +00:00
|
|
|
.It Fl T
|
|
|
|
Include whole thread.
|
|
|
|
.It Fl t Ar test
|
|
|
|
Only show messages matching the expression
|
|
|
|
.Ar test ,
|
|
|
|
see
|
|
|
|
.Sx TESTS .
|
2018-09-25 13:14:43 +00:00
|
|
|
.It Fl v
|
|
|
|
Print how many messages were tested and picked to standard error.
|
2016-07-27 16:33:46 +00:00
|
|
|
.El
|
|
|
|
.Sh TESTS
|
|
|
|
.Nm
|
|
|
|
tests are given by the following EBNF:
|
|
|
|
.Bd -literal
|
2019-01-28 10:12:18 +00:00
|
|
|
<expr> ::= <expr> ? <expr> : <expr> -- ternary operator
|
|
|
|
| <expr> || <expr> -- disjunction
|
2016-07-27 16:33:46 +00:00
|
|
|
| <expr> && <expr> -- conjunction
|
|
|
|
| ! <expr> -- negation
|
2017-05-01 22:00:46 +00:00
|
|
|
| ( <expr> )
|
2019-01-28 09:53:05 +00:00
|
|
|
| <expr> "|" <str> -- pipe current mail to command
|
|
|
|
| <expr> ">>" <str> -- append current mail to file
|
|
|
|
| <expr> ">" <str> -- write current mail to file
|
2016-07-27 16:33:46 +00:00
|
|
|
| <flagprop>
|
|
|
|
| <timeprop> <numop> <dur>
|
|
|
|
| <numprop> <numop> <num>
|
2019-01-29 13:07:55 +00:00
|
|
|
| <hdrprop> <decodeop> <strop> <str>
|
2016-07-27 16:33:46 +00:00
|
|
|
| <strprop> <strop> <str>
|
2017-06-30 14:04:55 +00:00
|
|
|
| prune -- do not match further messages in thread
|
2016-07-27 16:33:46 +00:00
|
|
|
| print -- always true value
|
2019-01-28 09:58:27 +00:00
|
|
|
| skip -- always false value
|
2019-01-28 15:22:29 +00:00
|
|
|
| <let>
|
|
|
|
| <ident>
|
2016-07-27 16:33:46 +00:00
|
|
|
|
2016-07-28 16:47:17 +00:00
|
|
|
<flagprop> ::= child | draft | flagged | info | new | parent | passed
|
2016-07-27 16:33:46 +00:00
|
|
|
| replied | seen | selected | trashed
|
|
|
|
|
|
|
|
<timeprop> ::= atime | ctime | mtime | date
|
|
|
|
|
2016-07-31 15:05:20 +00:00
|
|
|
<numprop> ::= depth | kept | replies | index | size | total
|
2016-07-27 16:33:46 +00:00
|
|
|
|
|
|
|
<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
|
2016-07-28 23:49:28 +00:00
|
|
|
| cur -- index of cur message
|
2016-07-27 16:33:46 +00:00
|
|
|
|
2019-01-29 13:07:55 +00:00
|
|
|
<hdrprop> ::= from | to | subject | <str>
|
|
|
|
|
|
|
|
<decodeop> ::= . addr -- match address parts
|
|
|
|
| . disp -- match address display parts
|
|
|
|
| -- empty matches raw headers
|
|
|
|
|
|
|
|
<strprop> ::= path
|
2016-07-27 16:33:46 +00:00
|
|
|
|
2017-10-26 19:50:29 +00:00
|
|
|
<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
|
2016-07-27 16:33:46 +00:00
|
|
|
|
|
|
|
<str> ::= " ([^"] | "")+ " -- use "" for a single " inside "
|
|
|
|
| $[A-Za-z0-9_]+ -- environment variable
|
2019-01-28 15:22:29 +00:00
|
|
|
|
|
|
|
-- 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_]+
|
2016-07-27 16:33:46 +00:00
|
|
|
.Ed
|
|
|
|
.Sh EXIT STATUS
|
|
|
|
.Ex -std
|
2017-01-25 14:50:05 +00:00
|
|
|
.Sh EXAMPLES
|
2017-02-23 19:25:21 +00:00
|
|
|
You can pick mails to move them into another
|
|
|
|
.Dv maildir .
|
|
|
|
.Pp
|
|
|
|
.Dl mv $(mlist ./INBOX | mpick -t 'from =~ \&"@github\&"') ./github/cur
|
|
|
|
.Pp
|
|
|
|
Or you can use
|
|
|
|
.Nm
|
|
|
|
to pick mails from the current sequence.
|
|
|
|
.Pp
|
|
|
|
.Dl mpick -t 'subject =~~ \&"mblaze\&"' | mscan
|
|
|
|
.Pp
|
|
|
|
A more advanced
|
|
|
|
.Nm
|
2017-07-03 22:18:54 +00:00
|
|
|
expression to pick mails in a certain time span,
|
|
|
|
which are flagged as replied or not seen.
|
2017-02-23 19:25:21 +00:00
|
|
|
.Bd -literal -offset indent
|
|
|
|
mpick -t 'date >= \&"2016-01-01\&" && date < \&"2017-01-01\&" && (replied || !seen)'
|
|
|
|
.Ed
|
2017-04-17 00:54:22 +00:00
|
|
|
.Pp
|
|
|
|
And to find other mblaze users.
|
|
|
|
.Pp
|
|
|
|
.Dl mpick -t '"User-Agent" =~~ \&"mblaze\&"' | mscan
|
2016-07-27 16:33:46 +00:00
|
|
|
.Sh SEE ALSO
|
|
|
|
.Xr lr 1 ,
|
|
|
|
.Xr mailx 1
|
|
|
|
.Sh AUTHORS
|
2017-01-21 16:17:12 +00:00
|
|
|
.An Leah Neukirchen Aq Mt leah@vuxu.org
|
2016-07-27 16:33:46 +00:00
|
|
|
.An Duncan Overbruck Aq Mt mail@duncano.de
|
|
|
|
.Sh LICENSE
|
|
|
|
.Nm
|
|
|
|
is in the public domain.
|
|
|
|
.Pp
|
|
|
|
To the extent possible under law,
|
|
|
|
the creator of this work
|
|
|
|
has waived all copyright and related or
|
|
|
|
neighboring rights to this work.
|
|
|
|
.Pp
|
|
|
|
.Lk http://creativecommons.org/publicdomain/zero/1.0/
|