Date: Sat, 5 Oct 1996 12:30:28 -0400 (EDT) From: Dan Cross <cross@math.psu,edu> To: undisclosed-recipients:; Subject: Qmail changes... (repost) Message-ID: <199610051630.MAA18939@augusta.math.psu.edu>
next in thread | raw e-mail | index | archive | help
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 <sys/types.h> + #include <ctype.h> #include <pwd.h> #include <stdio.h> + #include <stdlib.h> #include <string.h> #include <paths.h> *************** *** 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/*
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199610051630.MAA18939>