From owner-freebsd-current Sat Oct 5 09:30:39 1996 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id JAA24593 for current-outgoing; Sat, 5 Oct 1996 09:30:39 -0700 (PDT) Received: from math.psu.edu (root@leibniz.math.psu.edu [146.186.130.2]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id JAA24584 for ; Sat, 5 Oct 1996 09:30:33 -0700 (PDT) Received: from augusta.math.psu.edu (cross@augusta.math.psu.edu [146.186.132.2]) by math.psu.edu (8.7.5/8.7.3) with ESMTP id MAA04232 for ; Sat, 5 Oct 1996 12:30:31 -0400 (EDT) Received: (cross@localhost) by augusta.math.psu.edu (8.7.5/8.6.9) id MAA18939 for current@freebsd.org; Sat, 5 Oct 1996 12:30:28 -0400 (EDT) Date: Sat, 5 Oct 1996 12:30:28 -0400 (EDT) Message-Id: <199610051630.MAA18939@augusta.math.psu.edu> From: Dan Cross Subject: Qmail changes... (repost) To: undisclosed-recipients:; Sender: owner-current@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk About a week ago, I posted some diffs for from(1) and mail(1) that make them honor the $MAIL environment variable. My motivation was supporting the mailboxes created by qmail, which are not put into /var/mail but instead into the user's home directory. (ie, ~/Mailbox is the user's default maildrop.) However, these changes were never committed to the source tree, and I never heard anything back about them. Anyway, it would be really great if someone could commit these to the source tree, but if not, could someone at least tell me so that I can make provisions on my own system? Thanks! - Dan C. --- *** /usr/src/usr.bin/from/from.c 1996/09/29 01:40:35 1.1 --- /usr/src/usr.bin/from/from.c 1996/09/29 01:58:06 *************** *** 42,50 **** --- 42,52 ---- #endif /* not lint */ #include + #include #include #include + #include #include #include *************** *** 83,98 **** argv += optind; if (!file) { ! if (!(file = *argv)) { ! if (!(pwd = getpwuid(getuid()))) { ! fprintf(stderr, "from: no password file entry for you.\n"); ! exit(1); } - file = pwd->pw_name; } - (void)sprintf(buf, "%s/%s", _PATH_MAILDIR, file); - file = buf; } /* read from stdin */ --- 85,106 ---- argv += optind; if (!file) { ! if (*argv) { ! (void)sprintf(buf, "%s/%s", _PATH_MAILDIR, *argv); ! file = buf; ! } else { ! if (!(file = getenv("MAIL"))) { ! if (!(pwd = getpwuid(getuid()))) { ! (void)fprintf(stderr, "from: no password file entry for you.\n"); ! exit(1); ! } ! file = pwd->pw_name; ! (void)sprintf(buf, ! "%s/%s", _PATH_MAILDIR, file); ! file = buf; } } } /* read from stdin */ *** /usr/src/usr.bin/from/from.1 1996/09/29 01:58:15 1.1 --- /usr/src/usr.bin/from/from.1 1996/09/29 14:45:01 *************** *** 72,77 **** --- 72,82 ---- .Ar user Ns 's mailbox, is examined instead of the invoker's own mailbox. (Privileges are required.) + .Sh ENVIRONMENT + .Bl -tag -width Fl + .It Ev MAIL + If set, the location of the invoker's mailbox. Otherwise, the default + in /var/mail is used. .Sh FILES .Bl -tag -width /var/mail/* -compact .It Pa /var/mail/* *** /usr/src/usr.bin/mail/v7.local.c 1996/09/29 02:00:23 1.1 --- /usr/src/usr.bin/mail/v7.local.c 1996/09/29 02:03:41 *************** *** 55,61 **** findmail(user, buf) char *user, *buf; { ! (void)sprintf(buf, "%s/%s", _PATH_MAILDIR, user); } /* --- 55,66 ---- findmail(user, buf) char *user, *buf; { ! char *tmp = getenv("MAIL"); ! ! if (tmp == NULL) ! (void)sprintf(buf, "%s/%s", _PATH_MAILDIR, user); ! else ! (void)strcpy(buf, tmp); } /* *** /usr/src/usr.bin/mail/mail.1 1996/09/29 14:45:24 1.1 --- /usr/src/usr.bin/mail/mail.1 1996/09/29 14:47:59 *************** *** 985,991 **** .Ev HOME and .Ev USER ! environment variables. .Sh FILES .Bl -tag -width /usr/share/misc/Mail.help* -compact .It Pa /var/mail/* --- 985,995 ---- .Ev HOME and .Ev USER ! 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/*