This patch against pine3.95q (which probably works against 3.96 as well)
implements the following features:

- (written by "Randall S. Winchester" <rsw@Glue.umd.edu>) Add a "Recipients"
    option to the aggregate selection -- similar to doing a selection by To
    and then broadening with a selction by Cc... useful when you want to
    know all the messages that a certain address received.

- defines ALLOW_CHANGING_FROM in pine/osdep/os-lnx.h so that From can be
    changed

- adds a new define ALLOW_DISABLE_SENDER which enables a new option
    disable-sender, suppressing the generation of Sender: and X-Sender:.
    (defined in pine/osdep/os-lnx.h as well)

- adds a new define QMAIL_RETURN_PATH which enables a new option
    qmail-return-path which uses the qmail feature whereby the envelope
    sender can be set by putting a Return-Path header into the message.
    By default the Return-Path: will contain a copy of the From:, but if
    you add Return-Path to your customized headers you can use any
    combination of From: and envelope sender you want.
    (defined in pine/osdep/os-lnx.h as well)

You will need to define those features in whatever osdep file is appropriate
for your system to make use of them.

Dean

diff -r -u pine3.95.dist/imap/ANSI/c-client/bezerk.c pine3.95/imap/ANSI/c-client/bezerk.c
--- pine3.95.dist/imap/ANSI/c-client/bezerk.c	Thu Jan 16 22:12:32 1997
+++ pine3.95/imap/ANSI/c-client/bezerk.c	Thu Mar 20 01:01:43 1997
@@ -774,6 +774,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;
@@ -2047,6 +2049,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);
 }
 
 
diff -r -u pine3.95.dist/imap/ANSI/c-client/bezerk.h pine3.95/imap/ANSI/c-client/bezerk.h
--- pine3.95.dist/imap/ANSI/c-client/bezerk.h	Wed Apr 12 22:38:11 1995
+++ pine3.95/imap/ANSI/c-client/bezerk.h	Thu Mar 20 01:01:42 1997
@@ -284,6 +284,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);
diff -r -u pine3.95.dist/imap/ANSI/c-client/mh.c pine3.95/imap/ANSI/c-client/mh.c
--- pine3.95.dist/imap/ANSI/c-client/mh.c	Wed May 15 11:49:54 1996
+++ pine3.95/imap/ANSI/c-client/mh.c	Thu Mar 20 01:01:43 1997
@@ -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);
 }
 
 
diff -r -u pine3.95.dist/imap/ANSI/c-client/mh.h pine3.95/imap/ANSI/c-client/mh.h
--- pine3.95.dist/imap/ANSI/c-client/mh.h	Sun Aug 14 21:42:59 1994
+++ pine3.95/imap/ANSI/c-client/mh.h	Thu Mar 20 01:01:42 1997
@@ -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);
diff -r -u pine3.95.dist/imap/ANSI/c-client/mmdf.c pine3.95/imap/ANSI/c-client/mmdf.c
--- pine3.95.dist/imap/ANSI/c-client/mmdf.c	Thu Jan 16 22:12:33 1997
+++ pine3.95/imap/ANSI/c-client/mmdf.c	Thu Mar 20 01:01:43 1997
@@ -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);
 }
 
 
diff -r -u pine3.95.dist/imap/ANSI/c-client/mmdf.h pine3.95/imap/ANSI/c-client/mmdf.h
--- pine3.95.dist/imap/ANSI/c-client/mmdf.h	Fri Jun 17 01:40:23 1994
+++ pine3.95/imap/ANSI/c-client/mmdf.h	Thu Mar 20 01:01:42 1997
@@ -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);
diff -r -u pine3.95.dist/imap/ANSI/c-client/mtx.c pine3.95/imap/ANSI/c-client/mtx.c
--- pine3.95.dist/imap/ANSI/c-client/mtx.c	Thu Jan 16 22:12:33 1997
+++ pine3.95/imap/ANSI/c-client/mtx.c	Thu Mar 20 01:01:43 1997
@@ -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);
 }
 
 
diff -r -u pine3.95.dist/imap/ANSI/c-client/mtx.h pine3.95/imap/ANSI/c-client/mtx.h
--- pine3.95.dist/imap/ANSI/c-client/mtx.h	Tue May 10 14:41:47 1994
+++ pine3.95/imap/ANSI/c-client/mtx.h	Thu Mar 20 01:01:42 1997
@@ -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);
diff -r -u pine3.95.dist/imap/ANSI/c-client/news.c pine3.95/imap/ANSI/c-client/news.c
--- pine3.95.dist/imap/ANSI/c-client/news.c	Wed May 15 11:50:02 1996
+++ pine3.95/imap/ANSI/c-client/news.c	Thu Mar 20 01:01:43 1997
@@ -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);
 }
 
 
diff -r -u pine3.95.dist/imap/ANSI/c-client/news.h pine3.95/imap/ANSI/c-client/news.h
--- pine3.95.dist/imap/ANSI/c-client/news.h	Mon Sep 12 21:35:39 1994
+++ pine3.95/imap/ANSI/c-client/news.h	Thu Mar 20 01:01:42 1997
@@ -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);
diff -r -u pine3.95.dist/imap/ANSI/c-client/nntpcunx.c pine3.95/imap/ANSI/c-client/nntpcunx.c
--- pine3.95.dist/imap/ANSI/c-client/nntpcunx.c	Wed May 15 11:50:10 1996
+++ pine3.95/imap/ANSI/c-client/nntpcunx.c	Thu Mar 20 01:01:43 1997
@@ -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);
 }
 
 
diff -r -u pine3.95.dist/imap/ANSI/c-client/nntpcunx.h pine3.95/imap/ANSI/c-client/nntpcunx.h
--- pine3.95.dist/imap/ANSI/c-client/nntpcunx.h	Mon Sep 12 21:37:18 1994
+++ pine3.95/imap/ANSI/c-client/nntpcunx.h	Thu Mar 20 01:01:42 1997
@@ -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);
diff -r -u pine3.95.dist/imap/ANSI/c-client/phile.c pine3.95/imap/ANSI/c-client/phile.c
--- pine3.95.dist/imap/ANSI/c-client/phile.c	Wed May 15 11:50:12 1996
+++ pine3.95/imap/ANSI/c-client/phile.c	Thu Mar 20 01:01:43 1997
@@ -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);
 }
 
 
diff -r -u pine3.95.dist/imap/ANSI/c-client/phile.h pine3.95/imap/ANSI/c-client/phile.h
--- pine3.95.dist/imap/ANSI/c-client/phile.h	Wed Mar  2 20:01:33 1994
+++ pine3.95/imap/ANSI/c-client/phile.h	Thu Mar 20 01:01:43 1997
@@ -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);
diff -r -u pine3.95.dist/imap/ANSI/c-client/pop3.c pine3.95/imap/ANSI/c-client/pop3.c
--- pine3.95.dist/imap/ANSI/c-client/pop3.c	Thu Jan 16 22:12:33 1997
+++ pine3.95/imap/ANSI/c-client/pop3.c	Thu Mar 20 01:01:43 1997
@@ -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);
 }
 
 
diff -r -u pine3.95.dist/imap/ANSI/c-client/pop3.h pine3.95/imap/ANSI/c-client/pop3.h
--- pine3.95.dist/imap/ANSI/c-client/pop3.h	Mon Jun  6 21:57:20 1994
+++ pine3.95/imap/ANSI/c-client/pop3.h	Thu Mar 20 01:01:43 1997
@@ -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);
diff -r -u pine3.95.dist/imap/ANSI/c-client/tenex2.c pine3.95/imap/ANSI/c-client/tenex2.c
--- pine3.95.dist/imap/ANSI/c-client/tenex2.c	Thu Jan 16 22:12:33 1997
+++ pine3.95/imap/ANSI/c-client/tenex2.c	Thu Mar 20 01:01:43 1997
@@ -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);
 }
 
 
diff -r -u pine3.95.dist/imap/ANSI/c-client/tenex2.h pine3.95/imap/ANSI/c-client/tenex2.h
--- pine3.95.dist/imap/ANSI/c-client/tenex2.h	Sun Oct  2 22:08:39 1994
+++ pine3.95/imap/ANSI/c-client/tenex2.h	Thu Mar 20 01:01:43 1997
@@ -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);
diff -r -u pine3.95.dist/imap/non-ANSI/c-client/bezerk.c pine3.95/imap/non-ANSI/c-client/bezerk.c
--- pine3.95.dist/imap/non-ANSI/c-client/bezerk.c	Thu Jan 16 22:12:33 1997
+++ pine3.95/imap/non-ANSI/c-client/bezerk.c	Thu Mar 20 01:01:41 1997
@@ -833,6 +833,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;
@@ -2247,6 +2249,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);
 }
 
 
diff -r -u pine3.95.dist/imap/non-ANSI/c-client/bezerk.h pine3.95/imap/non-ANSI/c-client/bezerk.h
--- pine3.95.dist/imap/non-ANSI/c-client/bezerk.h	Wed Apr 12 23:03:14 1995
+++ pine3.95/imap/non-ANSI/c-client/bezerk.h	Thu Mar 20 01:01:41 1997
@@ -283,6 +283,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)  ();
diff -r -u pine3.95.dist/imap/non-ANSI/c-client/mh.c pine3.95/imap/non-ANSI/c-client/mh.c
--- pine3.95.dist/imap/non-ANSI/c-client/mh.c	Wed May 15 11:56:05 1996
+++ pine3.95/imap/non-ANSI/c-client/mh.c	Thu Mar 20 01:01:41 1997
@@ -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;
diff -r -u pine3.95.dist/imap/non-ANSI/c-client/mh.h pine3.95/imap/non-ANSI/c-client/mh.h
--- pine3.95.dist/imap/non-ANSI/c-client/mh.h	Sun Aug 14 21:44:49 1994
+++ pine3.95/imap/non-ANSI/c-client/mh.h	Thu Mar 20 01:01:42 1997
@@ -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  ();
diff -r -u pine3.95.dist/imap/non-ANSI/c-client/mmdf.c pine3.95/imap/non-ANSI/c-client/mmdf.c
--- pine3.95.dist/imap/non-ANSI/c-client/mmdf.c	Thu Jan 16 22:12:34 1997
+++ pine3.95/imap/non-ANSI/c-client/mmdf.c	Thu Mar 20 01:01:42 1997
@@ -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);
 }
 
 
diff -r -u pine3.95.dist/imap/non-ANSI/c-client/mmdf.h pine3.95/imap/non-ANSI/c-client/mmdf.h
--- pine3.95.dist/imap/non-ANSI/c-client/mmdf.h	Mon Sep 19 20:47:46 1994
+++ pine3.95/imap/non-ANSI/c-client/mmdf.h	Thu Mar 20 01:01:42 1997
@@ -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  ();
diff -r -u pine3.95.dist/imap/non-ANSI/c-client/mtx.c pine3.95/imap/non-ANSI/c-client/mtx.c
--- pine3.95.dist/imap/non-ANSI/c-client/mtx.c	Thu Jan 16 22:12:34 1997
+++ pine3.95/imap/non-ANSI/c-client/mtx.c	Thu Mar 20 01:01:42 1997
@@ -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);
 }
 
 
diff -r -u pine3.95.dist/imap/non-ANSI/c-client/mtx.h pine3.95/imap/non-ANSI/c-client/mtx.h
--- pine3.95.dist/imap/non-ANSI/c-client/mtx.h	Tue May 10 14:58:40 1994
+++ pine3.95/imap/non-ANSI/c-client/mtx.h	Thu Mar 20 01:01:42 1997
@@ -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  ();
diff -r -u pine3.95.dist/imap/non-ANSI/c-client/news.c pine3.95/imap/non-ANSI/c-client/news.c
--- pine3.95.dist/imap/non-ANSI/c-client/news.c	Wed May 15 11:56:11 1996
+++ pine3.95/imap/non-ANSI/c-client/news.c	Thu Mar 20 01:01:42 1997
@@ -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);
 }
 
 
diff -r -u pine3.95.dist/imap/non-ANSI/c-client/news.h pine3.95/imap/non-ANSI/c-client/news.h
--- pine3.95.dist/imap/non-ANSI/c-client/news.h	Tue Sep 13 21:50:44 1994
+++ pine3.95/imap/non-ANSI/c-client/news.h	Thu Mar 20 01:01:42 1997
@@ -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  ();
diff -r -u pine3.95.dist/imap/non-ANSI/c-client/nntpcunx.c pine3.95/imap/non-ANSI/c-client/nntpcunx.c
--- pine3.95.dist/imap/non-ANSI/c-client/nntpcunx.c	Wed May 15 11:56:13 1996
+++ pine3.95/imap/non-ANSI/c-client/nntpcunx.c	Thu Mar 20 01:01:42 1997
@@ -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);
 }
 
 
diff -r -u pine3.95.dist/imap/non-ANSI/c-client/nntpcunx.h pine3.95/imap/non-ANSI/c-client/nntpcunx.h
--- pine3.95.dist/imap/non-ANSI/c-client/nntpcunx.h	Tue Sep 13 21:50:50 1994
+++ pine3.95/imap/non-ANSI/c-client/nntpcunx.h	Thu Mar 20 01:01:42 1997
@@ -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  ();
diff -r -u pine3.95.dist/imap/non-ANSI/c-client/phile.c pine3.95/imap/non-ANSI/c-client/phile.c
--- pine3.95.dist/imap/non-ANSI/c-client/phile.c	Wed May 15 11:56:14 1996
+++ pine3.95/imap/non-ANSI/c-client/phile.c	Thu Mar 20 01:01:42 1997
@@ -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);
 }
 
 
diff -r -u pine3.95.dist/imap/non-ANSI/c-client/phile.h pine3.95/imap/non-ANSI/c-client/phile.h
--- pine3.95.dist/imap/non-ANSI/c-client/phile.h	Thu Mar  3 23:24:51 1994
+++ pine3.95/imap/non-ANSI/c-client/phile.h	Thu Mar 20 01:01:42 1997
@@ -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  ();
diff -r -u pine3.95.dist/imap/non-ANSI/c-client/pop3.c pine3.95/imap/non-ANSI/c-client/pop3.c
--- pine3.95.dist/imap/non-ANSI/c-client/pop3.c	Thu Jan 16 22:12:34 1997
+++ pine3.95/imap/non-ANSI/c-client/pop3.c	Thu Mar 20 01:01:42 1997
@@ -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);
 }
 
 
diff -r -u pine3.95.dist/imap/non-ANSI/c-client/pop3.h pine3.95/imap/non-ANSI/c-client/pop3.h
--- pine3.95.dist/imap/non-ANSI/c-client/pop3.h	Mon Jun  6 22:28:51 1994
+++ pine3.95/imap/non-ANSI/c-client/pop3.h	Thu Mar 20 01:01:42 1997
@@ -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  ();
diff -r -u pine3.95.dist/imap/non-ANSI/c-client/tenex2.c pine3.95/imap/non-ANSI/c-client/tenex2.c
--- pine3.95.dist/imap/non-ANSI/c-client/tenex2.c	Thu Jan 16 22:12:34 1997
+++ pine3.95/imap/non-ANSI/c-client/tenex2.c	Thu Mar 20 01:01:42 1997
@@ -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);
 }
 
 
diff -r -u pine3.95.dist/imap/non-ANSI/c-client/tenex2.h pine3.95/imap/non-ANSI/c-client/tenex2.h
--- pine3.95.dist/imap/non-ANSI/c-client/tenex2.h	Sun Oct  2 22:44:05 1994
+++ pine3.95/imap/non-ANSI/c-client/tenex2.h	Thu Mar 20 01:01:42 1997
@@ -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  ();
diff -r -u pine3.95.dist/pico/makefile.lnx pine3.95/pico/makefile.lnx
--- pine3.95.dist/pico/makefile.lnx	Fri Apr  5 10:07:54 1996
+++ pine3.95/pico/makefile.lnx	Sun Dec 22 22:51:05 1996
@@ -32,9 +32,9 @@
 #
 
 #includes symbol for debugging
-DASHO=		-g
+#DASHO=		-g
 #for normal build
-#DASHO=		-O2
+DASHO=		-O2
 
 STDCFLAGS=	-Dlnx -DPOSIX -DJOB_CONTROL -DMOUSE
 CFLAGS=	 	$(EXTRACFLAGS) $(DASHO) $(STDCFLAGS)
diff -r -u pine3.95.dist/pine/init.c pine3.95/pine/init.c
--- pine3.95.dist/pine/init.c	Wed Jul 10 16:05:31 1996
+++ pine3.95/pine/init.c	Sun Jan 26 20:11:04 1997
@@ -1337,6 +1337,9 @@
 	{"disable-keymenu",			F_BLANK_KEYMENU},
 	{"disable-password-cmd",		F_DISABLE_PASSWORD_CMD},
 	{"disable-update-cmd",			F_DISABLE_UPDATE_CMD},
+#ifdef ALLOW_DISABLE_SENDER
+	{"disable-sender",			F_DISABLE_SENDER},
+#endif
 	{"disable-signature-edit-cmd",		F_DISABLE_SIGEDIT_CMD},
 	{"enable-8bit-esmtp-negotiation",	F_ENABLE_8BIT},
 	{"enable-8bit-nntp-posting",		F_ENABLE_8BIT_NNTP},
@@ -1381,6 +1384,9 @@
 	{"print-includes-from-line",		F_FROM_DELIM_IN_PRINT},
 	{"print-index-enabled",			F_PRINT_INDEX},
 	{"print-formfeed-between-messages",	F_AGG_PRINT_FF},
+#if defined( QMAIL_RETURN_PATH )
+	{"qmail-return-path",			F_QMAIL_RETURN_PATH},
+#endif
 	{"quell-dead-letter-on-cancel",		F_QUELL_DEAD_LETTER},
 	{"quell-lock-failure-warnings",		F_QUELL_LOCK_FAILURE_MSGS},
 	{"quell-status-message-beeping",	F_QUELL_BEEPS},
diff -r -u pine3.95.dist/pine/mailcmd.c pine3.95/pine/mailcmd.c
--- pine3.95.dist/pine/mailcmd.c	Thu Jan 16 22:12:35 1997
+++ pine3.95/pine/mailcmd.c	Thu Mar 20 01:01:41 1997
@@ -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;
diff -r -u pine3.95.dist/pine/makefile.lnx pine3.95/pine/makefile.lnx
--- pine3.95.dist/pine/makefile.lnx	Fri Mar 15 12:29:39 1996
+++ pine3.95/pine/makefile.lnx	Sun Dec 22 22:50:55 1996
@@ -50,9 +50,9 @@
 RM=          rm -f
 LN=          ln -s
 MAKE=        make
-OPTIMIZE=    # -O2
+OPTIMIZE=    -O2
 PROFILE=     # -pg
-DEBUG=       -g -DDEBUG
+DEBUG=       #-g -DDEBUG
 
 IMAPDIR=     ../c-client
 PICODIR=     ../pico
diff -r -u pine3.95.dist/pine/osdep/os-lnx.h pine3.95/pine/osdep/os-lnx.h
--- pine3.95.dist/pine/osdep/os-lnx.h	Wed Jun  5 10:13:29 1996
+++ pine3.95/pine/osdep/os-lnx.h	Sun Jan 26 20:08:29 1997
@@ -52,6 +52,9 @@
 
  ----*/
 
+#define ALLOW_DISABLE_SENDER
+#define QMAIL_RETURN_PATH
+
 /*----------------------------------------------------------------------
    Define this if you want the disk quota to be checked on startup.
    Of course, this only makes sense if your system has quotas.  If it doesn't,
@@ -68,7 +71,7 @@
    either default-composer-hdrs or customized-hdrs to get at the From
    header, even if this is set.
  ----*/
-/* #define ALLOW_CHANGING_FROM  /* comment out to not allow changing From */
+#define ALLOW_CHANGING_FROM  /* comment out to not allow changing From */
 
 
 
diff -r -u pine3.95.dist/pine/other.c pine3.95/pine/other.c
--- pine3.95.dist/pine/other.c	Wed Jul 10 16:05:59 1996
+++ pine3.95/pine/other.c	Sun Jan 26 20:16:41 1997
@@ -2484,6 +2484,10 @@
 	    return(h_config_cruise_mode_delete);
 	  case F_ALLOW_GOTO :
 	    return(h_config_allow_goto);
+	  case F_DISABLE_SENDER :
+	    return(h_config_disable_sender);
+	  case F_QMAIL_RETURN_PATH :
+	    return(h_config_qmail_return_path);
 	  default :
 	    return(NO_HELP);
         }
diff -r -u pine3.95.dist/pine/pine.h pine3.95/pine/pine.h
--- pine3.95.dist/pine/pine.h	Thu Jan 16 22:12:35 1997
+++ pine3.95/pine/pine.h	Thu Mar 20 02:20:15 1997
@@ -63,7 +63,7 @@
 #ifndef _PINE_INCLUDED
 #define _PINE_INCLUDED
 
-#define PINE_VERSION		"3.95q"
+#define PINE_VERSION		"3.95dg3"
 #define	PHONE_HOME_VERSION	"395"
 #define	PHONE_HOME_HOST		"docserver.cac.washington.edu"
 #define	UPDATE_FOLDER		"{pine.cac.washington.edu:144/anonymous}#news."
@@ -1153,7 +1153,9 @@
 #define	F_FROM_DELIM_IN_PRINT	   80
 #define	F_BACKGROUND_POST	   81
 #define	F_ALLOW_GOTO		   82
-#define F_LAST_FEATURE		   82		 /* RESET WITH NEW FEATURES */
+#define F_DISABLE_SENDER	   83
+#define F_QMAIL_RETURN_PATH	   84
+#define F_LAST_FEATURE		   84		 /* RESET WITH NEW FEATURES */
 
 #if (F_LAST_FEATURE > (LARGEST_BITMAP - 1))
    Whoa!  Too many features!
diff -r -u pine3.95.dist/pine/pine.hlp pine3.95/pine/pine.hlp
--- pine3.95.dist/pine/pine.hlp	Thu Jun 20 17:45:20 1996
+++ pine3.95/pine/pine.hlp	Thu Mar 20 01:01:41 1997
@@ -5571,6 +5571,27 @@
 two distant directories.
 
 <End of help on this topic>
+====== h_config_disable_sender =====
+        FEATURE: disable-sender
+
+Normally if the From: header does not match what pine thinks your email
+address is, it will generate a Sender: header (or X-Sender: depending on
+the use-sender-not-x-sender feature) with the address it thinks you
+are at.  This feature disables the generation of the Sender: header.
+
+<End of help on this topic>
+====== h_config_qmail_return_path =====
+        FEATURE: qmail-return-path
+
+The qmail mail transfer agent (see http://www.qmail.org/) will interpret a
+Return-Path: header as the envelope sender address.  This setting allows
+the Return-Path to be editted.  Additionally, if the Return-Path is not
+changed by the user then its value will default to whatever the From:
+header contains.  This is useful because qmail also allows a user to
+create addresses of the form userid-foobar@domain.edu.  It is also useful
+if the user uses different addresses for different functions.
+
+<End of help on this topic>
 ====== h_config_undo =====
 Yes, save changes and exit; No, exit without saving any changes made since
 entering this CONFIGURATION screen; ^C, cancel exit and stay in config screen.
@@ -5747,6 +5768,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.
diff -r -u pine3.95.dist/pine/send.c pine3.95/pine/send.c
--- pine3.95.dist/pine/send.c	Thu Jan 16 22:12:35 1997
+++ pine3.95/pine/send.c	Sun Jan 26 20:35:31 1997
@@ -50,7 +50,6 @@
 #include "../c-client/smtp.h"
 #include "../c-client/nntp.h"
 
-
 #ifndef TCPSTREAM
 #define TCPSTREAM void
 #endif
@@ -1126,7 +1125,12 @@
 #if	!(defined(DOS) || defined(OS2)) || defined(NOAUTH)
   {"",            "Sender",      NO_HELP,               10, 0, NULL,
    NULL,          NULL, NULL, NULL,                 NULL,
-   0, 0, 0, 0, 0, 0, 0, 0, 0, KS_NONE}
+   0, 0, 0, 0, 0, 0, 0, 0, 0, KS_NONE},
+#endif
+#if defined( QMAIL_RETURN_PATH )
+  {"Return-P: ",  "Return-Path",        h_composer_from,       10, 0, NULL,
+   build_address, NULL, NULL, addr_book_compose,    "To AddrBk",
+   0, 1, 0, 1, 0, 1, 0, 0, 0, KS_TOADDRBOOK}
 #endif
 };
 
@@ -1159,6 +1163,7 @@
 #define N_NOBODY  14
 #define	N_POSTERR 15
 #define N_SENDER  16
+#define N_RETURNPATH 17
 
 /* this is used in pine_send and pine_simple_send */
 /* name::type::canedit::writehdr::localcopy::rcptto */
@@ -1182,6 +1187,9 @@
 #if	!(defined(DOS) || defined(OS2)) || defined(NOAUTH)
   {"X-Sender",    Address,	0, 1, 1, 0},
 #endif
+#if defined( QMAIL_RETURN_PATH )
+  {"Return-Path", Address,	1, 1, 1, 0},
+#endif
   {NULL,         FreeText}
 };
 
@@ -1371,6 +1379,12 @@
 		pf->addr		= &outgoing->sender;
                 break;
 #endif
+#if defined( QMAIL_RETURN_PATH )
+	      case N_RETURNPATH:
+		sending_order[NN+13]	= pf;
+		pf->addr		= &outgoing->return_path;
+		break;
+#endif
 
               case N_NOBODY: /* won't be used here */
 		sending_order[NN+5]	= pf;
@@ -1953,7 +1967,7 @@
 	else
 	  index = i;
 
-	if(i > 16)
+	if(i > 17)
 	  q_status_message1(SM_ORDER,3,7,
 	      "Internal error: i=%d in pine_send", (void *)i);
 
@@ -2125,6 +2139,12 @@
 		pf->addr		= &outgoing->sender;
                 break;
 #endif
+#if	defined( QMAIL_RETURN_PATH )
+	      case N_RETURNPATH:
+		sending_order[NN+13]	= pf;
+		pf->addr		= &outgoing->return_path;
+		break;
+#endif
 
 	      default:
 		q_status_message1(SM_ORDER,3,7,
@@ -2186,7 +2206,7 @@
 		if(index == N_FROM && !*pf->addr)
 		  *pf->addr = generate_from();
 
-	    }else if(index == N_FROM || index == N_REPLYTO){
+	    }else if(index == N_FROM || index == N_REPLYTO || index == N_RETURNPATH){
 		/* side effect of this may set canedit */
 		set_default_hdrval(pf);
 	    }else if(pf->addr && *pf->addr && !(*pf->addr)->mailbox){
@@ -2552,6 +2572,9 @@
 	  mail_free_address(&outgoing->reply_to);
 #endif /* OLDWAY */
 
+#ifdef ALLOW_DISABLE_SENDER
+	if(!F_ON(F_DISABLE_SENDER, ps_global)){
+#endif
 	/*
 	 * Don't ever believe the sender that is there.
 	 * If From doesn't look quite right, generate our own sender.
@@ -2577,6 +2600,24 @@
 	    outgoing->sender->mailbox = cpystr(ps_global->VAR_USER_ID);
 	    outgoing->sender->host    = cpystr(ps_global->hostname);
 	}
+#ifdef ALLOW_DISABLE_SENDER
+	}
+#endif
+
+#ifdef QMAIL_RETURN_PATH
+	if(F_ON(F_QMAIL_RETURN_PATH, ps_global)){
+	  /*
+	   * If the user hasn't edited the Return-Path header then inherit
+	   * it from the From: header
+	   */
+	  pf = &pfields[N_RETURNPATH];
+	  if( !pf->he->dirty ) {
+	    if(outgoing->return_path)
+	      mail_free_address(&outgoing->return_path);
+	    outgoing->return_path = rfc822_cpy_adr(outgoing->from);
+	  }
+	}
+#endif
 
         /*----- Message is edited, now decide what to do with it ----*/
 	if(editor_result & (COMP_SUSPEND | COMP_GOTHUP | COMP_CANCEL)){
