2 |
- |
1 |
#include "sys.h"
|
|
|
2 |
|
|
|
3 |
/* format of REMOTE FROM lines */
|
|
|
4 |
extern char *REMFROMRE;
|
|
|
5 |
extern int REMSENDERMATCH;
|
|
|
6 |
extern int REMDATEMATCH;
|
|
|
7 |
extern int REMSYSMATCH;
|
|
|
8 |
|
|
|
9 |
/* format of mailbox FROM lines */
|
|
|
10 |
#define IS_HEADER(p) ((p)[0]=='F'&&(p)[1]=='r'&&(p)[2]=='o'&&(p)[3]=='m'&&(p)[4]==' ')
|
|
|
11 |
#define IS_TRAILER(p) ((p)[0]=='m'&&(p)[1]=='o'&&(p)[2]=='r'&&(p)[3]=='F'&&(p)[4]=='\n')
|
|
|
12 |
extern char *FROMRE;
|
|
|
13 |
extern int SENDERMATCH;
|
|
|
14 |
extern int DATEMATCH;
|
|
|
15 |
|
|
|
16 |
enum
|
|
|
17 |
{
|
|
|
18 |
Elemlen= 28,
|
|
|
19 |
Errlen= ERRMAX,
|
|
|
20 |
Pathlen= 256,
|
|
|
21 |
};
|
|
|
22 |
enum { Atnoteunknown, Atnoterecog };
|
|
|
23 |
|
|
|
24 |
/*
|
|
|
25 |
* routines in mail.c
|
|
|
26 |
*/
|
|
|
27 |
extern int print_header(Biobuf*, char*, char*);
|
|
|
28 |
extern int print_remote_header(Biobuf*, char*, char*, char*);
|
|
|
29 |
extern int parse_header(char*, String*, String*);
|
|
|
30 |
|
|
|
31 |
/*
|
|
|
32 |
* routines in aux.c
|
|
|
33 |
*/
|
|
|
34 |
extern String *abspath(char*, char*, String*);
|
|
|
35 |
extern String *mboxpath(char*, char*, String*, int);
|
|
|
36 |
extern char *basename(char*);
|
|
|
37 |
extern int delivery_status(String*);
|
|
|
38 |
extern void append_match(Resub*, String*, int);
|
|
|
39 |
extern int shellchars(char*);
|
|
|
40 |
extern String* escapespecial(String*);
|
|
|
41 |
extern String* unescapespecial(String*);
|
|
|
42 |
extern int returnable(char*);
|
|
|
43 |
|
|
|
44 |
/* in copymessage */
|
|
|
45 |
extern int appendfiletombox(int, int);
|
|
|
46 |
extern int appendfiletofile(int, int);
|
|
|
47 |
|
|
|
48 |
/* mailbox types */
|
|
|
49 |
#define MF_NORMAL 0
|
|
|
50 |
#define MF_PIPE 1
|
|
|
51 |
#define MF_FORWARD 2
|
|
|
52 |
#define MF_NOMBOX 3
|
|
|
53 |
#define MF_NOTMBOX 4
|
|
|
54 |
|
|
|
55 |
/* a pipe between parent and child*/
|
|
|
56 |
typedef struct {
|
|
|
57 |
Biobuf bb;
|
|
|
58 |
Biobuf *fp; /* parent process end*/
|
|
|
59 |
int fd; /* child process end*/
|
|
|
60 |
} stream;
|
|
|
61 |
|
|
|
62 |
/* a child process*/
|
|
|
63 |
typedef struct process{
|
|
|
64 |
stream *std[3]; /* standard fd's*/
|
|
|
65 |
int pid; /* process identifier*/
|
|
|
66 |
int status; /* exit status*/
|
|
|
67 |
Waitmsg *waitmsg;
|
|
|
68 |
} process;
|
|
|
69 |
|
|
|
70 |
extern stream *instream(void);
|
|
|
71 |
extern stream *outstream(void);
|
|
|
72 |
extern void stream_free(stream*);
|
|
|
73 |
extern process *noshell_proc_start(char**, stream*, stream*, stream*, int, char*);
|
|
|
74 |
extern process *proc_start(char*, stream*, stream*, stream*, int, char*);
|
|
|
75 |
extern int proc_wait(process*);
|
|
|
76 |
extern int proc_free(process*);
|
|
|
77 |
extern int proc_kill(process*);
|
|
|
78 |
|
|
|
79 |
/* tell compiler we're using a value so it won't complain */
|
|
|
80 |
#define USE(x) if(x)
|