Subject: ; Text Recipient patch (New Feature)

From: "Randall S. Winchester" <[email-masked]>
Date: Thu, 13 Mar 1997 17:10:48 -0500

Every morning when I start Pine and go through the evenings mail I have
a repeating frustration reading mail sent to various groups with the address
inconsistantly on either the To: or the Cc: lines.

I continually do the following to read these groups.
; T T somegroup
; T C somegroup
Of course this way the ordering of messages is wrong also. 
The existing alternative, ": T A somegroup", is slower and often picks up
lots of other junk.

I have made a patch that will allow one to search recipients in both the
To: and the Cc: lines at one time, thus keeping the order correct.

This is a really cool patch for those who do this all the time.
I would hope something similar makes it into the next release.    

Now instead of:
; T T mailer-daemon A D ; A ; T C mailer-daemon A D
You can just:
: T R mailer-daemon A D

I hope this patch is well recieved by the "Pine Team".
It was made against my pine3.95.patch-1 source tree, and should work with   
the recent pine3.96 as well.

Enjoy!

Randall

--- 1.1	1997/03/13 15:37:41
+++ pine/mailcmd.c	1997/03/13 20:06:31
@@ -170,13 +170,14 @@

 static char *sel_text =
-    "Select based on To, From, Cc, or Subject fields or All message text ? ";
+    "Select based on To, From, Cc, Subject, Recpients, or All message text ? ";
 static ESCKEY_S sel_text_opt[] = {
     {'f', 'f', "F", "From"},
     {'s', 's', "S", "Subject"},
     {'t', 't', "T", "To"},
     {'a', 'a', "A", "All Text"},
     {'c', 'c', "C", "Cc"},
+    {'r', 'r', "R", "Recpients"},
     {-1, 0, NULL, NULL}
 };
 
@@ -5391,7 +5392,7 @@
 {
     int       r, type, we_cancel = 0;
     char     *sval = NULL, sstring[80], tmp[128];
-    ESCKEY_S  ekey[3];
+    ESCKEY_S  ekey[4];
     ENVELOPE *env = NULL;
     HelpType  help;
 
@@ -5402,6 +5403,7 @@
      */
     ekey[1].ch   = -1;
     ekey[2].ch   = -1;
+    ekey[3].ch   = -1;
     switch(type = radio_buttons(sel_text, -FOOTER_ROWS(ps_global),
 				sel_text_opt, 's', 'x', NO_HELP, RB_NORM)){
       case 't' :			/* address fields, offer To or From */
@@ -5426,6 +5428,22 @@
 	ekey[0].label = "Cur Subject";
 	break;
 
+      case 'r' :
+	sval = "RECIPIENT";
+	ekey[0].ch    = ctrl('T');
+	ekey[0].name  = "^T";
+	ekey[0].rval  = 10;
+	ekey[0].label = "Cur To";
+	ekey[1].ch    = ctrl('R');
+	ekey[1].name  = "^R";
+	ekey[1].rval  = 11;
+	ekey[1].label = "Cur From";
+	ekey[2].ch    = ctrl('Y');
+	ekey[2].name  = "^Y";
+	ekey[2].rval  = 12;
+	ekey[2].label = "Cur Cc";
+	break;
+
       case 'a' :
 	sval = "TEXT";			/* fall thru */
 	ekey[0].ch = -1;
@@ -5458,7 +5476,8 @@
 			       : (type == 'c') ? h_select_txt_cc
 				: (type == 's') ? h_select_txt_subj
 				 : (type == 'a') ? h_select_txt_all
-				  :              NO_HELP)
+				  : (type == 'r') ? h_select_txt_recipients
+				   :              NO_HELP)
 			    : NO_HELP;
 	      case 4 :
 		continue;
--- 1.1	1997/03/13 18:54:18
+++ pine/pine.hlp	1997/03/13 19:38:00
@@ -5747,6 +5747,9 @@
 ========== h_select_txt_cc ==========
 Messages with From: headers containing the entered string will be selected.
 ^C to cancel. ^R enters current msg From: address.  ^T enters To: address.
+========== h_select_txt_recipients ==========
+Messages with To: or Cc: headers containing the entered string will be selected.
+^C to cancel. ^R uses From: address. ^T uses To: address. ^Y uses Cc: address.
 ========== h_select_txt_subj ==========
 Messages with Subject: headers containing the entered string will be selected.
 ^C to cancel.  ^X enters Subject: line of current message.
--- 1.2	1997/03/13 17:38:38
+++ imap/non-ANSI/c-client/bezerk.c	1997/03/13 18:21:37
@@ -837,6 +837,8 @@
 	break;
       case 'R':			/* possible RECENT */
 	if (!strcmp (criteria+1,"ECENT")) f = bezerk_search_recent;
+	else if (!strcmp (criteria+1,"ECIPIENT"))
+	  f = bezerk_search_string (bezerk_search_recipient,&d,&n);
 	break;
       case 'S':			/* possible SEEN, SINCE, SUBJECT */
 	if (!strcmp (criteria+1,"EEN")) f = bezerk_search_seen;
@@ -2257,6 +2259,17 @@
 				/* get text for address */
   rfc822_write_address (LOCAL->buf,a);
   return search (LOCAL->buf,(long) strlen (LOCAL->buf),d,n);
+}
+
+
+char bezerk_search_recipient (stream,msgno,d,n)
+	MAILSTREAM *stream;
+	long msgno;
+	char *d;
+	long n;
+{
+  return bezerk_search_to (stream,msgno,d,n) ||
+    bezerk_search_cc (stream,msgno,d,n);
 }

--- 1.3	1997/03/13 18:18:54
+++ imap/non-ANSI/c-client/bezerk.h	1997/03/13 18:19:18
@@ -287,6 +287,7 @@
 char bezerk_search_bcc  ();
 char bezerk_search_cc  ();
 char bezerk_search_from  ();
+char bezerk_search_recipient  ();
 char bezerk_search_to  ();
 
 typedef char (*search_t)  ();
--- 1.1	1997/03/13 21:05:55
+++ imap/non-ANSI/c-client/mh.c	1997/03/13 21:20:31
@@ -801,6 +801,8 @@
 	break;
       case 'R':			/* possible RECENT */
 	if (!strcmp (criteria+1,"ECENT")) f = mh_search_recent;
+	else if (!strcmp (criteria+1,"ECIPIENT"))
+	  f = mh_search_string (mh_search_recipient,&d,&n);
 	break;
       case 'S':			/* possible SEEN, SINCE, SUBJECT */
 	if (!strcmp (criteria+1,"EEN")) f = mh_search_seen;
@@ -1556,6 +1558,16 @@
   return search (LOCAL->buf,(long) strlen (LOCAL->buf),d,n);
 }
 
+
+char mh_search_recipient (stream,msgno,d,n)
+	MAILSTREAM *stream;
+	long msgno;
+	char *d;
+	long n;
+{
+  return mh_search_to (stream,msgno,d,n) ||
+    mh_search_cc (stream,msgno,d,n);
+}
 
 char mh_search_to (stream,msgno,d,n)
 	MAILSTREAM *stream;
--- 1.1	1997/03/13 21:05:55
+++ imap/non-ANSI/c-client/mmdf.c	1997/03/13 21:23:27
@@ -761,6 +761,8 @@
 	break;
       case 'R':			/* possible RECENT */
 	if (!strcmp (criteria+1,"ECENT")) f = mmdf_search_recent;
+	else if (!strcmp (criteria+1,"ECIPIENT"))
+	  f = mmdf_search_string (mmdf_search_recipient,&d,&n);
 	break;
       case 'S':			/* possible SEEN, SINCE, SUBJECT */
 	if (!strcmp (criteria+1,"EEN")) f = mmdf_search_seen;
@@ -2153,6 +2155,17 @@
 				/* get text for address */
   rfc822_write_address (LOCAL->buf,a);
   return search (LOCAL->buf,(long) strlen (LOCAL->buf),d,n);
+}
+
+
+char mmdf_search_recipient (stream,msgno,d,n)
+	MAILSTREAM *stream;
+	long msgno;
+	char *d;
+	long n;
+{
+  return mmdf_search_to (stream,msgno,d,n) ||
+     mmdf_search_cc (stream,msgno,d,n);
 }

--- 1.1	1997/03/13 21:05:55
+++ imap/non-ANSI/c-client/mtx.c	1997/03/13 21:21:26
@@ -828,6 +828,8 @@
 	break;
       case 'R':			/* possible RECENT */
 	if (!strcmp (criteria+1,"ECENT")) f = mtx_search_recent;
+	else if (!strcmp (criteria+1,"ECIPIENT"))
+	  f = mtx_search_string (mtx_search_recipient,&d,&n);
 	break;
       case 'S':			/* possible SEEN, SINCE, SUBJECT */
 	if (!strcmp (criteria+1,"EEN")) f = mtx_search_seen;
@@ -1928,6 +1930,17 @@
 				/* get text for address */
   rfc822_write_address (LOCAL->buf,a);
   return search (LOCAL->buf,(long) strlen (LOCAL->buf),d,n);
+}
+
+
+char mtx_search_recipient (stream,msgno,d,n)
+	MAILSTREAM *stream;
+	long msgno;
+	char *d;
+	long n;
+{
+  return mtx_search_to (stream,msgno,d,n) ||
+    mtx_search_cc (stream,msgno,d,n);
 }

--- 1.1	1997/03/13 21:05:55
+++ imap/non-ANSI/c-client/news.c	1997/03/13 21:21:38
@@ -731,6 +731,8 @@
 	break;
       case 'R':			/* possible RECENT */
 	if (!strcmp (criteria+1,"ECENT")) f = news_search_recent;
+	else if (!strcmp (criteria+1,"ECIPIENT"))
+	  f = news_search_string (news_search_recipient,&d,&n);
 	break;
       case 'S':			/* possible SEEN, SINCE, SUBJECT */
 	if (!strcmp (criteria+1,"EEN")) f = news_search_seen;
@@ -1222,6 +1224,17 @@
 				/* get text for address */
   rfc822_write_address (LOCAL->buf,a);
   return search (LOCAL->buf,(long) strlen (LOCAL->buf),d,n);
+}
+
+
+char news_search_recipient (stream,msgno,d,n)
+	MAILSTREAM *stream;
+	long msgno;
+	char *d;
+	long n;
+{
+  return news_search_to (stream,msgno,d,n) ||
+    news_search_cc (stream,msgno,d,n);
 }

--- 1.1	1997/03/13 21:05:55
+++ imap/non-ANSI/c-client/nntpcunx.c	1997/03/13 21:25:37
@@ -789,6 +789,8 @@
 	break;
       case 'R':			/* possible RECENT */
 	if (!strcmp (criteria+1,"ECENT")) f = nntp_search_recent;
+	else if (!strcmp (criteria+1,"ECIPIENT"))
+	  f = nntp_search_string (nntp_search_recipient,&d,&n);
 	break;
       case 'S':			/* possible SEEN, SINCE, SUBJECT */
 	if (!strcmp (criteria+1,"EEN")) f = nntp_search_seen;
@@ -1271,6 +1273,17 @@
 				/* get text for address */
   rfc822_write_address (LOCAL->buf,a);
   return search (LOCAL->buf,(long) strlen (LOCAL->buf),d,n);
+}
+
+
+char nntp_search_recipient (stream,msgno,d,n)
+	MAILSTREAM *stream;
+	long msgno;
+	char *d;
+	long n;
+{
+  return nntp_search_to (stream,msgno,d,n) ||
+    nntp_search_cc (stream,msgno,d,n);
 }

--- 1.1	1997/03/13 21:05:55
+++ imap/non-ANSI/c-client/phile.c	1997/03/13 21:22:07
@@ -682,6 +682,8 @@
 	break;
       case 'R':			/* possible RECENT */
 	if (!strcmp (criteria+1,"ECENT")) f = phile_search_recent;
+	else if (!strcmp (criteria+1,"ECIPIENT"))
+	  f = phile_search_string (phile_search_recipient,&d,&n);
 	break;
       case 'S':			/* possible SEEN, SINCE, SUBJECT */
 	if (!strcmp (criteria+1,"EEN")) f = phile_search_seen;
@@ -1146,6 +1148,17 @@
 				/* get text for address */
   rfc822_write_address (tmp,phile_fetchstructure (stream,m,NIL)->from);
   return search (tmp,strlen (tmp),d,n);
+}
+
+
+char phile_search_recipient (stream,msgno,d,n)
+	MAILSTREAM *stream;
+	long msgno;
+	char *d;
+	long n;
+{
+  return phile_search_to (stream,msgno,d,n) ||
+    phile_search_cc (stream,msgno,d,n);
 }

--- 1.1	1997/03/13 21:05:55
+++ imap/non-ANSI/c-client/pop3.c	1997/03/13 21:25:56
@@ -753,6 +753,8 @@
 	break;
       case 'R':			/* possible RECENT */
 	if (!strcmp (criteria+1,"ECENT")) f = pop3_search_recent;
+	else if (!strcmp (criteria+1,"ECIPIENT"))
+	  f = pop3_search_string (pop3_search_recipient,&d,&n);
 	break;
       case 'S':			/* possible SEEN, SINCE, SUBJECT */
 	if (!strcmp (criteria+1,"EEN")) f = pop3_search_seen;
@@ -1325,6 +1327,17 @@
 				/* get text for address */
   rfc822_write_address (LOCAL->buf,a);
   return search (LOCAL->buf,(long) strlen (LOCAL->buf),d,n);
+}
+
+
+char pop3_search_recipient (stream,msgno,d,n)
+	MAILSTREAM *stream;
+	long msgno;
+	char *d;
+	long n;
+{
+  return pop3_search_to (stream,msgno,d,n) ||
+    pop3_search_cc (stream,msgno,d,n);
 }

--- 1.1	1997/03/13 21:05:55
+++ imap/non-ANSI/c-client/tenex2.c	1997/03/13 21:43:28
@@ -852,6 +852,8 @@
 	break;
       case 'R':			/* possible RECENT */
 	if (!strcmp (criteria+1,"ECENT")) f = tenex_search_recent;
+	else if (!strcmp (criteria+1,"ECIPIENT"))
+	  f = tenex_search_string (tenex_search_recipient,&d,&n);
 	break;
       case 'S':			/* possible SEEN, SINCE, SUBJECT */
 	if (!strcmp (criteria+1,"EEN")) f = tenex_search_seen;
@@ -1963,6 +1965,17 @@
 				/* get text for address */
   rfc822_write_address (LOCAL->buf,a);
   return search (LOCAL->buf,(long) strlen (LOCAL->buf),d,n);
+}
+
+
+char tenex_search_recipient (stream,msgno,d,n)
+	MAILSTREAM *stream;
+	long msgno;
+	char *d;
+	long n;
+{
+  return tenex_search_to (stream,msgno,d,n) ||
+    tenex_search_cc (stream,msgno,d,n);
 }

--- 1.1	1997/03/13 20:57:47
+++ imap/non-ANSI/c-client/mh.h	1997/03/13 20:59:43
@@ -127,6 +127,7 @@
 char mh_search_cc  ();
 char mh_search_from  ();
 char mh_search_to  ();
+char mh_search_recipient  ();
 typedef char (*search_t)  ();
 search_t mh_search_date  ();
 search_t mh_search_flag  ();
--- 1.1	1997/03/13 20:57:47
+++ imap/non-ANSI/c-client/mmdf.h	1997/03/13 21:00:04
@@ -157,6 +157,7 @@
 char mmdf_search_cc  ();
 char mmdf_search_from  ();
 char mmdf_search_to  ();
+char mmdf_search_recipient  ();
 
 search_t mmdf_search_date  ();
 search_t mmdf_search_flag  ();
--- 1.1	1997/03/13 20:57:47
+++ imap/non-ANSI/c-client/mtx.h	1997/03/13 21:00:51
@@ -133,6 +133,7 @@
 char mtx_search_cc  ();
 char mtx_search_from  ();
 char mtx_search_to  ();
+char mtx_search_recipient  ();
 
 typedef char (*search_t)  ();
 search_t mtx_search_date  ();
--- 1.1	1997/03/13 20:57:47
+++ imap/non-ANSI/c-client/news.h	1997/03/13 21:01:06
@@ -120,6 +120,7 @@
 char news_search_cc  ();
 char news_search_from  ();
 char news_search_to  ();
+char news_search_recipient  ();
 typedef char (*search_t)  ();
 search_t news_search_date  ();
 search_t news_search_flag  ();
--- 1.1	1997/03/13 20:57:47
+++ imap/non-ANSI/c-client/nntpcunx.h	1997/03/13 21:01:17
@@ -130,6 +130,7 @@
 char nntp_search_cc  ();
 char nntp_search_from  ();
 char nntp_search_to  ();
+char nntp_search_recipient  ();
 typedef char (*search_t)  ();
 search_t nntp_search_date  ();
 search_t nntp_search_flag  ();
--- 1.1	1997/03/13 20:57:47
+++ imap/non-ANSI/c-client/phile.h	1997/03/13 21:01:27
@@ -130,6 +130,7 @@
 char phile_search_cc  ();
 char phile_search_from  ();
 char phile_search_to  ();
+char phile_search_recipient  ();
 
 typedef char (*search_t)  ();
 search_t phile_search_date  ();
--- 1.1	1997/03/13 20:57:47
+++ imap/non-ANSI/c-client/pop3.h	1997/03/13 21:01:40
@@ -132,6 +132,7 @@
 char pop3_search_cc  ();
 char pop3_search_from  ();
 char pop3_search_to  ();
+char pop3_search_recipient  ();
 typedef char (*search_t)  ();
 search_t pop3_search_date  ();
 search_t pop3_search_flag  ();
--- 1.1	1997/03/13 20:57:47
+++ imap/non-ANSI/c-client/tenex2.h	1997/03/13 21:03:58
@@ -140,6 +140,7 @@
 char tenex_search_cc  ();
 char tenex_search_from  ();
 char tenex_search_to  ();
+char tenex_search_recipient  ();
 
 typedef char (*search_t)  ();
 search_t tenex_search_date  ();
--- 1.2	1997/03/13 21:26:59
+++ imap/ANSI/c-client/bezerk.h	1997/03/13 21:29:12
@@ -288,6 +288,7 @@
 char bezerk_search_bcc (MAILSTREAM *stream,long msgno,char *d,long n);
 char bezerk_search_cc (MAILSTREAM *stream,long msgno,char *d,long n);
 char bezerk_search_from (MAILSTREAM *stream,long msgno,char *d,long n);
+char bezerk_search_recipient (MAILSTREAM *stream,long msgno,char *d,long n);
 char bezerk_search_to (MAILSTREAM *stream,long msgno,char *d,long n);
 
 typedef char (*search_t) (MAILSTREAM *stream,long msgno,char *d,long n);
--- 1.1	1997/03/13 21:27:32
+++ imap/ANSI/c-client/mh.h	1997/03/13 21:29:24
@@ -127,6 +127,7 @@
 char mh_search_bcc (MAILSTREAM *stream,long msgno,char *d,long n);
 char mh_search_cc (MAILSTREAM *stream,long msgno,char *d,long n);
 char mh_search_from (MAILSTREAM *stream,long msgno,char *d,long n);
+char mh_search_recipient (MAILSTREAM *stream,long msgno,char *d,long n);
 char mh_search_to (MAILSTREAM *stream,long msgno,char *d,long n);
 typedef char (*search_t) (MAILSTREAM *stream,long msgno,char *d,long n);
 search_t mh_search_date (search_t f,long *n);
--- 1.1	1997/03/13 21:27:32
+++ imap/ANSI/c-client/mmdf.h	1997/03/13 21:29:37
@@ -157,6 +157,7 @@
 char mmdf_search_bcc (MAILSTREAM *stream,long msgno,char *d,long n);
 char mmdf_search_cc (MAILSTREAM *stream,long msgno,char *d,long n);
 char mmdf_search_from (MAILSTREAM *stream,long msgno,char *d,long n);
+char mmdf_search_recipient (MAILSTREAM *stream,long msgno,char *d,long n);
 char mmdf_search_to (MAILSTREAM *stream,long msgno,char *d,long n);
 
 search_t mmdf_search_date (search_t f,long *n);
--- 1.1	1997/03/13 21:27:32
+++ imap/ANSI/c-client/mtx.h	1997/03/13 21:29:46
@@ -133,6 +133,7 @@
 char mtx_search_bcc (MAILSTREAM *stream,long msgno,char *d,long n);
 char mtx_search_cc (MAILSTREAM *stream,long msgno,char *d,long n);
 char mtx_search_from (MAILSTREAM *stream,long msgno,char *d,long n);
+char mtx_search_recipient (MAILSTREAM *stream,long msgno,char *d,long n);
 char mtx_search_to (MAILSTREAM *stream,long msgno,char *d,long n);
 
 typedef char (*search_t) (MAILSTREAM *stream,long msgno,char *d,long n);
--- 1.1	1997/03/13 21:27:32
+++ imap/ANSI/c-client/news.h	1997/03/13 21:29:57
@@ -120,6 +120,7 @@
 char news_search_bcc (MAILSTREAM *stream,long msgno,char *d,long n);
 char news_search_cc (MAILSTREAM *stream,long msgno,char *d,long n);
 char news_search_from (MAILSTREAM *stream,long msgno,char *d,long n);
+char news_search_recipient (MAILSTREAM *stream,long msgno,char *d,long n);
 char news_search_to (MAILSTREAM *stream,long msgno,char *d,long n);
 typedef char (*search_t) (MAILSTREAM *stream,long msgno,char *d,long n);
 search_t news_search_date (search_t f,long *n);
--- 1.1	1997/03/13 21:27:32
+++ imap/ANSI/c-client/nntpcunx.h	1997/03/13 21:30:08
@@ -130,6 +130,7 @@
 char nntp_search_bcc (MAILSTREAM *stream,long msgno,char *d,long n);
 char nntp_search_cc (MAILSTREAM *stream,long msgno,char *d,long n);
 char nntp_search_from (MAILSTREAM *stream,long msgno,char *d,long n);
+char nntp_search_recipient (MAILSTREAM *stream,long msgno,char *d,long n);
 char nntp_search_to (MAILSTREAM *stream,long msgno,char *d,long n);
 typedef char (*search_t) (MAILSTREAM *stream,long msgno,char *d,long n);
 search_t nntp_search_date (search_t f,long *n);
--- 1.1	1997/03/13 21:27:32
+++ imap/ANSI/c-client/phile.h	1997/03/13 21:30:17
@@ -130,6 +130,7 @@
 char phile_search_bcc (MAILSTREAM *stream,long msgno,char *d,long n);
 char phile_search_cc (MAILSTREAM *stream,long msgno,char *d,long n);
 char phile_search_from (MAILSTREAM *stream,long msgno,char *d,long n);
+char phile_search_recipient (MAILSTREAM *stream,long msgno,char *d,long n);
 char phile_search_to (MAILSTREAM *stream,long msgno,char *d,long n);
 
 typedef char (*search_t) (MAILSTREAM *stream,long msgno,char *d,long n);
--- 1.1	1997/03/13 21:27:32
+++ imap/ANSI/c-client/pop3.h	1997/03/13 21:30:27
@@ -132,6 +132,7 @@
 char pop3_search_bcc (MAILSTREAM *stream,long msgno,char *d,long n);
 char pop3_search_cc (MAILSTREAM *stream,long msgno,char *d,long n);
 char pop3_search_from (MAILSTREAM *stream,long msgno,char *d,long n);
+char pop3_search_recipient (MAILSTREAM *stream,long msgno,char *d,long n);
 char pop3_search_to (MAILSTREAM *stream,long msgno,char *d,long n);
 typedef char (*search_t) (MAILSTREAM *stream,long msgno,char *d,long n);
 search_t pop3_search_date (search_t f,long *n);
--- 1.1	1997/03/13 21:27:32
+++ imap/ANSI/c-client/tenex2.h	1997/03/13 21:30:37
@@ -140,6 +140,7 @@
 char tenex_search_bcc (MAILSTREAM *stream,long msgno,char *d,long n);
 char tenex_search_cc (MAILSTREAM *stream,long msgno,char *d,long n);
 char tenex_search_from (MAILSTREAM *stream,long msgno,char *d,long n);
+char tenex_search_recipient (MAILSTREAM *stream,long msgno,char *d,long n);
 char tenex_search_to (MAILSTREAM *stream,long msgno,char *d,long n);
 
 typedef char (*search_t) (MAILSTREAM *stream,long msgno,char *d,long n);
--- 1.2	1997/03/13 21:27:04
+++ imap/ANSI/c-client/bezerk.c	1997/03/13 21:39:32
@@ -778,6 +778,8 @@
 	break;
       case 'R':			/* possible RECENT */
 	if (!strcmp (criteria+1,"ECENT")) f = bezerk_search_recent;
+	else if (!strcmp (criteria+1,"ECIPIENT"))
+	  f = bezerk_search_string (bezerk_search_recipient,&d,&n);
 	break;
       case 'S':			/* possible SEEN, SINCE, SUBJECT */
 	if (!strcmp (criteria+1,"EEN")) f = bezerk_search_seen;
@@ -2057,6 +2059,13 @@
 				/* get text for address */
   rfc822_write_address (LOCAL->buf,a);
   return search (LOCAL->buf,(long) strlen (LOCAL->buf),d,n);
+}
+
+
+char bezerk_search_recipient (MAILSTREAM *stream,long msgno,char *d,long n)
+{
+  return bezerk_search_to (stream,msgno,d,n) ||
+    bezerk_search_cc (stream,msgno,d,n);
 }

--- 1.1	1997/03/13 21:27:41
+++ imap/ANSI/c-client/mh.c	1997/03/13 21:41:05
@@ -746,6 +746,8 @@
 	break;
       case 'R':			/* possible RECENT */
 	if (!strcmp (criteria+1,"ECENT")) f = mh_search_recent;
+	else if (!strcmp (criteria+1,"ECIPIENT"))
+	  f = mh_search_string (mh_search_recipient,&d,&n);
 	break;
       case 'S':			/* possible SEEN, SINCE, SUBJECT */
 	if (!strcmp (criteria+1,"EEN")) f = mh_search_seen;
@@ -1381,6 +1383,13 @@
 				/* get text for address */
   rfc822_write_address (LOCAL->buf,a);
   return search (LOCAL->buf,(long) strlen (LOCAL->buf),d,n);
+}
+
+
+char mh_search_recipient (MAILSTREAM *stream,long msgno,char *d,long n)
+{
+  return mh_search_to (stream,msgno,d,n) ||
+    mh_search_cc (stream,msgno,d,n);
 }

--- 1.1	1997/03/13 21:27:41
+++ imap/ANSI/c-client/mmdf.c	1997/03/13 21:41:23
@@ -707,6 +707,8 @@
 	break;
       case 'R':			/* possible RECENT */
 	if (!strcmp (criteria+1,"ECENT")) f = mmdf_search_recent;
+	else if (!strcmp (criteria+1,"ECIPIENT"))
+	  f = mmdf_search_string (mmdf_search_recipient,&d,&n);
 	break;
       case 'S':			/* possible SEEN, SINCE, SUBJECT */
 	if (!strcmp (criteria+1,"EEN")) f = mmdf_search_seen;
@@ -1962,6 +1964,13 @@
 				/* get text for address */
   rfc822_write_address (LOCAL->buf,a);
   return search (LOCAL->buf,(long) strlen (LOCAL->buf),d,n);
+}
+
+
+char mmdf_search_recipient (MAILSTREAM *stream,long msgno,char *d,long n)
+{
+  return mmdf_search_to (stream,msgno,d,n) ||
+    mmdf_search_cc (stream,msgno,d,n);
 }

--- 1.1	1997/03/13 21:27:41
+++ imap/ANSI/c-client/mtx.c	1997/03/13 21:45:26
@@ -771,6 +771,8 @@
 	break;
       case 'R':			/* possible RECENT */
 	if (!strcmp (criteria+1,"ECENT")) f = mtx_search_recent;
+	else if (!strcmp (criteria+1,"ECIPIENT"))
+	  f = mtx_search_string (mtx_search_recipient,&d,&n);
 	break;
       case 'S':			/* possible SEEN, SINCE, SUBJECT */
 	if (!strcmp (criteria+1,"EEN")) f = mtx_search_seen;
@@ -1740,6 +1742,13 @@
 				/* get text for address */
   rfc822_write_address (LOCAL->buf,a);
   return search (LOCAL->buf,(long) strlen (LOCAL->buf),d,n);
+}
+
+
+char mtx_search_recipient (MAILSTREAM *stream,long msgno,char *d,long n)
+{
+  return mtx_search_to (stream,msgno,d,n) ||
+    mtx_search_cc (stream,msgno,d,n);
 }

--- 1.1	1997/03/13 21:27:41
+++ imap/ANSI/c-client/news.c	1997/03/13 21:41:59
@@ -676,6 +676,8 @@
 	break;
       case 'R':			/* possible RECENT */
 	if (!strcmp (criteria+1,"ECENT")) f = news_search_recent;
+	else if (!strcmp (criteria+1,"ECIPIENT"))
+	  f = news_search_string (news_search_recipient,&d,&n);
 	break;
       case 'S':			/* possible SEEN, SINCE, SUBJECT */
 	if (!strcmp (criteria+1,"EEN")) f = news_search_seen;
@@ -1054,6 +1056,13 @@
 				/* get text for address */
   rfc822_write_address (LOCAL->buf,a);
   return search (LOCAL->buf,(long) strlen (LOCAL->buf),d,n);
+}
+
+
+char news_search_recipient (MAILSTREAM *stream,long msgno,char *d,long n)
+{
+  return news_search_to (stream,msgno,d,n) ||
+    news_search_cc (stream,msgno,d,n);
 }

--- 1.1	1997/03/13 21:27:41
+++ imap/ANSI/c-client/nntpcunx.c	1997/03/13 21:42:10
@@ -734,6 +734,8 @@
 	break;
       case 'R':			/* possible RECENT */
 	if (!strcmp (criteria+1,"ECENT")) f = nntp_search_recent;
+	else if (!strcmp (criteria+1,"ECIPIENT"))
+	  f = nntp_search_string (nntp_search_recipient,&d,&n);
 	break;
       case 'S':			/* possible SEEN, SINCE, SUBJECT */
 	if (!strcmp (criteria+1,"EEN")) f = nntp_search_seen;
@@ -1103,6 +1105,13 @@
 				/* get text for address */
   rfc822_write_address (LOCAL->buf,a);
   return search (LOCAL->buf,(long) strlen (LOCAL->buf),d,n);
+}
+
+
+char nntp_search_recipient (MAILSTREAM *stream,long msgno,char *d,long n)
+{
+  return nntp_search_to (stream,msgno,d,n) ||
+    nntp_search_cc (stream,msgno,d,n);
 }

--- 1.1	1997/03/13 21:27:41
+++ imap/ANSI/c-client/phile.c	1997/03/13 21:42:22
@@ -625,6 +625,8 @@
 	break;
       case 'R':			/* possible RECENT */
 	if (!strcmp (criteria+1,"ECENT")) f = phile_search_recent;
+	else if (!strcmp (criteria+1,"ECIPIENT"))
+	  f = phile_search_string (phile_search_recipient,&d,&n);
 	break;
       case 'S':			/* possible SEEN, SINCE, SUBJECT */
 	if (!strcmp (criteria+1,"EEN")) f = phile_search_seen;
@@ -978,6 +980,13 @@
 				/* get text for address */
   rfc822_write_address (tmp,phile_fetchstructure (stream,m,NIL)->from);
   return search (tmp,strlen (tmp),d,n);
+}
+
+
+char phile_search_recipient (MAILSTREAM *stream,long msgno,char *d,long n)
+{
+  return phile_search_to (stream,msgno,d,n) ||
+    phile_search_cc (stream,msgno,d,n);
 }

--- 1.1	1997/03/13 21:27:41
+++ imap/ANSI/c-client/pop3.c	1997/03/13 21:42:30
@@ -699,6 +699,8 @@
 	break;
       case 'R':			/* possible RECENT */
 	if (!strcmp (criteria+1,"ECENT")) f = pop3_search_recent;
+	else if (!strcmp (criteria+1,"ECIPIENT"))
+	  f = pop3_search_string (pop3_search_recipient,&d,&n);
 	break;
       case 'S':			/* possible SEEN, SINCE, SUBJECT */
 	if (!strcmp (criteria+1,"EEN")) f = pop3_search_seen;
@@ -1149,6 +1151,13 @@
 				/* get text for address */
   rfc822_write_address (LOCAL->buf,a);
   return search (LOCAL->buf,(long) strlen (LOCAL->buf),d,n);
+}
+
+
+char pop3_search_recipient (MAILSTREAM *stream,long msgno,char *d,long n)
+{
+  return pop3_search_to (stream,msgno,d,n) ||
+    pop3_search_cc (stream,msgno,d,n);
 }

--- 1.1	1997/03/13 21:27:41
+++ imap/ANSI/c-client/tenex2.c	1997/03/13 21:43:00
@@ -789,6 +789,8 @@
 	break;
       case 'R':			/* possible RECENT */
 	if (!strcmp (criteria+1,"ECENT")) f = tenex_search_recent;
+	else if (!strcmp (criteria+1,"ECIPIENT"))
+	  f = tenex_search_string (tenex_search_recipient,&d,&n);
 	break;
       case 'S':			/* possible SEEN, SINCE, SUBJECT */
 	if (!strcmp (criteria+1,"EEN")) f = tenex_search_seen;
@@ -1767,6 +1769,13 @@
 				/* get text for address */
   rfc822_write_address (LOCAL->buf,a);
   return search (LOCAL->buf,(long) strlen (LOCAL->buf),d,n);
+}
+
+
+char tenex_search_recipient (MAILSTREAM *stream,long msgno,char *d,long n)
+{
+  return tenex_search_to (stream,msgno,d,n) ||
+    tenex_search_cc (stream,msgno,d,n);
 }