searchheaders
authorEdward Wang <edward@ucbvax.Berkeley.EDU>
Wed, 18 Nov 1992 13:40:51 +0000 (05:40 -0800)
committerEdward Wang <edward@ucbvax.Berkeley.EDU>
Wed, 18 Nov 1992 13:40:51 +0000 (05:40 -0800)
SCCS-vsn: usr.bin/mail/list.c 5.16
SCCS-vsn: usr.bin/mail/mail.1 6.20

usr/src/usr.bin/mail/list.c
usr/src/usr.bin/mail/mail.1

index 7d06f65..12021c6 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)list.c     5.15 (Berkeley) %G%";
+static char sccsid[] = "@(#)list.c     5.16 (Berkeley) %G%";
 #endif /* not lint */
 
 #include "rcv.h"
 #endif /* not lint */
 
 #include "rcv.h"
@@ -667,8 +667,15 @@ matchsubj(str, mesg)
         * Now look, ignoring case, for the word in the string.
         */
 
         * Now look, ignoring case, for the word in the string.
         */
 
-       cp = str;
-       cp2 = hfield("subject", mp);
+       if (value("searchheaders") && (cp = index(str, ':'))) {
+               *cp++ = '\0';
+               cp2 = hfield(str, mp);
+               cp[-1] = ':';
+               str = cp;
+       } else {
+               cp = str;
+               cp2 = hfield("subject", mp);
+       }
        if (cp2 == NOSTR)
                return(0);
        backup = cp2;
        if (cp2 == NOSTR)
                return(0);
        backup = cp2;
index 24c16d4..962302d 100644 (file)
@@ -3,7 +3,7 @@
 .\"
 .\" %sccs.include.redist.roff%
 .\"
 .\"
 .\" %sccs.include.redist.roff%
 .\"
-.\"    @(#)mail.1      6.19 (Berkeley) %G%
+.\"    @(#)mail.1      6.20 (Berkeley) %G%
 .\"
 .Dd 
 .Dt MAIL 1
 .\"
 .Dd 
 .Dt MAIL 1
@@ -852,6 +852,10 @@ and
 commands.
 .It Ar quiet
 Suppresses the printing of the version when first invoked.
 commands.
 .It Ar quiet
 Suppresses the printing of the version when first invoked.
+.It Ar searchheaders
+If this option is set, then a message-list specifier in the form ``/x:y''
+will expand to all messages containing the substring ``y'' in the header
+field ``x''.  The string search is case insensitive.
 .It Ar verbose
 Setting the option
 .Ar verbose
 .It Ar verbose
 Setting the option
 .Ar verbose