56 |
|
|
57 |
/* Flags for logger. */ |
/* Flags for logger. */ |
58 |
#define LOG_WRITE 0 |
#define LOG_WRITE 0 |
59 |
#define LOG_SERVER 1 |
#define LOG_ACCOUNT 1 |
60 |
#define LOG_USERNAME 2 |
#define LOG_MAILBOX 2 |
61 |
#define LOG_MAILBOX 3 |
#define LOG_FILTER 3 |
62 |
#define LOG_FILTER 4 |
#define LOG_ACTION 4 |
63 |
#define LOG_ACTION 5 |
#define LOG_DESTINATION_ACCOUNT 5 |
64 |
#define LOG_DESTINATION_MAILBOX 6 |
#define LOG_DESTINATION_MAILBOX 6 |
65 |
|
|
66 |
/* Buffer size of the IMAP command. */ |
/* Buffer size of the IMAP command. */ |
117 |
|
|
118 |
/* Secure memory information. */ |
/* Secure memory information. */ |
119 |
typedef struct secmem { |
typedef struct secmem { |
120 |
void *buf; /* Allocated memory buffer. */ |
void *buf; /* Allocated memory buffer. */ |
121 |
size_t size; /* Size of the buffer. */ |
size_t size; /* Size of the buffer. */ |
122 |
struct secmem *prev, *next; /* Previous/next node of doubly linked list. */ |
struct secmem *prev, *next; /* Previous/next node of doubly linked |
123 |
|
* list. */ |
124 |
} secmem_t; |
} secmem_t; |
125 |
|
|
126 |
|
|
127 |
/* Namespace of IMAP mailboxes. */ |
/* Namespace of IMAP mailboxes. */ |
128 |
typedef struct namesp { |
typedef struct namesp { |
129 |
char prefix[NAMESPACE_PREFIX_LEN]; |
char prefix[NAMESPACE_PREFIX_LEN]; |
130 |
char delim; |
char delim; |
131 |
} namesp_t; |
} namesp_t; |
132 |
|
|
133 |
|
|
144 |
int exists_file(char *fname); |
int exists_file(char *fname); |
145 |
int exists_dir(char *fname); |
int exists_dir(char *fname); |
146 |
int create_file(char *fname, mode_t mode); |
int create_file(char *fname, mode_t mode); |
147 |
|
|
148 |
#ifdef CHECK_PERMISSIONS |
#ifdef CHECK_PERMISSIONS |
149 |
int check_file_perms(char *fname, mode_t mode); |
int check_file_perms(char *fname, mode_t mode); |
150 |
int check_dir_perms(char *dname, mode_t mode); |
int check_dir_perms(char *dname, mode_t mode); |
151 |
|
|
152 |
#endif |
#endif |
153 |
|
|
154 |
/* imapfilter.c */ |
/* imapfilter.c */ |
157 |
|
|
158 |
/* imap.c */ |
/* imap.c */ |
159 |
unsigned int send_command(int *sock, char *cmd); |
unsigned int send_command(int *sock, char *cmd); |
160 |
|
|
161 |
#ifdef DEBUG |
#ifdef DEBUG |
162 |
int imap_noop(int *sock); |
int imap_noop(int *sock); |
163 |
|
|
164 |
#endif |
#endif |
165 |
int imap_capability(int *sock); |
int imap_capability(int *sock); |
166 |
int imap_namespace(int *sock); |
int imap_namespace(int *sock); |
167 |
int imap_logout(int *sock); |
int imap_logout(int *sock); |
168 |
int imap_authenticate(int *sock, char *auth); |
int imap_authenticate(int *sock, char *auth); |
169 |
int imap_login(int *sock, char *user, char *pass); |
int imap_login(int *sock, char *user, char *pass); |
170 |
|
|
171 |
/* int imap_list(int *sock, char *refer, char *mbox); */ |
/* int imap_list(int *sock, char *refer, char *mbox); */ |
172 |
int imap_subscribe(int *sock, char *mbox); |
int imap_subscribe(int *sock, char *mbox); |
173 |
int imap_examine(int *sock, char *mbox); |
int imap_examine(int *sock, char *mbox); |
216 |
secmem_t *secmem_find(void *ptr); |
secmem_t *secmem_find(void *ptr); |
217 |
void secmem_remove(secmem_t * node); |
void secmem_remove(secmem_t * node); |
218 |
void secmem_clear(void); |
void secmem_clear(void); |
219 |
|
|
220 |
#ifdef MEMORY_LOCK |
#ifdef MEMORY_LOCK |
221 |
void secmem_lock(void); |
void secmem_lock(void); |
222 |
|
|
223 |
#endif |
#endif |
224 |
void corefile_disable(void); |
void corefile_disable(void); |
225 |
|
|
230 |
|
|
231 |
/* passwd.c */ |
/* passwd.c */ |
232 |
void get_password(char *passwd, size_t pwlen); |
void get_password(char *passwd, size_t pwlen); |
233 |
|
|
234 |
#ifdef ENCRYPTED_PASSWORDS |
#ifdef ENCRYPTED_PASSWORDS |
235 |
int encrypt_passwords(FILE * fd, account_t * accts[]); |
int encrypt_passwords(FILE * fd, account_t * accts[]); |
236 |
int decrypt_passwords(unsigned char **buf, FILE * fd); |
int decrypt_passwords(unsigned char **buf, FILE * fd); |
237 |
void password_editor(void); |
void password_editor(void); |
238 |
|
|
239 |
#endif |
#endif |
240 |
|
|
241 |
/* request.c */ |
/* request.c */ |
256 |
void queue_fifo(mask_t ** mfifo, mask_t * mask); |
void queue_fifo(mask_t ** mfifo, mask_t * mask); |
257 |
mask_t *dequeue_fifo(mask_t ** mfifo); |
mask_t *dequeue_fifo(mask_t ** mfifo); |
258 |
|
|
259 |
char *generate_filter_and(mask_t * mask, unsigned int masknum, |
char *generate_filter_and(mask_t * mask, unsigned int masknum, unsigned int masklen); |
260 |
unsigned int masklen); |
char *generate_filter_or(mask_t * mask, unsigned int masknum, unsigned int masklen); |
|
char *generate_filter_or(mask_t * mask, unsigned int masknum, |
|
|
unsigned int masklen); |
|
261 |
|
|
262 |
int apply_action(char *mesgs, unsigned int *type, account_t * raccount, |
int apply_action(char *mesgs, unsigned int *type, account_t * raccount, char *destmbox, unsigned int *msgflags, char *args); |
|
char *destmbox, unsigned int *msgflags, char *args); |
|
263 |
int action_delete(char *mesgs, char *args); |
int action_delete(char *mesgs, char *args); |
264 |
int action_copy(char *mesgs, char *destmbox, char *args); |
int action_copy(char *mesgs, char *destmbox, char *args); |
265 |
int action_move(char *mesgs, char *destmbox, char *args); |
int action_move(char *mesgs, char *destmbox, char *args); |
294 |
void check_vbuf(size_t n); |
void check_vbuf(size_t n); |
295 |
|
|
296 |
/* socket.c */ |
/* socket.c */ |
297 |
int init_connection(int *sock, char *serv, unsigned short int port, |
int init_connection(int *sock, char *serv, unsigned short int port, unsigned int protocol); |
|
unsigned int protocol); |
|
298 |
int ssl_init(int *sock, unsigned int protocol); |
int ssl_init(int *sock, unsigned int protocol); |
299 |
int close_connection(int *sock); |
int close_connection(int *sock); |
300 |
int socket_read(int *sock, char *buf); |
int socket_read(int *sock, char *buf); |