/********************************************************************** * Copyright (c) Digital Equipment Corporation 1984, 1985, 1986. * * All Rights Reserved. * * Reference "/usr/src/COPYRIGHT" for applicable restrictions. * **********************************************************************/ #ifndef lint static char *Sccsid = "@(#)v7.local.c 3.0 4/22/86"; #endif /* * Mail -- a mail program * * Version 7 * * Local routines that are installation dependent. */ #include "rcv.h" /* * Based on * static char *SccsId = "@(#)v7.local.c 2.2 7/28/82"; */ /* * Locate the user's mailbox file (ie, the place where new, unread * mail is queued). In Version 7, it is in /usr/spool/mail/name. */ findmail() { register char *cp; cp = copy("/usr/spool/mail/", mailname); copy(myname, cp); if (isdir(mailname)) { stradd(mailname, '/'); strcat(mailname, myname); } } /* * Get rid of the queued mail. */ demail() { if (value("keep") != NOSTR) close(creat(mailname, 0666)); else { if (remove(mailname) < 0) close(creat(mailname, 0666)); } } /* * Discover user login name. */ username(uid, namebuf) char namebuf[]; { register char *np; if (uid == getuid() && (np = getenv("USER")) != NOSTR) { strncpy(namebuf, np, PATHSIZE); return(0); } return(getname(uid, namebuf)); }