On Tue, Dec 08, 2015 at 10:39:56AM +0100, Sunil Nimmagadda wrote:
> > If /etc/mailer.conf doesn't exist, mailwrapper tries to run sendmail,
> > giving a confusing error message:
> > 
> > mailwrapper: cannot exec /usr/libexec/sendmail/sendmail: No such
> > file or directory
> > 
> > This patch removes this fallback code. I believe this is cleaner than
> > updating the fallback since we would have to put two paths in: one for
> > sendmail/send-mail/mailq and one for makemap/newaliases.
> 
> I am not sure about removing the fallback code but if we decide to
> keep it, this diff should fix the fallback case.

Good catch; I didn't realize you could also call newaliases/makemap
through /usr/sbin/smtpctl.

If we choose to keep the fallback code, we should probably fix the
manpage for mailwrapper as well. I've attached a revised version of your
patch that documents the fallback behavior.

Index: mailwrapper.8
===================================================================
RCS file: /cvs/src/usr.sbin/mailwrapper/mailwrapper.8,v
retrieving revision 1.12
diff -u -p -r1.12 mailwrapper.8
--- mailwrapper.8       27 Mar 2014 22:34:42 -0000      1.12
+++ mailwrapper.8       8 Dec 2015 16:32:01 -0000
@@ -120,9 +120,11 @@ is typically set up as a symlink to
 which is not usually invoked on its own.
 .Sh DIAGNOSTICS
 .Nm
-will return an error value and print a diagnostic if its configuration
-file is missing or malformed, or does not contain a mapping for the
-name under which
+will invoke
+.Xr smtpd 8
+if its configuration file is missing.
+It will return an error value and print a diagnostic if its configuration
+file is malformed, or does not contain a mapping for the name under which
 .Nm
 was invoked.
 .Sh SEE ALSO
Index: mailwrapper.c
===================================================================
RCS file: /cvs/src/usr.sbin/mailwrapper/mailwrapper.c,v
retrieving revision 1.20
diff -u -p -r1.20 mailwrapper.c
--- mailwrapper.c       12 Oct 2015 22:01:08 -0000      1.20
+++ mailwrapper.c       8 Dec 2015 16:32:01 -0000
@@ -41,7 +41,7 @@
 #include <util.h>
 
 #define _PATH_MAILERCONF       "/etc/mailer.conf"
-#define _PATH_DEFAULTMTA       "/usr/libexec/sendmail/sendmail"
+#define _PATH_DEFAULTMTA       "/usr/sbin/smtpctl"
 
 struct arglist {
        size_t argc, maxc;

Reply via email to