7 |
#include <sys/types.h> |
#include <sys/types.h> |
8 |
#include <dirent.h> |
#include <dirent.h> |
9 |
|
|
10 |
|
#include "config.h" |
11 |
|
|
12 |
|
#ifdef SSL_TLS |
13 |
|
#include <openssl/ssl.h> |
14 |
|
#include <openssl/x509.h> |
15 |
|
#endif |
16 |
|
|
17 |
#ifndef DATA_H |
#ifndef DATA_H |
18 |
#include "data.h" |
#include "data.h" |
19 |
#endif |
#endif |
38 |
#define ERROR_FORK 14 |
#define ERROR_FORK 14 |
39 |
#define ERROR_UNDEFINED 15 |
#define ERROR_UNDEFINED 15 |
40 |
|
|
41 |
|
/* SSL/TLS certificate status for the server. */ |
42 |
|
#define SSL_CERT_OK 0 |
43 |
|
#define SSL_CERT_NONEXISTENT 1 |
44 |
|
#define SSL_CERT_MISMATCH 2 |
45 |
|
|
46 |
|
/* Action to be applied, concerning the SSL/TLS certificate. */ |
47 |
|
#define SSL_CERT_ACTION_ACCEPT 0 |
48 |
|
#define SSL_CERT_ACTION_REJECT 1 |
49 |
|
#define SSL_CERT_ACTION_CONTINUE 0 |
50 |
|
#define SSL_CERT_ACTION_ABORT 1 |
51 |
|
|
52 |
/* Flags that control the program's execution options. */ |
/* Flags that control the program's execution options. */ |
53 |
#define OPTION_DETAILS_QUIET 0x0001 |
#define OPTION_DETAILS_QUIET 0x0001 |
54 |
#define OPTION_DETAILS_NORMAL 0x0002 |
#define OPTION_DETAILS_NORMAL 0x0002 |
64 |
#define OPTION_DAEMON_MODE 0x0400 |
#define OPTION_DAEMON_MODE 0x0400 |
65 |
|
|
66 |
/* Other flags. */ |
/* Other flags. */ |
67 |
#define FLAG_TTY 0x01 |
#define FLAG_DAEMON_MODE 0x01 |
68 |
#define FLAG_TTY_MODIFIED 0x02 |
#define FLAG_TTY 0x02 |
69 |
#define FLAG_BLANK_PASSWORD 0x04 |
#define FLAG_TTY_MODIFIED 0x04 |
70 |
|
#define FLAG_BLANK_PASSWORD 0x08 |
71 |
|
|
72 |
/* Capabilities of mail server. */ |
/* Capabilities of mail server. */ |
73 |
#define CAPABILITY_NONE 0x00 |
#define CAPABILITY_NONE 0x00 |
170 |
|
|
171 |
#endif |
#endif |
172 |
|
|
173 |
|
#ifdef SSL_TLS |
174 |
|
int imf_ssl_cert(SSL * ssl); |
175 |
|
int imf_ssl_check_cert(X509 * pcert, unsigned char *pmd, unsigned int *pmdlen); |
176 |
|
void imf_ssl_print_cert(X509 * cert, unsigned char *md, unsigned int *mdlen); |
177 |
|
int imf_ssl_new_cert(X509 * cert); |
178 |
|
int imf_ssl_cert_mismatch(void); |
179 |
|
|
180 |
|
#endif |
181 |
|
|
182 |
/* imapfilter.c */ |
/* imapfilter.c */ |
183 |
void usage(void); |
void usage(void); |
184 |
void version(void); |
void version(void); |
198 |
|
|
199 |
/* int imap_list(int *sock, char *refer, char *mbox); */ |
/* int imap_list(int *sock, char *refer, char *mbox); */ |
200 |
int imap_subscribe(int *sock, char *mbox); |
int imap_subscribe(int *sock, char *mbox); |
201 |
int imap_examine(int *sock, char *mbox); |
|
202 |
|
/* int imap_examine(int *sock, char *mbox); */ |
203 |
int imap_select(int *sock, char *mbox); |
int imap_select(int *sock, char *mbox); |
204 |
int imap_status(int *sock, char *mbox, char *items); |
int imap_status(int *sock, char *mbox, char *items); |
205 |
int imap_create(int *sock, char *mbox); |
int imap_create(int *sock, char *mbox); |
328 |
|
|
329 |
/* socket.c */ |
/* socket.c */ |
330 |
int init_connection(int *sock, char *serv, unsigned short int port, unsigned int protocol); |
int init_connection(int *sock, char *serv, unsigned short int port, unsigned int protocol); |
331 |
int ssl_init(int *sock, unsigned int protocol); |
int init_ssl_connection(int *sock, unsigned int protocol); |
332 |
int close_connection(int *sock); |
int close_connection(int *sock); |
333 |
int socket_read(int *sock, char *buf); |
int socket_read(int *sock, char *buf); |
334 |
int socket_write(int *sock, char *data); |
int socket_write(int *sock, char *data); |