|
|
1.1 root 1: #include <stdio.h>
2: #include "mail.h"
3:
4: /* imports */
5: extern char *strcpy();
6: extern char *convertaddr();
7: extern FILE *popen();
8:
9: /* predeclared */
10: char *lowercase();
11:
12: main(ac, av)
13: int ac;
14: char *av[];
15: {
16: char addr[FROMLINESIZE];
17: char cmd[CMDSIZE];
18: char buf[FROMLINESIZE];
19: int status;
20: FILE *fp;
21:
22: if (av[2][0] != 0)
23: sprintf(addr, "%s.%s", av[1], av[2]);
24: else
25: strcpy(addr, av[1]);
26:
27: /* start up the mailer and pipe mail into it */
28: sprintf(cmd, "/bin/rmail %s", convertaddr(lowercase(addr)));
29: fp = (FILE *)popen(cmd, getuid(), getgid());
30: if (fp == NULL)
31: exit(1);
32: (void)from822("csnet", fp);
33:
34: /* return any errors */
35: status = pclose(fp, buf, sizeof(buf));
36: if (status)
37: write(2, buf, strlen(buf));
38: return status;
39: }
40:
41: /*
42: * Convert a string to lower case.
43: */
44: char *
45: lowercase(sp)
46: char *sp;
47: {
48: register char *lp = sp;
49:
50: while(*lp) {
51: *lp = tolower(*lp);
52: lp++;
53: }
54: return sp;
55: }
56:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.