From: Leonardo Taccari Date: Fri, 21 Aug 2015 17:26:53 +0000 (-0400) Subject: Add support for the -sendmail flag to send/post, to support changing the X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/4bd22a06b574acbafff8e6bd9bde5fd6bb048946?hp=8a1edeb17377d465644430b29cb04a4fe06d4a3b Add support for the -sendmail flag to send/post, to support changing the sendmail executable. --- diff --git a/docs/pending-release-notes b/docs/pending-release-notes index 334cfdd0..e9f60138 100644 --- a/docs/pending-release-notes +++ b/docs/pending-release-notes @@ -41,6 +41,8 @@ NEW FEATURES the preferred content types to show, if present in a multipart alternative. - mh-format now has %(kilo) and %(kibi) functions, to allow printing numbers as, for example, "10K", or "2.3Mi" +- Support for the -sendmail flag to send/post to change the sendmail + binary when using the sendmail/pipe MTS. ----------------- OBSOLETE FEATURES diff --git a/man/post.man b/man/post.man index a9745ee2..fe135381 100644 --- a/man/post.man +++ b/man/post.man @@ -24,6 +24,8 @@ post \- deliver a message .IR columns ] .RB [ \-mts .IR smtp " | " sendmail/smtp " | " sendmail/pipe ] +.RB [ \-sendmail +.IR program ] .RB [ \-server .IR servername ] .RB [ \-port @@ -184,6 +186,14 @@ but can be overriiden here with the .B \-mts switch. .PP +If nmh is using as its mail transport system +.BR sendmail/pipe , +the +.B \-sendmail +switch can be used to override the default +.B sendmail +program. +.PP If nmh is using the SMTP MTA, the .B \-server and the diff --git a/man/send.man b/man/send.man index 83333673..1673c5ce 100644 --- a/man/send.man +++ b/man/send.man @@ -32,6 +32,8 @@ send \- send a message .RB [ \-watch " | " \-nowatch ] .RB [ \-mts .IR smtp " | " sendmail/smtp " | " sendmail/pipe ] +.RB [ \-sendmail +.IR program ] .RB [ \-server .IR servername ] .RB [ \-port @@ -367,6 +369,14 @@ but can be overriiden here with the .B \-mts switch. .PP +If nmh is using as its mail transport system +.BR sendmail/pipe , +the +.B \-sendmail +switch can be used to override the default +.B sendmail +program. +.PP If nmh is using the SMTP MTA, the .B \-server and the diff --git a/uip/post.c b/uip/post.c index 685129b9..65526d23 100644 --- a/uip/post.c +++ b/uip/post.c @@ -87,6 +87,7 @@ X("notls", TLSminc(-5), NTLSSW) \ X("fileproc", -4, FILEPROCSW) \ X("mhlproc", -3, MHLPROCSW) \ + X("sendmail program", 0, MTSSM) \ X("mts smtp|sendmail/smtp|sendmail/pipe", 2, MTSSW) \ X("credentials legacy|file:filename", 0, CREDENTIALSSW) \ X("messageid localname|random", 2, MESSAGEIDSW) \ @@ -473,6 +474,12 @@ main (int argc, char **argv) mhlproc = cp; continue; + case MTSSM: + if (!(cp = *argp++) || *cp == '-') + adios (NULL, "missing argument to %s", argp[-2]); + sendmail = cp; + continue; + case MTSSW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); diff --git a/uip/send.c b/uip/send.c index 5885c98e..26ef89a8 100644 --- a/uip/send.c +++ b/uip/send.c @@ -69,6 +69,7 @@ X("tls", TLSminc(-3), TLSSW) \ X("initialtls", TLSminc(-10), INITTLSSW) \ X("notls", TLSminc(-5), NTLSSW) \ + X("sendmail program", 0, MTSSM) \ X("mts smtp|sendmail/smtp|sendmail/pipe", 2, MTSSW) \ X("messageid localname|random", 2, MESSAGEIDSW) \ @@ -256,6 +257,7 @@ main (int argc, char **argv) case SASLMXSSFSW: case USERSW: case PORTSW: + case MTSSM: case MTSSW: case MESSAGEIDSW: vec[vecp++] = --cp; diff --git a/uip/whatnowsbr.c b/uip/whatnowsbr.c index 207f1a8c..d8862dc9 100644 --- a/uip/whatnowsbr.c +++ b/uip/whatnowsbr.c @@ -953,6 +953,7 @@ buildfile (char **argp, char *file) X("tls", TLSminc(-3), TLSSW) \ X("initialtls", TLSminc(-10), INITTLSSW) \ X("notls", TLSminc(-5), NTLSSW) \ + X("sendmail program", 0, MTSSM) \ X("mts smtp|sendmail/smtp|sendmail/pipe", 2, MTSSW) \ X("messageid localname|random", 2, MESSAGEIDSW) \ @@ -1142,6 +1143,7 @@ sendit (char *sp, char **arg, char *file, int pushed) case SASLMECHSW: case USERSW: case PORTSW: + case MTSSM: case MTSSW: case MESSAGEIDSW: vec[vecp++] = --cp;