1 |
/* Flags that control the program options that have been selected. */ |
2 |
#define OPT_TEST_MODE 0x00000001 |
3 |
#define OPT_DETAILS_QUITE 0x00000002 |
4 |
#define OPT_DETAILS_NORMAL 0x00000004 |
5 |
#define OPT_DETAILS_VERBOSE 0x00000008 |
6 |
#define OPT_SHOW_HEADERS 0x00000010 |
7 |
#define OPT_DETAILS_CLEAR 0xFFFFFFF1 |
8 |
|
9 |
/* Lengths of strings to save account settings. */ |
10 |
#define SERVER_MAX 128 |
11 |
#define USERID_MAX 64 |
12 |
#define PASSWD_MAX 32 |
13 |
|
14 |
/* Lengths of strings that comprise the HEADER of a filter. */ |
15 |
#define FIELD_NAME_MAX 64 |
16 |
#define FIELD_BODY_MAX 512 |
17 |
|
18 |
#define min(A, B) ((A) < (B) ? (A) : (B)) |
19 |
|
20 |
|
21 |
/* Account settings. */ |
22 |
typedef struct account { |
23 |
char server[SERVER_MAX]; /* Hostname of mail server. */ |
24 |
unsigned short int port; /* Port to connect. */ |
25 |
char userid[USERID_MAX]; |
26 |
char passwd[PASSWD_MAX]; |
27 |
struct account *next; |
28 |
} account_t; |
29 |
|
30 |
/* A header filter entry. */ |
31 |
typedef struct filter { |
32 |
char name[FIELD_NAME_MAX]; /* Header field name. */ |
33 |
int custom; /* If field name one of FROM, TO, |
34 |
CC, BCC, SUBJECT then zero. */ |
35 |
char body[FIELD_BODY_MAX]; /* Header field body. */ |
36 |
struct filter *next; |
37 |
} filter_t; |
38 |
|
39 |
|
40 |
void apply_filters(void); |
41 |
void usage(void); |