From 82c94b79bf89c02cf6a1b0cd528be2e0340facfc Mon Sep 17 00:00:00 2001 From: John Marino Date: Mon, 9 Mar 2015 07:33:45 +0100 Subject: [PATCH] mail(1): call sendmail, not send-mail There is no actual executable or link to executable named "send-mail". Somehow the request must be processed by the mailwrapper because tuxillo reports mail(1) will not function without an entry in mailer.conf. Rather than fix all the sample mailer.conf files, the installed one, and the MTA switch instructions, just make mail(1) spawn "sendmail" instead. This works because send-mail is always an alias for sendmail in /etc/mail/mailer.conf --- etc/mail/mailer.conf | 1 - share/man/man5/mailer.conf.5 | 63 +++++++++++++++++++++++------------- usr.bin/mail/names.c | 2 +- 3 files changed, 41 insertions(+), 25 deletions(-) diff --git a/etc/mail/mailer.conf b/etc/mail/mailer.conf index 2f6679eb2c..6afe45d829 100644 --- a/etc/mail/mailer.conf +++ b/etc/mail/mailer.conf @@ -3,7 +3,6 @@ # sendmail /usr/libexec/dma -send-mail /usr/libexec/dma mailq /usr/libexec/dma newaliases true hoststat true diff --git a/share/man/man5/mailer.conf.5 b/share/man/man5/mailer.conf.5 index a75cfefd58..774c2081c6 100644 --- a/share/man/man5/mailer.conf.5 +++ b/share/man/man5/mailer.conf.5 @@ -31,7 +31,7 @@ .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" The following requests are required for all man pages. -.Dd December 16, 1998 +.Dd March 9, 2015 .Dt MAILER.CONF 5 .Os .Sh NAME @@ -59,39 +59,56 @@ contain comments, denoted by a # mark in the first column of any line. .Sh EXAMPLES The following is an example of how to set up an .Nm -for traditional sendmail invocation behavior. +for traditional sendmail invocation behavior (installed from DPorts) .Bd -literal -# Execute the "real" sendmail program, named /usr/libexec/sendmail/sendmail -sendmail /usr/libexec/sendmail/sendmail -send-mail /usr/libexec/sendmail/sendmail -mailq /usr/libexec/sendmail/sendmail -newaliases /usr/libexec/sendmail/sendmail +# Use sendmail as Mail Transfer Agent +sendmail /usr/local/sbin/sendmail +mailq /usr/local/bin/mailq +newaliases /usr/local/bin/newaliases +hoststat /usr/local/bin/hoststat +purgestat /usr/local/bin/purgestat .Ed .Pp -This example shows how to invoke a sendmail-workalike like Postfix in -place of sendmail. +This example shows how to invoke a sendmail-workalike like Postfix +installed from DPorts to replace +.Xr dma 8 .Bd -literal -# Emulate sendmail using postfix -sendmail /usr/libexec/postfix/sendmail -send-mail /usr/libexec/postfix/sendmail -mailq /usr/libexec/postfix/sendmail -newaliases /usr/libexec/postfix/sendmail +# Use postfix as Mail Transfer Agent +sendmail /usr/local/sbin/sendmail +mailq /usr/local/bin/mailq +newaliases /usr/local/bin/newaliases +hoststat true +purgestat true +.Ed +.Pp +This example shows how to invoke a sendmail-workalike like OpenSMTPd +installed from DPorts to replace +.Xr dma 8 +.Bd -literal +# Use opensmtpd as Mail Transfer Agent +sendmail /usr/local/sbin/smtpctl +mailq /usr/local/sbin/smtpctl +newaliases /usr/local/sbin/smtpctl +hoststat true +purgestat true +.Ed +.Pp +These are the default contents of the file +.Bd -literal +# Use dma as Mail Transfer Agent +sendmail /usr/libexec/dma +mailq /usr/libexec/dma +newaliases true +hoststat true +purgestat true .Ed .Sh SEE ALSO .Xr mail 1 , -.Xr mailq 1 , -.Xr newaliases 1 , -.Xr mailwrapper 8 , -.Xr sendmail 8 +.Xr mailwrapper 8 .Sh HISTORY .Nm appeared in .Nx 1.4 . .Sh AUTHORS .An Perry E. Metzger Aq Mt perry@piermont.com -.Sh BUGS -The entire reason this program exists is a crock. Instead, a command -for how to submit mail should be standardized, and all the "behave -differently if invoked with a different name" behavior of things like -.Xr mailq 1 should go away. diff --git a/usr.bin/mail/names.c b/usr.bin/mail/names.c index 37efb07442..3c8a7d979d 100644 --- a/usr.bin/mail/names.c +++ b/usr.bin/mail/names.c @@ -569,7 +569,7 @@ unpack(struct name *np) extra++; top = (char **)salloc((t + extra) * sizeof(*top)); ap = top; - *ap++ = "send-mail"; + *ap++ = "sendmail"; *ap++ = "-i"; if (metoo) *ap++ = "-m"; -- 2.41.0