diff options
author | jkh <jkh@FreeBSD.org> | 1996-12-21 22:53:58 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 1996-12-21 22:53:58 +0000 |
commit | ad3a46d18ba9b4fae98b615a912d155f1008d49e (patch) | |
tree | 8fbac8a33712ca7bbc9927420b6fe408b86a2d59 /usr.bin/mail | |
parent | c04fa8bd61fb25f041272c83ac491af91cdb9deb (diff) | |
download | FreeBSD-src-ad3a46d18ba9b4fae98b615a912d155f1008d49e.zip FreeBSD-src-ad3a46d18ba9b4fae98b615a912d155f1008d49e.tar.gz |
Allow mail(1) to look for multiple mail.rc files.
Submitted-By: Lyndon Nerenberg VE7TCP <lyndon@orthanc.com>
Diffstat (limited to 'usr.bin/mail')
-rw-r--r-- | usr.bin/mail/mail.1 | 23 | ||||
-rw-r--r-- | usr.bin/mail/main.c | 16 | ||||
-rw-r--r-- | usr.bin/mail/pathnames.h | 2 |
3 files changed, 29 insertions, 12 deletions
diff --git a/usr.bin/mail/mail.1 b/usr.bin/mail/mail.1 index 597f175..4bed974 100644 --- a/usr.bin/mail/mail.1 +++ b/usr.bin/mail/mail.1 @@ -30,7 +30,7 @@ .\" SUCH DAMAGE. .\" .\" @(#)mail.1 8.2 (Berkeley) 12/30/93 -.\" $Id: mail.1,v 1.7 1996/08/29 18:05:57 wosch Exp $ +.\" $Id: mail.1,v 1.8 1996/10/06 01:55:31 jkh Exp $ .\" .Dd December 30, 1993 .Dt MAIL 1 @@ -78,9 +78,9 @@ In particular, the special character when sending mail is only active in interactive mode. .It Fl n -Inhibits reading -.Pa /etc/mail.rc -upon startup. +Inhibits reading the system-wide +.Pa mail.rc +files upon startup. .It Fl N Inhibits the initial display of message headers when reading mail or editing a mail folder. @@ -797,8 +797,9 @@ The binary options include the following: Causes messages saved in .Ar mbox to be appended to the end rather than prepended. -This should always be set (perhaps in -.Pa /etc/mail.rc ) . +This should always be set (preferably in one of the system-wide +.Pa mail.rc +files). .It Ar ask Causes .Nm mail @@ -991,7 +992,7 @@ environment variable is set, it is used as the location of the user's mailbox instead of the default in /var/mail. .Sh FILES -.Bl -tag -width /usr/share/misc/Mail.help* -compact +.Bl -tag -width /usr/share/misc/mail.*help -compact .It Pa /var/mail/* Post office. .It ~/mbox @@ -1000,10 +1001,14 @@ User's old mail. File giving initial mail commands. .It Pa /tmp/R* Temporary files. -.It Pa /usr/share/misc/mail.help +.It Pa /usr/share/misc/mail.*help Help files. +.sp +.It Pa /usr/share/misc/mail.rc +.It Pa /usr/local/etc/mail.rc .It Pa /etc/mail.rc -System initialization file. +System-wide initialization files. Each file will be sourced, in order, +if it exists. .El .Sh SEE ALSO .Xr fmt 1 , diff --git a/usr.bin/mail/main.c b/usr.bin/mail/main.c index e912ccb..6a01754 100644 --- a/usr.bin/mail/main.c +++ b/usr.bin/mail/main.c @@ -42,6 +42,7 @@ static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 6/6/93"; #endif /* not lint */ #include "rcv.h" +#include <err.h> #include <fcntl.h> #include "extern.h" @@ -207,8 +208,19 @@ Usage: mail [-iInv] [-s subject] [-c cc-addr] [-b bcc-addr] to-addr ...\n\ input = stdin; rcvmode = !to; spreserve(); - if (!nosrc) - load(_PATH_MASTER_RC); + if (!nosrc) { + char *s, *path_rc; + + path_rc = malloc(sizeof(_PATH_MASTER_RC)); + if (path_rc == NULL) + errx(1, "malloc(path_rc) failed"); + + strcpy(path_rc, _PATH_MASTER_RC); + while ((s = strsep(&path_rc, ":")) != NULL) + if (*s != '\0') + load(s); + } + /* * Expand returns a savestr, but load only uses the file name * for fopen, so it's safe to do this. diff --git a/usr.bin/mail/pathnames.h b/usr.bin/mail/pathnames.h index 13a7672..0b2586f 100644 --- a/usr.bin/mail/pathnames.h +++ b/usr.bin/mail/pathnames.h @@ -38,5 +38,5 @@ #define _PATH_EX "/usr/bin/ex" #define _PATH_HELP "/usr/share/misc/mail.help" #define _PATH_TILDE "/usr/share/misc/mail.tildehelp" -#define _PATH_MASTER_RC "/etc/mail.rc" +#define _PATH_MASTER_RC "/usr/share/misc/mail.rc:/usr/local/etc/mail.rc:/etc/mail.rc" #define _PATH_MORE "/usr/bin/more" |