Renamed "sendmail" mts method to "sendmail/smtp", allowing "sendmail"
authorDavid Levine <levinedl@acm.org>
Tue, 10 Jul 2012 00:15:13 +0000 (19:15 -0500)
committerDavid Levine <levinedl@acm.org>
Tue, 10 Jul 2012 00:15:13 +0000 (19:15 -0500)
as an alias.  Renamed "pipe" to "sendmail/pipe".

14 files changed:
Makefile.am
configure.ac
docs/contrib/build_nmh
docs/pending-release-notes
etc/mts.conf.in
h/mts.h
man/mh-mail.man
man/mh-tailor.man
man/send.man
mts/smtp/smtp.c
sbr/mts.c
test/fakesendmail
test/post/test-sendmail-pipe [moved from test/post/test-pipe with 79% similarity]
uip/post.c

index 841c9ec..71cff27 100644 (file)
@@ -65,7 +65,7 @@ TESTS = test/ali/test-ali \
        test/post/test-post-basic test/post/test-post-multiple \
        test/post/test-post-dcc test/post/test-post-fcc \
        test/post/test-post-multifrom test/post/test-post-envelope \
        test/post/test-post-basic test/post/test-post-multiple \
        test/post/test-post-dcc test/post/test-post-fcc \
        test/post/test-post-multifrom test/post/test-post-envelope \
-       test/post/test-post-group test/post/test-pipe \
+       test/post/test-post-group test/post/test-sendmail-pipe \
        test/prompter/test-prompter \
        test/rcv/test-rcvdist test/rcv/test-rcvpack test/rcv/test-rcvstore \
        test/refile/test-refile \
        test/prompter/test-prompter \
        test/rcv/test-rcvdist test/rcv/test-rcvpack test/rcv/test-rcvstore \
        test/refile/test-refile \
index eaa60b3..77f4165 100644 (file)
@@ -111,12 +111,13 @@ AC_ARG_ENABLE([lockdir],
 
 dnl What method of posting should post use?
 AC_ARG_WITH([mts],
 
 dnl What method of posting should post use?
 AC_ARG_WITH([mts],
-  AS_HELP_STRING([--with-mts=@<:@smtp|sendmail|pipe@:>@],
+  AS_HELP_STRING([--with-mts=@<:@smtp|sendmail/smtp|sendmail/pipe@:>@],
   [specify the default mail transport agent/service]))
 
 AS_IF([test x"$with_mts" = x"smtp"], [MTS="smtp"],
   [specify the default mail transport agent/service]))
 
 AS_IF([test x"$with_mts" = x"smtp"], [MTS="smtp"],
-      [test x"$with_mts" = x"sendmail"], [MTS="sendmail"],
-      [test x"$with_mts" = x"pipe"], [MTS="pipe"],
+      [test x"$with_mts" = x"sendmail"], [MTS="sendmail/smtp"],
+      [test x"$with_mts" = x"sendmail/smtp"], [MTS="sendmail/smtp"],
+      [test x"$with_mts" = x"sendmail/pipe"], [MTS="sendmail/pipe"],
       [MTS="smtp"])
 AC_SUBST([MTS])dnl
 
       [MTS="smtp"])
 AC_SUBST([MTS])dnl
 
index e1905f9..7d46fe7 100755 (executable)
@@ -174,7 +174,7 @@ if [ $yes -eq 0 ]; then
   read locking
   [ "$locking" ]  &&  config_locking="$locking"
 
   read locking
   [ "$locking" ]  &&  config_locking="$locking"
 
-  printf 'MTS (smtp|sendmail|pipe) [%s]: ' $config_mts
+  printf 'MTS (smtp|sendmail/smtp|sendmail/pipe) [%s]: ' $config_mts
   read mts
   [ "$mts" ]  &&  config_mts="$mts"
 
   read mts
   [ "$mts" ]  &&  config_mts="$mts"
 
index f7462a7..dd8c395 100644 (file)
@@ -39,13 +39,14 @@ OBSOLETE/DEPRECATED FEATURES
   http://smtpfilter.sourceforge.net/esmtp.html
 - conflict(8) is deprecated and will be removed from the next release.
 - mhtest(8) is deprecated and will be removed from the next release.
   http://smtpfilter.sourceforge.net/esmtp.html
 - conflict(8) is deprecated and will be removed from the next release.
 - mhtest(8) is deprecated and will be removed from the next release.
-- spost(8) has been merged into post(8).  Its functionality is enabled
-  by selecting the pipe mail transport method in etc/mts.conf, which
-  in turn can be configured using --with-mts=pipe.  The spost
-  -noalias, -backup/-nobackup, -push/-nopush, and -remove/-noremove
-  switches are not supported by post.  Note that spost did not support
-  -whom or Dcc, and neither does post when using mts: pipe.  spost is
-  deprecated and will be removed from the next release.
+- spost(8) has been merged into post(8).  Its functionality is
+  enabled by selecting the sendmail/pipe mail transport method in
+  etc/mts.conf, which in turn can be configured using
+  --with-mts=sendmail/pipe.  The spost -noalias, -backup/-nobackup,
+  -push/-nopush, and -remove/-noremove switches are not supported by
+  post.  Note that spost did not support -whom or Dcc, and neither
+  does post when using mts: pipe.  spost is deprecated and will be
+  removed from the next release.
 
 ---------
 BUG FIXES
 
 ---------
 BUG FIXES
index 7cb0a4d..4e3deda 100644 (file)
@@ -5,14 +5,14 @@
 #
 
 # The delivery method to use, which must be one of the following:
 #
 
 # The delivery method to use, which must be one of the following:
-# smtp:     nmh opens a socket connection to the appropriate port
-#           on the servers listed below and speaks SMTP to the
-#           first one that responds.  This is the default.
-# sendmail: nmh pipes messages directly to the sendmail program,
-#           speaking SMTP.
-# pipe:     nmh pipes messages directly to the sendmail program,
-#           using the -t option so that addresses are retrieved
-#           from the message.
+# smtp:          nmh opens a socket connection to the appropriate port
+#                on the servers listed below and speaks SMTP to the
+#                first one that responds.  This is the default.
+# sendmail/smtp: nmh pipes messages directly to the sendmail program,
+#                speaking SMTP.  Can be abbreviated to "sendmail".
+# sendmail/pipe: nmh pipes messages directly to the sendmail program,
+#                using the -t option so that addresses are retrieved
+#                from the message.
 mts: %mts%
 
 # Name that nmh considers `local'.  If not set, nmh will
 mts: %mts%
 
 # Name that nmh considers `local'.  If not set, nmh will
diff --git a/h/mts.h b/h/mts.h
index 8496c28..ab78973 100644 (file)
--- a/h/mts.h
+++ b/h/mts.h
@@ -42,10 +42,10 @@ void mts_init (char *);
  * MTS specific variables
  */
 
  * MTS specific variables
  */
 
-/* whether to speak SMTP to localhost:25 or to /usr/sbin/sendmail */
-#define MTS_SMTP     0
-#define MTS_SENDMAIL 1
-#define MTS_PIPE     2
+/* whether to speak SMTP, and over the network or directly to sendmail */
+#define MTS_SMTP          0
+#define MTS_SENDMAIL_SMTP 1
+#define MTS_SENDMAIL_PIPE 2
 extern int sm_mts;
 
 extern char *sendmail;
 extern int sm_mts;
 
 extern char *sendmail;
index 30506e9..21d9e22 100644 (file)
@@ -182,7 +182,7 @@ line receive the same messsage as recipients on the \*(lqTo:\*(rq and
 for more details.
 .B Dcc
 is not supported with the
 for more details.
 .B Dcc
 is not supported with the
-.B pipe
+.B sendmail/pipe
 mail transport method.
 .RE
 .PP
 mail transport method.
 .RE
 .PP
index 9e29a05..a509ea6 100644 (file)
@@ -32,9 +32,9 @@ default values and a description of their meanings are listed below:
 The mail transport method to use.  The three acceptable options are
 .B smtp
 (which is the default),
 The mail transport method to use.  The three acceptable options are
 .B smtp
 (which is the default),
-.BR sendmail ,
+.BR sendmail/smtp ,
 and
 and
-.BR pipe .
+.BR sendmail/pipe .
 .PP
 If you use
 .BR smtp ,
 .PP
 If you use
 .BR smtp ,
@@ -50,7 +50,7 @@ to the mail port on the machine specified in the
 entry.
 .PP
 If you use
 entry.
 .PP
 If you use
-.BR sendmail ,
+.BR sendmail/smtp ,
 then
 .B post
 will send messages by forking a
 then
 .B post
 will send messages by forking a
@@ -60,7 +60,7 @@ It will still speak SMTP with this local copy of
 .BR sendmail .
 .PP
 The third alternative,
 .BR sendmail .
 .PP
 The third alternative,
-.BR pipe ,
+.BR sendmail/pipe ,
 also forks a local copy of
 .B sendmail
 but feeds the message directly to it, using
 also forks a local copy of
 .B sendmail
 but feeds the message directly to it, using
index b823517..bb86079 100644 (file)
@@ -255,7 +255,7 @@ new message with a minimal set of headers.  Included in the body of the
 message will be a copy of the message sent to the sighted recipients.
 .PP
 If a \*(lqDcc:\*(rq field is encountered and the
 message will be a copy of the message sent to the sighted recipients.
 .PP
 If a \*(lqDcc:\*(rq field is encountered and the
-.B pipe
+.B sendmail/pipe
 mail transport method is not in use, its addresses will be used for
 delivery, and the \*(lqDcc:\*(rq field will be removed from the message.  The
 blind recipients will receive the same message sent to the sighted
 mail transport method is not in use, its addresses will be used for
 delivery, and the \*(lqDcc:\*(rq field will be removed from the message.  The
 blind recipients will receive the same message sent to the sighted
index c18b89b..00df119 100644 (file)
@@ -768,7 +768,7 @@ sm_end (int type)
     int status;
     struct smtp sm_note;
 
     int status;
     struct smtp sm_note;
 
-    if (sm_mts == MTS_SENDMAIL) {
+    if (sm_mts == MTS_SENDMAIL_SMTP) {
        switch (sm_child) {
            case NOTOK: 
            case OK: 
        switch (sm_child) {
            case NOTOK: 
            case OK: 
index 661975b..d28f285 100644 (file)
--- a/sbr/mts.c
+++ b/sbr/mts.c
@@ -63,7 +63,7 @@ static char localmbox[BUFSIZ];
  * MTS specific variables
  */
 static char *sm_method = "smtp";
  * MTS specific variables
  */
 static char *sm_method = "smtp";
-int  sm_mts    = MTS_SMTP;
+int  sm_mts    = MTS_SENDMAIL_SMTP;
 char *sendmail = SENDMAILPATH;
 
 /*
 char *sendmail = SENDMAILPATH;
 
 /*
@@ -148,13 +148,13 @@ mts_init (char *name)
 
     if (strcmp(sm_method, "smtp") == 0)
         sm_mts = MTS_SMTP;
 
     if (strcmp(sm_method, "smtp") == 0)
         sm_mts = MTS_SMTP;
-    else if (strcmp(sm_method, "sendmail") == 0)
-        sm_mts = MTS_SENDMAIL;
-    else if (strcmp(sm_method, "pipe") == 0)
-        sm_mts = MTS_PIPE;
+    else if (strcmp(sm_method, "sendmail/smtp") == 0)
+        sm_mts = MTS_SENDMAIL_SMTP;
+    else if (strcmp(sm_method, "sendmail/pipe") == 0)
+        sm_mts = MTS_SENDMAIL_PIPE;
     else {
         advise(NULL, "unsupported \"mts\" value in mts.conf: %s", sm_method);
     else {
         advise(NULL, "unsupported \"mts\" value in mts.conf: %s", sm_method);
-        sm_mts = MTS_SMTP;
+        sm_mts = MTS_SENDMAIL_SMTP;
     }
 }
 
     }
 }
 
index c3bc4e1..fb959e2 100755 (executable)
@@ -1,7 +1,7 @@
 #! /bin/sh
 ##
 # fakesendmail - A fake sendmail program used by the nmh test suite
 #! /bin/sh
 ##
 # fakesendmail - A fake sendmail program used by the nmh test suite
-#                to test the pipe mts.
+#                to test the sendmail/pipe mts.
 #
 # This code is Copyright (c) 2012, by the authors of nmh.  See the
 # COPYRIGHT file in the root directory of the nmh distribution for
 #
 # This code is Copyright (c) 2012, by the authors of nmh.  See the
 # COPYRIGHT file in the root directory of the nmh distribution for
similarity index 79%
rename from test/post/test-pipe
rename to test/post/test-sendmail-pipe
index c9048ed..22f9e7d 100755 (executable)
@@ -1,6 +1,7 @@
 #!/bin/sh
 #
 #!/bin/sh
 #
-# Test the basic behavior of post when configured with pipe delivery method.
+# Test the basic behavior of post when configured with sendmail/pipe
+# delivery method.
 #
 
 set -e
 #
 
 set -e
@@ -15,13 +16,13 @@ fi
 setup_test
 testname="${MH_TEST_DIR}/$$"
 
 setup_test
 testname="${MH_TEST_DIR}/$$"
 
-#### Force test of pipe regardless of configuration.
+#### Force test of sendmail/pipe regardless of configuration.
 mts_pipe="${MHMTSCONF}-pipe"
 mts_pipe="${MHMTSCONF}-pipe"
-sed -e 's/mts: *.*/mts: pipe/' "${MHMTSCONF}" >"$mts_pipe"
+sed -e 's/mts: *.*/mts: sendmail\/pipe/' "${MHMTSCONF}" >"$mts_pipe"
 printf "%s\n" "sendmail: ${srcdir}/test/fakesendmail" >>"$mts_pipe"
 MHMTSCONF="$mts_pipe"
 
 printf "%s\n" "sendmail: ${srcdir}/test/fakesendmail" >>"$mts_pipe"
 MHMTSCONF="$mts_pipe"
 
-test_pipe ()
+test_sendmail_pipe ()
 {
   send -draft
 
 {
   send -draft
 
@@ -49,8 +50,9 @@ test_pipe ()
 }
 
 #
 }
 
 #
-# Basic test - Simple message, single user, single recipient.
-# Dots are not stuffed because pipe invokes sendmail with -i.
+# Basic test - Simple message, single user, single recipient.  Dots
+# are not stuffed because sendmail/pipe causes sendmail to be invoked
+# with -i.
 #
 cat > "${MH_TEST_DIR}/Mail/draft" <<EOF
 From: Mr Nobody <nobody@example.com>
 #
 cat > "${MH_TEST_DIR}/Mail/draft" <<EOF
 From: Mr Nobody <nobody@example.com>
@@ -71,7 +73,7 @@ This is a test
 .
 EOF
 
 .
 EOF
 
-test_pipe "${testname}.expected"
+test_sendmail_pipe "${testname}.expected"
 
 
 # check Bcc
 
 
 # check Bcc
@@ -112,7 +114,7 @@ This is a test
 ------- End of Blind-Carbon-Copy
 EOF
 
 ------- End of Blind-Carbon-Copy
 EOF
 
-test_pipe "${testname}.expected1" "${testname}.expected2"
+test_sendmail_pipe "${testname}.expected1" "${testname}.expected2"
 
 
 rm -f ${MHMTSCONF}
 
 
 rm -f ${MHMTSCONF}
index f63a286..08c62eb 100644 (file)
@@ -144,32 +144,32 @@ struct headers {
 /*
  * flags for headers->flags
  */
 /*
  * flags for headers->flags
  */
-#define        HNOP  0x0000        /* just used to keep .set around             */
-#define        HBAD  0x0001        /* bad header - don't let it through         */
-#define        HADR  0x0002        /* header has an address field               */
-#define        HSUB  0x0004        /* Subject: header                           */
-#define        HTRY  0x0008        /* try to send to addrs on header            */
-#define        HBCC  0x0010        /* don't output this header, unless MTS_PIPE */
-#define        HMNG  0x0020        /* munge this header                         */
-#define        HNGR  0x0040        /* no groups allowed in this header          */
-#define        HFCC  0x0080        /* FCC: type header                          */
-#define        HNIL  0x0100        /* okay for this header not to have addrs    */
-#define        HIGN  0x0200        /* ignore this header                        */
-#define        HDCC  0x0400        /* another undocumented feature              */
-#define HONE  0x0800       /* Only (zero or) one address allowed        */
-#define HEFM  0x1000       /* Envelope-From: header                     */
+#define        HNOP  0x0000    /* just used to keep .set around                      */
+#define        HBAD  0x0001    /* bad header - don't let it through                  */
+#define        HADR  0x0002    /* header has an address field                        */
+#define        HSUB  0x0004    /* Subject: header                                    */
+#define        HTRY  0x0008    /* try to send to addrs on header                     */
+#define        HBCC  0x0010    /* don't output this header, unless MTS_SENDMAIL_PIPE */
+#define        HMNG  0x0020    /* munge this header                                  */
+#define        HNGR  0x0040    /* no groups allowed in this header                   */
+#define        HFCC  0x0080    /* FCC: type header                                   */
+#define        HNIL  0x0100    /* okay for this header not to have addrs             */
+#define        HIGN  0x0200    /* ignore this header                                 */
+#define        HDCC  0x0400    /* another undocumented feature                       */
+#define HONE  0x0800   /* Only (zero or) one address allowed                 */
+#define HEFM  0x1000   /* Envelope-From: header                              */
 
 /*
  * flags for headers->set
  */
 
 /*
  * flags for headers->set
  */
-#define        MFRM  0x0001            /* we've seen a From:        */
-#define        MDAT  0x0002            /* we've seen a Date:        */
-#define        MRFM  0x0004            /* we've seen a Resent-From: */
-#define        MVIS  0x0008            /* we've seen sighted addrs  */
-#define        MINV  0x0010            /* we've seen blind addrs    */
-#define MSND  0x0020           /* we've seen a Sender:      */
-#define MRSN  0x0040           /* We've seen a Resent-Sendr:*/
-#define MEFM  0x0080           /* We've seen Envelope-From: */
+#define        MFRM  0x0001    /* we've seen a From:        */
+#define        MDAT  0x0002    /* we've seen a Date:        */
+#define        MRFM  0x0004    /* we've seen a Resent-From: */
+#define        MVIS  0x0008    /* we've seen sighted addrs  */
+#define        MINV  0x0010    /* we've seen blind addrs    */
+#define MSND  0x0020   /* we've seen a Sender:      */
+#define MRSN  0x0040   /* We've seen a Resent-Sendr:*/
+#define MEFM  0x0080   /* We've seen Envelope-From: */
 
 
 static struct headers NHeaders[] = {
 
 
 static struct headers NHeaders[] = {
@@ -634,7 +634,7 @@ main (int argc, char **argv)
 
     /* If we are doing a "whom" check */
     if (whomsw) {
 
     /* If we are doing a "whom" check */
     if (whomsw) {
-       /* This won't work with MTS_PIPE. */
+       /* This won't work with MTS_SENDMAIL_PIPE. */
        verify_all_addresses (1, envelope);
        done (0);
     }
        verify_all_addresses (1, envelope);
        done (0);
     }
@@ -642,11 +642,11 @@ main (int argc, char **argv)
     if (msgflags & MINV) {
        make_bcc_file (dashstuff);
        if (msgflags & MVIS) {
     if (msgflags & MINV) {
        make_bcc_file (dashstuff);
        if (msgflags & MVIS) {
-           if (sm_mts != MTS_PIPE) {
+           if (sm_mts != MTS_SENDMAIL_PIPE) {
                /* It would be nice to have support to call
                /* It would be nice to have support to call
-                  verify_all_addresses with MTS_PIPE, but that might
-                  require running sendmail as root.  Note that spost
-                  didn't verify addresses. */
+                  verify_all_addresses with MTS_SENDMAIL_PIPE, but
+                  that might require running sendmail as root.  Note
+                  that spost didn't verify addresses. */
                verify_all_addresses (verbose, envelope);
            }
            post (tmpfil, 0, verbose, envelope);
                verify_all_addresses (verbose, envelope);
            }
            post (tmpfil, 0, verbose, envelope);
@@ -1065,7 +1065,8 @@ putadr (char *name, char *aka, struct mailname *mp, FILE *out, unsigned int flag
 
     if (mp->m_mbox == NULL || ((flags & HTRY) && !insert (mp)))
        return 0;
 
     if (mp->m_mbox == NULL || ((flags & HTRY) && !insert (mp)))
        return 0;
-    if (sm_mts != MTS_PIPE && ((flags & (HBCC | HDCC | HEFM)) || mp->m_ingrp))
+    if (sm_mts != MTS_SENDMAIL_PIPE &&
+        ((flags & (HBCC | HDCC | HEFM)) || mp->m_ingrp))
        return 1;
 
     if (!nameoutput) {
        return 1;
 
     if (!nameoutput) {
@@ -1109,7 +1110,7 @@ putgrp (char *name, char *group, FILE *out, unsigned int flags)
     int len;
     char *cp;
 
     int len;
     char *cp;
 
-    if (sm_mts != MTS_PIPE && (flags & HBCC))
+    if (sm_mts != MTS_SENDMAIL_PIPE && (flags & HBCC))
        return;
 
     if (!nameoutput) {
        return;
 
     if (!nameoutput) {
@@ -1486,7 +1487,7 @@ post (char *file, int bccque, int talk, char *envelope)
 
     sigon ();
 
 
     sigon ();
 
-    if (sm_mts == MTS_PIPE) {
+    if (sm_mts == MTS_SENDMAIL_PIPE) {
        char *sargv[16], **argp;
 
        for (i = 0; (child_id = fork()) == NOTOK && i < 5; i++)
        char *sargv[16], **argp;
 
        for (i = 0; (child_id = fork()) == NOTOK && i < 5; i++)