|
|
1.1 root 1: #
2:
3: #include "rcv.h"
4:
5: /*
6: * Mail -- a mail program
7: *
8: * Give names to all the temporary files that we will need.
9: */
10:
11: char tempMail[14];
12: char tempQuit[14];
13: char tempEdit[14];
14: char tempSet[14];
15: char tempResid[14];
16: char tempMesg[14];
17:
18: tinit()
19: {
20: register char *cp, *cp2;
21: char uname[9];
22:
23: copy("/tmp/RsXXXXX", tempMail);
24: copy("/tmp/RqXXXXX", tempResid);
25: copy("/tmp/RmXXXXX", tempQuit);
26: copy("/tmp/ReXXXXX", tempEdit);
27: copy("/tmp/RxXXXXX", tempSet);
28: copy("/tmp/RxXXXXX", tempMesg);
29: mktemp(tempMail);
30: mktemp(tempResid);
31: mktemp(tempQuit);
32: mktemp(tempEdit);
33: mktemp(tempSet);
34: mktemp(tempMesg);
35:
36: if (strlen(myname) != 0) {
37: uid = getuserid(myname);
38: if (uid == -1)
39: goto youlose;
40: }
41: else {
42: uid = getuid() & UIDMASK;
43: if (username(uid, uname) < 0) {
44: youlose:
45: printf("Who are you!?\n");
46: exit(1);
47: }
48: copy(uname, myname);
49: }
50: mailname = mailspace;
51: cp = value("HOME");
52: if (cp == NOSTR)
53: cp = ".";
54: copy(cp, homedir);
55: findmail();
56: cp = copy(homedir, mbox);
57: copy("/mbox", cp);
58: cp = copy(homedir, mailrc);
59: copy("/.mailrc", cp);
60: cp = copy(homedir, deadletter);
61: copy("/dead.letter", cp);
62: if (debug) {
63: printf("uid = %d, user = %s, mailname = %s\n",
64: uid, myname, mailname);
65: printf("deadletter = %s, mailrc = %s, mbox = %s\n",
66: deadletter, mailrc, mbox);
67: }
68: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.