#include <sys/types.h>#include <sys/stat.h>#include <errno.h>#include <signal.h>#include <pwd.h>#include <time.h>#include <setjmp.h>#include <string.h>#include <stdlib.h>#include <fcntl.h>#include <unistd.h>#include <sys/wait.h>#include <stdio.h>Include dependency graph for mail.c:

Go to the source code of this file.
Data Structures | |
| struct | letter |
Defines | |
| #define | D(Q) |
| #define | SHELL "/bin/sh" |
| #define | DROPNAME "/usr/spool/mail/%s" |
| #define | LOCKNAME "/usr/spool/mail/%s.lock" |
| #define | LOCKWAIT 5 |
| #define | LOCKTRIES 4 |
| #define | MBOX "mbox" |
| #define | HELPFILE "/usr/lib/mail.help" |
| #define | PROMPT "? " |
| #define | PATHLEN 80 |
| #define | MAXRCPT 100 |
| #define | LINELEN 512 |
| #define | MAILERARGS |
| #define | UNREAD 1 |
| #define | DELETED 2 |
| #define | READ 3 |
Functions | |
| _PROTOTYPE (int main,(int argc, char **argv)) | |
| _PROTOTYPE (int deliver,(int count, char *vec[])) | |
| _PROTOTYPE (FILE *makerewindable,(void)) | |
| _PROTOTYPE (int copy,(FILE *fromfp, FILE *tofp)) | |
| _PROTOTYPE (void readbox,(void)) | |
| _PROTOTYPE (void onint,(int dummy)) | |
| _PROTOTYPE (void savelet,(struct letter *let, char *savefile)) | |
| _PROTOTYPE (void printlet,(struct letter *let, FILE *tofp)) | |
| _PROTOTYPE (void doshell,(char *command)) | |
| _PROTOTYPE (char *basename,(char *name)) | |
| _PROTOTYPE (char *whoami,(void)) | |
| _PROTOTYPE (int filesize,(char *name)) | |
| int | main (int argc, argv) |
| int | deliver (int count, vec) |
| FILE * | makerewindable () |
| int | copy (FILE *fromfp, FILE *tofp) |
| void | readbox () |
| void | printall () |
| void | interact () |
| void | onint (int dummy) |
| void | savelet (struct letter *let, char *savefile) |
| void | updatebox () |
| void | printlet (struct letter *let, FILE *tofp) |
| void | doshell (char *command) |
| void | usage () |
| char * | basename (char *name) |
| char * | whoami () |
| void | dohelp () |
| int | filesize (name) |
Variables | |
| letter * | firstlet |
| letter * | lastlet |
| int | usemailer = 1 |
| int | printmode = 0 |
| int | quitmode = 0 |
| int | reversemode = 0 |
| int | usedrop = 1 |
| int | verbose = 0 |
| int | needupdate = 0 |
| int | msgstatus = 0 |
| int | distlist = 0 |
| char | mailbox [PATHLEN] |
| char | tempname [PATHLEN] = "/tmp/mailXXXXXX" |
| char * | subject = NULL |
| FILE * | boxfp = NULL |
| jmp_buf | printjump |
| unsigned | oldmask |
| int | optind |
| char * | optarg |
|
|
|
|
|
|
|
|
|
Definition at line 36 of file mail.c. Referenced by dohelp(). |
|
|
|
|
|
Definition at line 30 of file mail.c. Referenced by deliver(), and updatebox(). |
|
|
Definition at line 32 of file mail.c. Referenced by deliver(). |
|
|
Definition at line 31 of file mail.c. Referenced by deliver(). |
|
|
|
|
|
Definition at line 39 of file mail.c. Referenced by deliver(). |
|
|
|
|
|
|
|
|
Definition at line 37 of file mail.c. Referenced by interact(). |
|
|
|
|
|
|
|
|
Definition at line 45 of file mail.c. Referenced by readbox(). |
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
|
|
|
||||||||||||
|
Definition at line 390 of file mail.c. References c, done, EOF, ferror, fputs(), getc, p, and putc. |
|
||||||||||||
|
Definition at line 164 of file mail.c. References boxfp, chown, copy, creat, ctime(), D, distlist, DROPNAME, ENOENT, errno, errs, execv, fclose(), fdopen(), fopen(), fprintf(), getpwnam(), getpwuid(), getuid, i, int(), isatty, j, L, link, LOCKNAME, LOCKTRIES, LOCKWAIT, lseek, mailbox, makerewindable(), MAXRCPT, now, NULL, PATHLEN, perror(), printf, passwd::pw_gid, passwd::pw_name, passwd::pw_uid, rewind(), S_IFMT, S_IFREG, setuid, SIG_IGN, SIGHUP, SIGINT, signal(), SIGQUIT, sleep, sprintf(), stat::st_mode, stat::st_uid, stat, stb, stderr, stdin, strcpy(), subject, time, time_t, unlink, usemailer, and verbose. Referenced by main(). |
|
|
Definition at line 755 of file mail.c. References fgets(), fopen(), fp, fprintf(), fputs(), HELPFILE, NULL, and stdout. Referenced by interact(). |
|
|
Definition at line 702 of file mail.c. References execl, exit(), fork, fprintf(), getenv(), getgid, getuid, NULL, oldmask, perror(), pid, setgid, setuid, SHELL, shell, stderr, umask, and wait. Referenced by interact(). |
|
|
Definition at line 767 of file mail.c. Referenced by DOrretr(), DOrstor(), doSIZE(), main(), and writeit(). |
|
|
Definition at line 515 of file mail.c. References DELETED, dohelp(), doshell(), exit(), fflush(), fgets(), firstlet, fprintf(), fputs(), lastlet, linebuf, needprint, needupdate, letter::next, next, NULL, letter::prev, printf, printjump, printlet(), PROMPT, putchar, quitmode, READ, reversemode, savelet(), setjmp, SIG_IGN, SIGINT, signal(), letter::status, stderr, stdin, stdout, and strtok(). |
|
||||||||||||
|
Definition at line 94 of file mail.c. References basename, c, D, deliver(), distlist, DROPNAME, EOF, exit(), filesize(), getopt(), getuid, interact, mailbox, mktemp(), msgstatus, needupdate, oldmask, optarg, optind, PATHLEN, printall(), printf, printmode, quitmode, readbox(), reversemode, setuid, sprintf(), strncpy(), subject, tempname, umask, updatebox(), usage, usedrop, usemailer, verbose, and whoami(). |
|
|
Definition at line 346 of file mail.c. References c, done, EOF, fclose(), ferror, fopen(), fprintf(), freopen(), getc, NULL, putc, stderr, stdin, tempname, and unlink. Referenced by deliver(). |
|
|
Definition at line 595 of file mail.c. References printjump. |
|
|
Definition at line 499 of file mail.c. References firstlet, lastlet, NULL, printf, printlet(), reversemode, and stdout. Referenced by main(). |
|
||||||||||||
|
Definition at line 686 of file mail.c. References boxfp, c, EOF, fseek(), getc, NULL, and putc. Referenced by interact(), printall(), and savelet(). |
|
|
Definition at line 458 of file mail.c. References access, boxfp, D, ENOENT, errno, exit(), fgets(), firstlet, fopen(), fprintf(), L, lastlet, linebuf, letter::location, mailbox, malloc(), letter::next, NULL, perror(), letter::prev, printf, letter::status, stderr, strlen(), strncmp(), UNREAD, and usedrop. Referenced by main(). |
|
||||||||||||
|
Definition at line 601 of file mail.c. References exit(), fclose(), ferror, fopen(), fork, fprintf(), getgid, getuid, NULL, perror(), pid, printlet(), setgid, setuid, stderr, and wait. Referenced by interact(). |
|
|
Definition at line 631 of file mail.c. References c, D, DELETED, firstlet, fopen(), LOCKNAME, letter::next, NULL, PATHLEN, perror(), printf, sprintf(), letter::status, tempname, and whoami(). Referenced by main(). |
|
|
|
|
|
Definition at line 745 of file mail.c. References getpwuid(), getuid, NULL, and passwd::pw_name. |
|
|
Definition at line 69 of file mail.c. Referenced by deliver(), printlet(), and readbox(). |
|
|
|
|
|
Definition at line 55 of file mail.c. Referenced by interact(), printall(), readbox(), and updatebox(). |
|
|
Definition at line 55 of file mail.c. Referenced by interact(), printall(), and readbox(). |
|
|
|
|
|
Definition at line 64 of file mail.c. Referenced by main(). |
|
|
Definition at line 63 of file mail.c. Referenced by interact(), and main(). |
|
|
|
|
|
|
|
|
|
|
|
Definition at line 70 of file mail.c. Referenced by interact(), and onint(). |
|
|
Definition at line 58 of file mail.c. Referenced by main(). |
|
|
Definition at line 59 of file mail.c. Referenced by interact(), and main(). |
|
|
Definition at line 60 of file mail.c. Referenced by interact(), main(), and printall(). |
|
|
|
|
|
Definition at line 67 of file mail.c. Referenced by herein(), main(), makerewindable(), readhere(), and updatebox(). |
|
|
|
|
|
|
|
|
|
1.4.6