as an alias. Renamed "pipe" to "sendmail/pipe".
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 \
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"],
- [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
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"
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
#
# 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 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;
for more details.
.B Dcc
is not supported with the
-.B pipe
+.B sendmail/pipe
mail transport method.
.RE
.PP
The mail transport method to use. The three acceptable options are
.B smtp
(which is the default),
-.BR sendmail ,
+.BR sendmail/smtp ,
and
-.BR pipe .
+.BR sendmail/pipe .
.PP
If you use
.BR smtp ,
entry.
.PP
If you use
-.BR sendmail ,
+.BR sendmail/smtp ,
then
.B post
will send messages by forking a
.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
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
int status;
struct smtp sm_note;
- if (sm_mts == MTS_SENDMAIL) {
+ if (sm_mts == MTS_SENDMAIL_SMTP) {
switch (sm_child) {
case NOTOK:
case OK:
* MTS specific variables
*/
static char *sm_method = "smtp";
-int sm_mts = MTS_SMTP;
+int sm_mts = MTS_SENDMAIL_SMTP;
char *sendmail = SENDMAILPATH;
/*
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);
- sm_mts = MTS_SMTP;
+ sm_mts = MTS_SENDMAIL_SMTP;
}
}
#! /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
#!/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
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"
-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"
-test_pipe ()
+test_sendmail_pipe ()
{
send -draft
}
#
-# 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>
.
EOF
-test_pipe "${testname}.expected"
+test_sendmail_pipe "${testname}.expected"
# check Bcc
------- End of Blind-Carbon-Copy
EOF
-test_pipe "${testname}.expected1" "${testname}.expected2"
+test_sendmail_pipe "${testname}.expected1" "${testname}.expected2"
rm -f ${MHMTSCONF}
/*
* 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
*/
-#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[] = {
/* 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);
}
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
- 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);
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) {
int len;
char *cp;
- if (sm_mts != MTS_PIPE && (flags & HBCC))
+ if (sm_mts != MTS_SENDMAIL_PIPE && (flags & HBCC))
return;
if (!nameoutput) {
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++)