Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/mailwrapper Actually make additional arguments in m...



details:   https://anonhg.NetBSD.org/src/rev/db1aedf3f0c0
branches:  trunk
changeset: 543120:db1aedf3f0c0
user:      is <is%NetBSD.org@localhost>
date:      Mon Feb 17 21:18:46 2003 +0000

description:
Actually make additional arguments in mailer.conf useful, and document
them.
Reviewed by perry and wiz.

diffstat:

 usr.sbin/mailwrapper/mailer.conf.5 |  34 +++++++++++++++++++++++++++++-----
 usr.sbin/mailwrapper/mailwrapper.c |   9 ++++++---
 2 files changed, 35 insertions(+), 8 deletions(-)

diffs (95 lines):

diff -r 9918b4848b8b -r db1aedf3f0c0 usr.sbin/mailwrapper/mailer.conf.5
--- a/usr.sbin/mailwrapper/mailer.conf.5        Mon Feb 17 20:51:52 2003 +0000
+++ b/usr.sbin/mailwrapper/mailer.conf.5        Mon Feb 17 21:18:46 2003 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: mailer.conf.5,v 1.9 2002/12/01 11:35:33 rtr Exp $
+.\"    $NetBSD: mailer.conf.5,v 1.10 2003/02/17 21:18:46 is Exp $
 .\"
 .\" Copyright (c) 1998
 .\"    Perry E. Metzger.  All rights reserved.
@@ -39,7 +39,14 @@
 .Sh DESCRIPTION
 The file
 .Pa /etc/mailer.conf
-contains a series of pairs. The first member of each pair is the name
+contains a series of lines of the form
+.Pp
+.Pa name
+.Pa program
+.Op Ar arguments ...
+.Pp
+The first word of each line is the
+.P name
 of a program invoking
 .Xr mailwrapper 8
 which is typically a symbolic link to
@@ -49,9 +56,21 @@
 and
 .Xr mailq 1
 would be set up this way.)
-The second member of each pair is the name of the program to
-actually execute when the first name is invoked. The file may also
-contain comments, denoted by a # mark in the first column of any line.
+.Pp
+The second word of each line is the name of the
+.Pa program
+to actually execute when the first name is invoked.
+.Pp
+The further
+.Pa arguments ,
+if any, are passed to the
+.Pa program ,
+followed by the arguments
+.Xr mailwrapper 8
+was called with.
+.Pp
+The file may also contain comment lines, denoted by a # mark in the
+first column of any line.
 .Sh FILES
 /etc/mailer.conf
 .Sh EXAMPLES
@@ -81,6 +100,11 @@
 mailq          /usr/libexec/postfix/sendmail
 newaliases     /usr/libexec/postfix/sendmail
 .Ed
+.Bd -literal
+# Send outgoing mail to a smart relay using mini-sendmail without queueing
+sendmail       /usr/pkg/sbin/mini-sendmail -srelayhost
+send-mail      /usr/pkg/sbin/mini-sendmail -srelayhost
+.Ed
 .Sh SEE ALSO
 .Xr mail 1 ,
 .Xr mailq 1 ,
diff -r 9918b4848b8b -r db1aedf3f0c0 usr.sbin/mailwrapper/mailwrapper.c
--- a/usr.sbin/mailwrapper/mailwrapper.c        Mon Feb 17 20:51:52 2003 +0000
+++ b/usr.sbin/mailwrapper/mailwrapper.c        Mon Feb 17 21:18:46 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mailwrapper.c,v 1.6 2002/11/30 03:10:57 lukem Exp $    */
+/*     $NetBSD: mailwrapper.c,v 1.7 2003/02/17 21:18:46 is Exp $       */
 
 /*
  * Copyright (c) 1998
@@ -87,11 +87,11 @@
        FILE *config;
        char *line, *cp, *from, *to, *ap;
        size_t len, lineno = 0;
+       int i;
        struct arglist al;
 
        initarg(&al);
-       for (len = 0; len < argc; len++)
-               addarg(&al, argv[len], 0);
+       addarg(&al, argv[0], 0);
 
        if ((config = fopen(_PATH_MAILERCONF, "r")) == NULL)
                err(1, "mailwrapper: can't open %s", _PATH_MAILERCONF);
@@ -135,6 +135,9 @@
 
        (void)fclose(config);
 
+       for (i = 1; i < argc; i++)
+               addarg(&al, argv[i], 0);
+
        addarg(&al, NULL, 0);
        execve(to, al.argv, envp);
        err(1, "mailwrapper: execing %s", to);



Home | Main Index | Thread Index | Old Index