[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: mail regex
From: |
Sam Roberts |
Subject: |
Re: mail regex |
Date: |
Sat, 11 Aug 2001 10:07:59 -0400 |
User-agent: |
Mutt/1.3.16i |
Bon matin!
Quoting Sergey Poznyakoff <address@hidden>, who wrote:
> Actually, I am thinking about a more general approach. Sometimes it
> is necessary to select letters on the contents of an arbitrary
> header. So, I'd extend the search syntax to something like
>
> Received:/.*mirddin.*/
>
> meaning select all the letters with the given regexp in Received: header.
> If the "header:" portion is omitted, it defaults to Subject:.
> Any comments?
Have you looked at Mutt's pattern's? They do this, here's an excerpt from
the docs:
4.2. Patterns
Many of Mutt's commands allow you to specify a pattern to match
(limit, tag-pattern, delete-pattern, etc.). There are several ways to
select messages:
~A all messages
~b EXPR messages which contain EXPR in the message body
~B EXPR messages which contain EXPR in the whole message
~c USER messages carbon-copied to USER
~C EXPR message is either to: or cc: EXPR
~D deleted messages
~d [MIN]-[MAX] messages with ``date-sent'' in a Date range
~E expired messages
~e EXPR message which contains EXPR in the ``Sender'' field
~F flagged messages
~f USER messages originating from USER
~g PGP signed messages
~G PGP encrypted messages
~h EXPR messages which contain EXPR in the message header
~k message contains PGP key material
~i ID message which match ID in the ``Message-ID'' field
~L EXPR message is either originated or received by EXPR
~l message is addressed to a known mailing list
~m [MIN]-[MAX] message in the range MIN to MAX *)
~n [MIN]-[MAX] messages with a score in the range MIN to MAX *)
~N new messages
~O old messages
~p message is addressed to you (consults $alternates)
~P message is from you (consults $alternates)
~Q messages which have been replied to
~R read messages
~r [MIN]-[MAX] messages with ``date-received'' in a Date range
~S superseded messages
~s SUBJECT messages having SUBJECT in the ``Subject'' field.
~T tagged messages
~t USER messages addressed to USER
~U unread messages
~v message is part of a collapsed thread.
~x EXPR messages which contain EXPR in the `References' field
~y EXPR messages which contain EXPR in the `X-Label' field
~z [MIN]-[MAX] messages with a size in the range MIN to MAX *)
Where EXPR, USER, ID, and SUBJECT are ``regular expressions''.
There is a configuration variable, as well, which is how to apply
a regex that doesn't have a ~ escape before it, so you can decide
whether by default you want to search subjects, addresses, both,
etc.
Cheers,
Sam
--
Sam Roberts <address@hidden> (Vivez sans temps mort!)