From: Francois Fleuret Date: Sat, 2 Feb 2013 16:00:18 +0000 (+0100) Subject: Changed field "dest" to "to", added "date". X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=commitdiff_plain;h=93e55a350d0053c490a31e4a671925eb9c2fb6ee;p=mymail.git Changed field "dest" to "to", added "date". --- diff --git a/mymail.1 b/mymail.1 index 79eff22..abfd077 100644 --- a/mymail.1 +++ b/mymail.1 @@ -30,11 +30,13 @@ for a mail to be selected. .TP \fBf \fR selects mails whose field From, From:, or Reply-To: matches the regexp. Since the initial "From " line contains the date, this search criterion can be used to restrict to a certain year or month. .TP -\fBd \fR selects mails whose field To:, Cc:, or Bcc: matches the regexp. +\fBt \fR selects mails whose field To:, Cc:, or Bcc: matches the regexp. .TP \fBp \fR selects mails whose field From, From:, Reply-To:, To:, Cc:, or Bcc: matches the regexp. .TP \fBs \fR selects mails whose field Subject: matches the regexp. +.TP +\fBd \fR selects mails whose field Date: matches the regexp. .SH "EXAMPLES" diff --git a/mymail.c b/mymail.c index 27b48f4..88e0954 100644 --- a/mymail.c +++ b/mymail.c @@ -62,8 +62,9 @@ int action_index; enum { ID_MAIL = 0, ID_FROM, - ID_DEST, + ID_TO, ID_SUBJECT, + ID_DATE, ID_PARTICIPANT, MAX_ID }; @@ -71,8 +72,9 @@ enum { static char *field_names[] = { "mail", "from", - "dest", + "to", "subject", + "date", "part" }; @@ -100,7 +102,7 @@ static struct parsable_field fields_to_parse[] = { }, { - ID_DEST, + ID_TO, "^\\([Tt][Oo]\\|[Cc][Cc]\\|[Bb][Cc][Cc]\\): ", { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, @@ -111,6 +113,12 @@ static struct parsable_field fields_to_parse[] = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { + ID_DATE, + "^[Dd][Aa][Tt][Ee]: ", + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } + }, + }; /********************************************************************/ @@ -184,7 +192,7 @@ int mbox_line_match_search(struct search_request *request, int mbox_id, char *mbox_value) { return (request->field_id == mbox_id || - (request->field_id == ID_PARTICIPANT && (mbox_id == ID_FROM || mbox_id == ID_DEST))) + (request->field_id == ID_PARTICIPANT && (mbox_id == ID_FROM || mbox_id == ID_TO))) && regexec(&request->regexp, mbox_value, 0, 0, 0) == 0; }