added option sendmail which lets you specify what program to use to
authorKurt A. Shoens <kurt@ucbvax.Berkeley.EDU>
Tue, 19 May 1981 06:53:11 +0000 (22:53 -0800)
committerKurt A. Shoens <kurt@ucbvax.Berkeley.EDU>
Tue, 19 May 1981 06:53:11 +0000 (22:53 -0800)
actually send the mail

SCCS-vsn: usr.bin/mail/send.c 1.6

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

index f90993e..4d96e7c 100644 (file)
@@ -12,7 +12,7 @@
  * Mail to others.
  */
 
  * Mail to others.
  */
 
-static char *SccsId = "@(#)send.c      1.5 %G%";
+static char *SccsId = "@(#)send.c      1.6 %G%";
 
 /*
  * Send message described by the passed pointer to the
 
 /*
  * Send message described by the passed pointer to the
@@ -187,7 +187,7 @@ mail1(hp)
 {
        register char *cp;
        int pid, i, s, p, gotcha;
 {
        register char *cp;
        int pid, i, s, p, gotcha;
-       char **namelist;
+       char **namelist, *deliver;
        struct name *to, *np;
        FILE *mtf, *postage;
        int remote = rflag != NOSTR || rmail;
        struct name *to, *np;
        FILE *mtf, *postage;
        int remote = rflag != NOSTR || rmail;
@@ -326,7 +326,9 @@ topdog:
                submit(getpid());
 #endif CC
 #ifdef DELIVERMAIL
                submit(getpid());
 #endif CC
 #ifdef DELIVERMAIL
-               execv(DELIVERMAIL, namelist);
+               if ((deliver = value("sendmail")) == NOSTR)
+                       deliver = DELIVERMAIL;
+               execv(deliver, namelist);
 #endif DELIVERMAIL
                execv(MAIL, namelist);
                perror(MAIL);
 #endif DELIVERMAIL
                execv(MAIL, namelist);
                perror(MAIL);