2016-07-27 16:33:46 +00:00
|
|
|
.Dd July 27, 2016
|
|
|
|
.Dt MPICK 1
|
|
|
|
.Os
|
|
|
|
.Sh NAME
|
|
|
|
.Nm mpick
|
|
|
|
.Nd filter mail messages
|
|
|
|
.Sh SYNOPSIS
|
|
|
|
.Nm
|
|
|
|
.Op Fl T
|
|
|
|
.Op Fl t Ar test
|
|
|
|
.Op Ar msglist\ ...
|
|
|
|
.Sh DESCRIPTION
|
|
|
|
.Nm
|
|
|
|
prints all matching messages.
|
|
|
|
.Pp
|
|
|
|
If used interactively,
|
|
|
|
.Nm
|
|
|
|
will default to the current sequence.
|
|
|
|
Else,
|
|
|
|
.Nm
|
|
|
|
will read filenames from standard input.
|
|
|
|
.Pp
|
|
|
|
The options are as follows:
|
|
|
|
.Bl -tag -width Ds
|
|
|
|
.It Fl T
|
|
|
|
Include whole thread.
|
|
|
|
.It Fl t Ar test
|
|
|
|
Only show messages matching the expression
|
|
|
|
.Ar test ,
|
|
|
|
see
|
|
|
|
.Sx TESTS .
|
|
|
|
.El
|
|
|
|
.Sh MSGLISTS
|
|
|
|
.Nm
|
2016-07-28 16:00:52 +00:00
|
|
|
message lists (msglist) are mostly compatible with
|
2016-07-27 16:33:46 +00:00
|
|
|
.Xr mailx 1
|
|
|
|
are message
|
|
|
|
specifications used as shortened
|
|
|
|
.Sx TESTS
|
|
|
|
and can include:
|
|
|
|
.Bl -tag -width Ds
|
|
|
|
.It Ar n
|
|
|
|
Message number
|
|
|
|
.Ar n .
|
2016-07-28 16:00:52 +00:00
|
|
|
.It Ar n Ns Cm ":" Ns Ar m , Ar n Ns Cm "-" Ns Ar m
|
2016-07-27 16:33:46 +00:00
|
|
|
An inclusive range of message numbers between
|
|
|
|
.Ar n
|
|
|
|
and
|
|
|
|
.Ar m .
|
|
|
|
.It Ar address
|
|
|
|
All messages from
|
|
|
|
.Ar address .
|
2016-07-28 15:37:51 +00:00
|
|
|
.It Cm "/" Ns Ar string
|
2016-07-27 16:33:46 +00:00
|
|
|
All messages with
|
|
|
|
.Ar string
|
|
|
|
in the subject line (case ignored).
|
2016-07-28 15:37:51 +00:00
|
|
|
.It Cm ":" Ns Ar c
|
2016-07-27 16:33:46 +00:00
|
|
|
All message of type
|
|
|
|
.Ar c ,
|
|
|
|
where
|
|
|
|
.Ar c
|
|
|
|
shall be one of:
|
|
|
|
.Bl -tag -width Ds
|
2016-07-28 15:37:51 +00:00
|
|
|
.It Cm D
|
2016-07-27 16:33:46 +00:00
|
|
|
Drafted messages.
|
2016-07-28 15:37:51 +00:00
|
|
|
.It Cm P
|
2016-07-27 16:33:46 +00:00
|
|
|
Passed (resent, forwarded or bounced) messages.
|
2016-07-28 15:37:51 +00:00
|
|
|
.It Cm R
|
2016-07-27 16:33:46 +00:00
|
|
|
Replied messages.
|
2016-07-28 15:37:51 +00:00
|
|
|
.It Cm F
|
2016-07-27 16:33:46 +00:00
|
|
|
Flagged messages.
|
2016-07-28 15:37:51 +00:00
|
|
|
.It Cm d , Cm T
|
2016-07-27 16:33:46 +00:00
|
|
|
Deleted messages.
|
2016-07-28 15:37:51 +00:00
|
|
|
.It Cm n
|
2016-07-27 16:33:46 +00:00
|
|
|
New messages.
|
2016-07-28 15:37:51 +00:00
|
|
|
.It Cm o
|
2016-07-27 16:33:46 +00:00
|
|
|
Old messages.
|
2016-07-28 15:37:51 +00:00
|
|
|
.It Cm r, Cm S
|
2016-07-27 16:33:46 +00:00
|
|
|
Read messages.
|
2016-07-28 15:37:51 +00:00
|
|
|
.It Cm u
|
2016-07-27 16:33:46 +00:00
|
|
|
Unread messages.
|
|
|
|
.El
|
|
|
|
.El
|
|
|
|
.Sh TESTS
|
|
|
|
.Nm
|
|
|
|
tests are given by the following EBNF:
|
|
|
|
.Bd -literal
|
|
|
|
<expr> ::= <expr> || <expr> -- disjunction
|
|
|
|
| <expr> && <expr> -- conjunction
|
|
|
|
| ! <expr> -- negation
|
|
|
|
| ( <expr )
|
|
|
|
| <flagprop>
|
|
|
|
| <timeprop> <numop> <dur>
|
|
|
|
| <numprop> <numop> <num>
|
|
|
|
| <strprop> <strop> <str>
|
|
|
|
| prune -- do not match futher messages in thread
|
|
|
|
| print -- always true value
|
|
|
|
|
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
|
|
|
|
|
|
|
<strprop> ::= from | subject | to
|
|
|
|
|
|
|
|
<strop> ::= == | = -- string equality
|
|
|
|
| === -- case insensitive string 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
|
|
|
|
.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
|
|
|
|
expressions to pick mails in a time span which are flagged as replied or not seen.
|
|
|
|
.Pp
|
|
|
|
.Bd -literal -offset indent
|
|
|
|
mpick -t 'date >= \&"2016-01-01\&" && date < \&"2017-01-01\&" && (replied || !seen)'
|
|
|
|
.Ed
|
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/
|