send() now updates the status: field in the message image
[unix-history] / usr / src / usr.bin / mail / temp.c
CommitLineData
ca3f0029
KS
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
11static char *SccsId = "@(#)temp.c 1.1 %G%";
12
13char tempMail[14];
14char tempQuit[14];
15char tempEdit[14];
16char tempSet[14];
17char tempResid[14];
18char tempMesg[14];
19
20tinit()
21{
22 register char *cp, *cp2;
23 char uname[9];
24 register int err = 0;
25 register int pid;
26
27 pid = getpid();
28 sprintf(tempMail, "/tmp/Rs%05d", pid);
29 sprintf(tempResid, "/tmp/Rq%05d", pid);
30 sprintf(tempQuit, "/tmp/Rm%05d", pid);
31 sprintf(tempEdit, "/tmp/Re%05d", pid);
32 sprintf(tempSet, "/tmp/Rx%05d", pid);
33 sprintf(tempMesg, "/tmp/Rx%05d", pid);
34
35 if (strlen(myname) != 0) {
36 uid = getuserid(myname);
37 if (uid == -1)
38 goto youlose;
39 }
40 else {
41 uid = getuid() & UIDMASK;
42 if (username(uid, uname) < 0) {
43 copy("ubluit", myname);
44youlose:
45 err++;
46 if (rcvmode) {
47 printf("Who are you!?\n");
48 exit(1);
49 }
50 }
51 copy(uname, myname);
52 }
53 mailname = mailspace;
54 cp = value("HOME");
55 if (cp == NOSTR)
56 cp = ".";
57 copy(cp, homedir);
58 findmail();
59 cp = copy(homedir, mbox);
60 copy("/mbox", cp);
61 cp = copy(homedir, mailrc);
62 copy("/.mailrc", cp);
63 cp = copy(homedir, deadletter);
64 copy("/dead.letter", cp);
65 if (debug) {
66 printf("uid = %d, user = %s, mailname = %s\n",
67 uid, myname, mailname);
68 printf("deadletter = %s, mailrc = %s, mbox = %s\n",
69 deadletter, mailrc, mbox);
70 }
71}