Commit | Line | Data |
---|---|---|
00a21395 KS |
1 | # |
2 | ||
3 | /* | |
4 | * Mail -- a mail program | |
5 | * | |
6 | * Version 7 | |
7 | * | |
8 | * Local routines that are installation dependent. | |
9 | */ | |
10 | ||
11 | #include "rcv.h" | |
12 | ||
79ddb121 | 13 | static char *SccsId = "@(#)v7.local.c 2.1 %G%"; |
00a21395 KS |
14 | |
15 | /* | |
16 | * Locate the user's mailbox file (ie, the place where new, unread | |
17 | * mail is queued). In Version 7, it is in /usr/spool/mail/name. | |
18 | */ | |
19 | ||
20 | findmail() | |
21 | { | |
22 | register char *cp; | |
23 | ||
24 | cp = copy("/usr/spool/mail/", mailname); | |
25 | copy(myname, cp); | |
26 | if (isdir(mailname)) { | |
27 | stradd(mailname, '/'); | |
28 | strcat(mailname, myname); | |
29 | } | |
30 | } | |
31 | ||
32 | /* | |
33 | * Get rid of the queued mail. | |
34 | */ | |
35 | ||
36 | demail() | |
37 | { | |
38 | ||
297f6c21 KS |
39 | if (value("keep") != NOSTR) |
40 | close(creat(mailname, 0666)); | |
41 | else | |
42 | remove(mailname); | |
00a21395 KS |
43 | } |
44 | ||
45 | /* | |
46 | * Discover user login name. | |
47 | */ | |
48 | ||
49 | username(uid, namebuf) | |
50 | char namebuf[]; | |
51 | { | |
52 | register char *np; | |
53 | ||
54 | if (uid == getuid() && (np = getenv("USER")) != NOSTR) { | |
56b6e63e | 55 | strncpy(namebuf, np, PATHSIZE); |
00a21395 KS |
56 | return(0); |
57 | } | |
58 | return(getname(uid, namebuf)); | |
59 | } |