19 |
#define ERROR_TERMIO 6 |
#define ERROR_TERMIO 6 |
20 |
#define ERROR_NETWORK 7 |
#define ERROR_NETWORK 7 |
21 |
#define ERROR_SSL 8 |
#define ERROR_SSL 8 |
22 |
#define ERROR_UNDEFINED 9 |
#define ERROR_PASSPHRASE 9 |
23 |
|
#define ERROR_ENCRYPT 10 |
24 |
|
#define ERROR_DECRYPT 11 |
25 |
|
#define ERROR_UNDEFINED 12 |
26 |
|
|
27 |
/* Flags that control the program's options. */ |
/* Flags that control the program's options. */ |
28 |
#define OPTION_DETAILS_QUIET 0x01 |
#define OPTION_DETAILS_QUIET 0x01 |
31 |
#define OPTION_DETAILS_CLEAR 0xf8 |
#define OPTION_DETAILS_CLEAR 0xf8 |
32 |
#define OPTION_HEADERS 0x08 |
#define OPTION_HEADERS 0x08 |
33 |
#define OPTION_NAMESPACE 0x10 |
#define OPTION_NAMESPACE 0x10 |
34 |
|
#define OPTION_PASSWORD_EDITOR 0x20 |
35 |
|
|
36 |
/* Capabilities of mail server. */ |
/* Capabilities of mail server. */ |
37 |
#define CAPABILITY_NONE 0x00 |
#define CAPABILITY_NONE 0x00 |
70 |
/* Length of mailbox namespace prefix. */ |
/* Length of mailbox namespace prefix. */ |
71 |
#define NAMESPACE_PREFIX_LEN 64 |
#define NAMESPACE_PREFIX_LEN 64 |
72 |
|
|
73 |
|
/* Encryption and decryption buffers. */ |
74 |
|
#define ENCRYPTION_BUF 1024 |
75 |
|
#define DECRYPTION_BUF 4096 |
76 |
|
|
77 |
|
|
78 |
#define min(A, B) ((A) < (B) ? (A) : (B)) |
#define min(A, B) ((A) < (B) ? (A) : (B)) |
79 |
#define plural(A) ((A) == 1 ? "" : "s") |
#define plural(A) ((A) == 1 ? "" : "s") |
81 |
|
|
82 |
/* file.c */ |
/* file.c */ |
83 |
int create_homedir(void); |
int create_homedir(void); |
84 |
|
int exists_file(char *fname); |
85 |
|
int exists_dir(char *fname); |
86 |
int create_file(char *fname, mode_t mode); |
int create_file(char *fname, mode_t mode); |
87 |
int create_dir(char *dname, mode_t mode); |
int create_dir(char *dname, mode_t mode); |
88 |
#ifdef CHECK_PERMISSIONS |
#ifdef CHECK_PERMISSIONS |
90 |
int check_dir_perms(char *dname, mode_t mode); |
int check_dir_perms(char *dname, mode_t mode); |
91 |
#endif |
#endif |
92 |
int read_config(char *cfg); |
int read_config(char *cfg); |
93 |
int parse_config(FILE * fp); |
int parse_config(FILE * fd); |
94 |
void set_options(char *line, regmatch_t * match); |
void set_options(char *line, regmatch_t * match); |
95 |
|
int read_passwords(void); |
96 |
|
int parse_passwords(FILE * fd); |
97 |
|
int store_passwords(account_t * accts[]); |
98 |
|
|
99 |
/* imapfilter.c */ |
/* imapfilter.c */ |
100 |
void usage(void); |
void usage(void); |
135 |
/* memory.c */ |
/* memory.c */ |
136 |
void *xmalloc(size_t size); |
void *xmalloc(size_t size); |
137 |
void *xrealloc(void *ptr, size_t size); |
void *xrealloc(void *ptr, size_t size); |
138 |
|
void xfree(void *ptr); |
139 |
char *xstrdup(const char *s); |
char *xstrdup(const char *s); |
140 |
|
|
141 |
/* misc.c */ |
/* misc.c */ |
144 |
char *xstrncpy(char *dest, const char *src, size_t size); |
char *xstrncpy(char *dest, const char *src, size_t size); |
145 |
|
|
146 |
/* passwd.c */ |
/* passwd.c */ |
147 |
void get_password(char *user, char *serv, char *passwd); |
void get_password(char *passwd, size_t pwlen); |
148 |
char *base64_encode(char *dest, char *src, int n); |
#ifdef ENCRYPTED_PASSWORDS |
149 |
int base64_decode(char *dest, char *src); |
int encrypt_passwords(FILE *fd, account_t *accts[]); |
150 |
|
int decrypt_passwords(unsigned char *buf, FILE *fd); |
151 |
|
void password_editor(void); |
152 |
|
#endif |
153 |
|
|
154 |
/* request.c */ |
/* request.c */ |
155 |
int test(void); |
int test(void); |