removed support for -r, -h, and rmail
authorEdward Wang <edward@ucbvax.Berkeley.EDU>
Sun, 19 Jun 1988 05:54:16 +0000 (21:54 -0800)
committerEdward Wang <edward@ucbvax.Berkeley.EDU>
Sun, 19 Jun 1988 05:54:16 +0000 (21:54 -0800)
SCCS-vsn: usr.bin/mail/names.c 5.8
SCCS-vsn: usr.bin/mail/send.c 5.10

usr/src/usr.bin/mail/names.c
usr/src/usr.bin/mail/send.c

index 0a1c7ea..fb3f7b7 100644 (file)
@@ -11,7 +11,7 @@
  */
 
 #ifdef notdef
  */
 
 #ifdef notdef
-static char sccsid[] = "@(#)names.c    5.7 (Berkeley) %G%";
+static char sccsid[] = "@(#)names.c    5.8 (Berkeley) %G%";
 #endif /* notdef */
 
 /*
 #endif /* notdef */
 
 /*
@@ -517,7 +517,6 @@ unpack(np)
 {
        register char **ap, **top;
        register struct name *n;
 {
        register char **ap, **top;
        register struct name *n;
-       char hbuf[10];
        int t, extra, metoo, verbose;
 
        n = np;
        int t, extra, metoo, verbose;
 
        n = np;
@@ -528,12 +527,10 @@ unpack(np)
         * Compute the number of extra arguments we will need.
         * We need at least two extra -- one for "mail" and one for
         * the terminating 0 pointer.  Additional spots may be needed
         * Compute the number of extra arguments we will need.
         * We need at least two extra -- one for "mail" and one for
         * the terminating 0 pointer.  Additional spots may be needed
-        * to pass along -r and -f to the host mailer.
+        * to pass along -f to the host mailer.
         */
 
        extra = 2;
         */
 
        extra = 2;
-       if (rflag != NOSTR)
-               extra += 2;
        extra++;
        metoo = value("metoo") != NOSTR;
        if (metoo)
        extra++;
        metoo = value("metoo") != NOSTR;
        if (metoo)
@@ -541,24 +538,14 @@ unpack(np)
        verbose = value("verbose") != NOSTR;
        if (verbose)
                extra++;
        verbose = value("verbose") != NOSTR;
        if (verbose)
                extra++;
-       if (hflag)
-               extra += 2;
        top = (char **) salloc((t + extra) * sizeof *top);
        ap = top;
        *ap++ = "send-mail";
        top = (char **) salloc((t + extra) * sizeof *top);
        ap = top;
        *ap++ = "send-mail";
-       if (rflag != NOSTR) {
-               *ap++ = "-r";
-               *ap++ = rflag;
-       }
        *ap++ = "-i";
        if (metoo)
                *ap++ = "-m";
        if (verbose)
                *ap++ = "-v";
        *ap++ = "-i";
        if (metoo)
                *ap++ = "-m";
        if (verbose)
                *ap++ = "-v";
-       if (hflag) {
-               *ap++ = "-h";
-               *ap++ = savestr(sprintf(hbuf, "%d", hflag));
-       }
        while (n != NIL) {
                if (n->n_type & GDEL) {
                        n = n->n_flink;
        while (n != NIL) {
                if (n->n_type & GDEL) {
                        n = n->n_flink;
@@ -571,24 +558,6 @@ unpack(np)
        return(top);
 }
 
        return(top);
 }
 
-/*
- * See if the user named himself as a destination
- * for outgoing mail.  If so, set the global flag
- * selfsent so that we avoid removing his mailbox.
- */
-
-mechk(names)
-       struct name *names;
-{
-       register struct name *np;
-
-       for (np = names; np != NIL; np = np->n_flink)
-               if ((np->n_type & GDEL) == 0 && equal(np->n_name, myname)) {
-                       selfsent++;
-                       return;
-               }
-}
-
 /*
  * Remove all of the duplicates from the passed name list by
  * insertion sorting them, then checking for dups.
 /*
  * Remove all of the duplicates from the passed name list by
  * insertion sorting them, then checking for dups.
index 6aa401e..a8c8118 100644 (file)
@@ -11,7 +11,7 @@
  */
 
 #ifdef notdef
  */
 
 #ifdef notdef
-static char sccsid[] = "@(#)send.c     5.9 (Berkeley) %G%";
+static char sccsid[] = "@(#)send.c     5.10 (Berkeley) %G%";
 #endif /* notdef */
 
 #include "rcv.h"
 #endif /* notdef */
 
 #include "rcv.h"
@@ -237,7 +237,6 @@ mail1(hp)
        struct name *to, *np;
        struct stat sbuf;
        FILE *mtf, *postage;
        struct name *to, *np;
        struct stat sbuf;
        FILE *mtf, *postage;
-       int remote = rflag != NOSTR || rmail;
        char **t;
 
        /*
        char **t;
 
        /*
@@ -280,9 +279,8 @@ mail1(hp)
 
        to = outof(to, mtf, hp);
        rewind(mtf);
 
        to = outof(to, mtf, hp);
        rewind(mtf);
-       if (senderr && !remote) {
+       if (senderr) {
 topdog:
 topdog:
-
                if (fsize(mtf) != 0) {
                        (void) remove(deadletter);
                        (void) exwrite(deadletter, mtf, 1);
                if (fsize(mtf) != 0) {
                        (void) remove(deadletter);
                        (void) exwrite(deadletter, mtf, 1);
@@ -297,10 +295,9 @@ topdog:
        if (!gotcha)
                goto out;
        to = elide(to);
        if (!gotcha)
                goto out;
        to = elide(to);
-       mechk(to);
        if (count(to) > 1)
                hp->h_seq++;
        if (count(to) > 1)
                hp->h_seq++;
-       if (hp->h_seq > 0 && !remote) {
+       if (hp->h_seq > 0) {
                fixhead(hp, to);
                if (fsize(mtf) == 0)
                    if (hp->h_subject == NOSTR)
                fixhead(hp, to);
                if (fsize(mtf) == 0)
                    if (hp->h_subject == NOSTR)
@@ -344,11 +341,9 @@ topdog:
        }
        if (pid == 0) {
 #ifdef SIGTSTP
        }
        if (pid == 0) {
 #ifdef SIGTSTP
-               if (remote == 0) {
-                       (void) signal(SIGTSTP, SIG_IGN);
-                       (void) signal(SIGTTIN, SIG_IGN);
-                       (void) signal(SIGTTOU, SIG_IGN);
-               }
+               (void) signal(SIGTSTP, SIG_IGN);
+               (void) signal(SIGTTIN, SIG_IGN);
+               (void) signal(SIGTTOU, SIG_IGN);
 #endif
                (void) signal(SIGHUP, SIG_IGN);
                (void) signal(SIGINT, SIG_IGN);
 #endif
                (void) signal(SIGHUP, SIG_IGN);
                (void) signal(SIGINT, SIG_IGN);
@@ -371,7 +366,7 @@ topdog:
        }
 
 out:
        }
 
 out:
-       if (remote || (value("verbose") != NOSTR)) {
+       if (value("verbose") != NOSTR) {
                while ((p = wait(&s)) != pid && p != -1)
                        ;
                if (s.w_status != 0)
                while ((p = wait(&s)) != pid && p != -1)
                        ;
                if (s.w_status != 0)
@@ -539,7 +534,6 @@ savemail(name, fi)
        char buf[BUFSIZ];
        register i;
        time_t now, time();
        char buf[BUFSIZ];
        register i;
        time_t now, time();
-       char *n;
        char *ctime();
 
        if ((fo = fopen(name, "a")) == NULL) {
        char *ctime();
 
        if ((fo = fopen(name, "a")) == NULL) {
@@ -547,9 +541,7 @@ savemail(name, fi)
                return (-1);
        }
        (void) time(&now);
                return (-1);
        }
        (void) time(&now);
-       if ((n = rflag) == NOSTR)
-               n = myname;
-       fprintf(fo, "From %s %s", n, ctime(&now));
+       fprintf(fo, "From %s %s", myname, ctime(&now));
        rewind(fi);
        while ((i = fread(buf, 1, sizeof buf, fi)) > 0)
                (void) fwrite(buf, 1, i, fo);
        rewind(fi);
        while ((i = fread(buf, 1, sizeof buf, fi)) > 0)
                (void) fwrite(buf, 1, i, fo);