summaryrefslogtreecommitdiffstats
path: root/usr.bin/mail
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1996-10-06 01:55:32 +0000
committerjkh <jkh@FreeBSD.org>1996-10-06 01:55:32 +0000
commit336dd89b3198be948d57de4a801c28a9070426c7 (patch)
tree89ca204ab60f787060792352ababf96ed20584e7 /usr.bin/mail
parent588cbc505965a59cfcff6441c1175864be71ab1a (diff)
downloadFreeBSD-src-336dd89b3198be948d57de4a801c28a9070426c7.zip
FreeBSD-src-336dd89b3198be948d57de4a801c28a9070426c7.tar.gz
Honor the MAIL environment variable.
Submitted-By: Dan Cross <cross@math.psu.edu>
Diffstat (limited to 'usr.bin/mail')
-rw-r--r--usr.bin/mail/mail.18
-rw-r--r--usr.bin/mail/v7.local.c7
2 files changed, 12 insertions, 3 deletions
diff --git a/usr.bin/mail/mail.1 b/usr.bin/mail/mail.1
index c151555..597f175 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$
+.\" $Id: mail.1,v 1.7 1996/08/29 18:05:57 wosch Exp $
.\"
.Dd December 30, 1993
.Dt MAIL 1
@@ -985,7 +985,11 @@ utilizes the
.Ev HOME
and
.Ev USER
-environment variables.
+environment variables. Also, if the
+.Ev MAIL
+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
.It Pa /var/mail/*
diff --git a/usr.bin/mail/v7.local.c b/usr.bin/mail/v7.local.c
index 5144c01..ade3cbd 100644
--- a/usr.bin/mail/v7.local.c
+++ b/usr.bin/mail/v7.local.c
@@ -55,7 +55,12 @@ void
findmail(user, buf)
char *user, *buf;
{
- (void)sprintf(buf, "%s/%s", _PATH_MAILDIR, user);
+ char *tmp = getenv("MAIL");
+
+ if (tmp == NULL)
+ (void)sprintf(buf, "%s/%s", _PATH_MAILDIR, user);
+ else
+ (void)strcpy(buf, tmp);
}
/*
OpenPOWER on IntegriCloud