23 |
#define OPTION_DETAILS_VERBOSE 0x04 |
#define OPTION_DETAILS_VERBOSE 0x04 |
24 |
#define OPTION_DETAILS_CLEAR 0xf8 |
#define OPTION_DETAILS_CLEAR 0xf8 |
25 |
#define OPTION_HEADERS 0x08 |
#define OPTION_HEADERS 0x08 |
26 |
|
#define OPTION_NAMESPACE 0x10 |
27 |
|
|
28 |
|
/* Capabilities of mail server. */ |
29 |
|
#define CAPABILITY_NONE 0x00 |
30 |
|
#define CAPABILITY_NAMESPACE 0x01 |
31 |
|
|
32 |
/* Flags for logger. */ |
/* Flags for logger. */ |
33 |
#define LOG_WRITE 0 |
#define LOG_WRITE 0 |
59 |
/* Buffer size of message's headers. */ |
/* Buffer size of message's headers. */ |
60 |
#define HEADERS_BUF 16384 |
#define HEADERS_BUF 16384 |
61 |
|
|
62 |
|
/* Length of mailbox namespace prefix. */ |
63 |
|
#define NAMESPACE_PREFIX_LEN 64 |
64 |
|
|
65 |
|
|
66 |
#define min(A, B) ((A) < (B) ? (A) : (B)) |
#define min(A, B) ((A) < (B) ? (A) : (B)) |
67 |
#define plural(A) ((A) == 1 ? "" : "s") |
#define plural(A) ((A) == 1 ? "" : "s") |
68 |
|
|
69 |
|
|
70 |
/* socket.c */ |
/* Namespace of mailboxes residing on mail server. */ |
71 |
#ifndef SSL_TLS |
struct namespace_t { |
72 |
int init_connection(char *serv, unsigned short int port); |
char prefix[NAMESPACE_PREFIX_LEN]; |
73 |
#else |
char delim; |
74 |
int init_connection(char *serv, unsigned short int port, unsigned int protocol); |
}; |
75 |
#endif |
|
|
int ssl_init(unsigned int protocol); |
|
|
int close_connection(void); |
|
|
int socket_read(char *buf); |
|
|
int socket_write(char *data); |
|
76 |
|
|
77 |
/* file.c */ |
/* file.c */ |
78 |
int read_config(char *cfg); |
int read_config(char *cfg); |
91 |
int imap_noop(void); |
int imap_noop(void); |
92 |
#endif |
#endif |
93 |
int imap_capability(void); |
int imap_capability(void); |
94 |
|
int imap_namespace(void); |
95 |
int imap_logout(void); |
int imap_logout(void); |
96 |
int imap_login(char *user, char *pass); |
int imap_login(char *user, char *pass); |
97 |
/* int imap_examine(char *mbox); */ |
/* int imap_examine(char *mbox); */ |
131 |
/* request.c */ |
/* request.c */ |
132 |
int test(void); |
int test(void); |
133 |
int check_capabilities(void); |
int check_capabilities(void); |
134 |
|
int check_namespace(void); |
135 |
int login(char *user, char *pass); |
int login(char *user, char *pass); |
136 |
int select_mailbox(char *mbox); |
int select_mailbox(char *mbox); |
137 |
int mailbox_status(char *mbox); |
int mailbox_status(char *mbox); |
161 |
int server_response(unsigned int tag); |
int server_response(unsigned int tag); |
162 |
int greeting_response(void); |
int greeting_response(void); |
163 |
int capability_response(unsigned int tag); |
int capability_response(unsigned int tag); |
164 |
|
int namespace_response(unsigned int tag, struct namespace_t * namesp); |
165 |
int status_response(unsigned int tag, char *mbox); |
int status_response(unsigned int tag, char *mbox); |
166 |
int select_response(unsigned int tag); |
int select_response(unsigned int tag); |
167 |
int search_response(unsigned int tag, char **mesgs); |
int search_response(unsigned int tag, char **mesgs); |
169 |
int copy_response(unsigned int tag); |
int copy_response(unsigned int tag); |
170 |
int analyze_response(char *buf); |
int analyze_response(char *buf); |
171 |
|
|
172 |
|
/* socket.c */ |
173 |
|
#ifndef SSL_TLS |
174 |
|
int init_connection(char *serv, unsigned short int port); |
175 |
|
#else |
176 |
|
int init_connection(char *serv, unsigned short int port, |
177 |
|
unsigned int protocol); |
178 |
|
#endif |
179 |
|
int ssl_init(unsigned int protocol); |
180 |
|
int close_connection(void); |
181 |
|
int socket_read(char *buf); |
182 |
|
int socket_write(char *data); |
183 |
|
|
184 |
#endif /* IMAPFILTER_H */ |
#endif /* IMAPFILTER_H */ |