|
40
|
1 |
http://promberger.info/linux/2009/07/23/mutt-limit-or-search-by-date/
|
|
|
2 |
|
|
|
3 |
The following will not work:
|
|
|
4 |
|
|
|
5 |
~d < 1w
|
|
|
6 |
|
|
|
7 |
Use this instead:
|
|
|
8 |
|
|
|
9 |
~d <1w
|
|
|
10 |
|
|
|
11 |
Also, remember mutt uses the "AND" operator by default, so do not add & or &&
|
|
|
12 |
to combine searches using AND. Instead, just string them together. Say you want
|
|
|
13 |
to see all mail to, from, or cc a specific address group, sent in the last
|
|
|
14 |
seven days, do l for limit, or / for search, followed by:
|
|
|
15 |
|
|
|
16 |
%L groupname ~d <1w
|
|
|
17 |
|
|
|
18 |
Addendum
|
|
|
19 |
|
|
|
20 |
It seems you cannot, by the way, combine the relational < or > searches with an
|
|
|
21 |
absolute date. You can, however, add an error margin to an absolute date,
|
|
|
22 |
usually achieving what you want to do. The error margin can be before (-),
|
|
|
23 |
after (+), or both, using *. Like this:
|
|
|
24 |
|
|
|
25 |
Up to one month before date:
|
|
|
26 |
|
|
|
27 |
~d 30/10/08-1m
|
|
|
28 |
|
|
|
29 |
Up to five days after this date of the current year:
|
|
|
30 |
|
|
|
31 |
~d 04/05+5d
|
|
|
32 |
|
|
|
33 |
One week before and after date:
|
|
|
34 |
|
|
|
35 |
~d 27/02/2009*1w
|
|
|
36 |
|
|
|
37 |
------------------------------------------------------------
|
|
|
38 |
|
|
|
39 |
http://www.mutt.org/doc/devel/manual.html#date-patterns
|
|
|
40 |
|
|
|
41 |
3.4. Searching by Date
|
|
|
42 |
|
|
|
43 |
Mutt supports two types of dates, absolute and relative.
|
|
|
44 |
|
|
|
45 |
3.4.1. Absolute Dates
|
|
|
46 |
|
|
|
47 |
Dates must be in DD/MM/YY format (month and year are optional, defaulting to
|
|
|
48 |
the current month and year). An example of a valid range of dates is:
|
|
|
49 |
|
|
|
50 |
Limit to messages matching: ~d 20/1/95-31/10
|
|
|
51 |
|
|
|
52 |
If you omit the minimum (first) date, and just specify “-DD/MM/YY”, all
|
|
|
53 |
messages before the given date will be selected. If you omit the maximum
|
|
|
54 |
(second) date, and specify “DD/MM/YY-”, all messages after the given date will
|
|
|
55 |
be selected. If you specify a single date with no dash (“-”), only messages
|
|
|
56 |
sent on the given date will be selected.
|
|
|
57 |
|
|
|
58 |
You can add error margins to absolute dates. An error margin is a sign (+ or
|
|
|
59 |
-), followed by a digit, followed by one of the units in Table 4.6, “Date
|
|
|
60 |
units”. As a special case, you can replace the sign by a “*” character, which
|
|
|
61 |
is equivalent to giving identical plus and minus error margins.
|
|
|
62 |
|
|
|
63 |
Table 4.6. Date units
|
|
|
64 |
Unit Description
|
|
|
65 |
y Years
|
|
|
66 |
m Months
|
|
|
67 |
w Weeks
|
|
|
68 |
d Days
|
|
|
69 |
|
|
|
70 |
Example: To select any messages two weeks around January 15, 2001, you'd use
|
|
|
71 |
the following pattern:
|
|
|
72 |
|
|
|
73 |
Limit to messages matching: ~d 15/1/2001*2w
|
|
|
74 |
|
|
|
75 |
3.4.2. Relative Dates
|
|
|
76 |
|
|
|
77 |
This type of date is relative to the current date, and may be specified as:
|
|
|
78 |
|
|
|
79 |
>offset for messages older than offset units
|
|
|
80 |
|
|
|
81 |
<offset for messages newer than offset units
|
|
|
82 |
|
|
|
83 |
=offset for messages exactly offset units old
|
|
|
84 |
|
|
|
85 |
offset is specified as a positive number with one of the units from Table 4.6,
|
|
|
86 |
“Date units”.
|
|
|
87 |
|
|
|
88 |
Example: to select messages less than 1 month old, you would use
|
|
|
89 |
|
|
|
90 |
Limit to messages matching: ~d <1m
|
|
|
91 |
|