122 |
# define HAVE_SSL |
# define HAVE_SSL |
123 |
#endif /* USE_OPENSSL and HAVE_OPENSSL */ |
#endif /* USE_OPENSSL and HAVE_OPENSSL */ |
124 |
|
|
125 |
|
#if defined(HAVE_TLS) || defined(HAVE_SSL) |
126 |
|
# define USE_SSL |
127 |
|
#else |
128 |
|
# undef USE_SSL |
129 |
|
#endif /* HAVE_TLS or HAVE_SSL */ |
130 |
|
|
131 |
#ifdef HAVE_PAM |
#ifdef HAVE_PAM |
132 |
# include <security/pam_appl.h> |
# include <security/pam_appl.h> |
133 |
# include <security/pam_misc.h> |
# include <security/pam_misc.h> |
224 |
#define T_DAEMON 0x00000040 |
#define T_DAEMON 0x00000040 |
225 |
#define T_STDINOUT 0x00000080 |
#define T_STDINOUT 0x00000080 |
226 |
#define T_SSL 0x00000100 |
#define T_SSL 0x00000100 |
227 |
/* -- #define T_SSL_CLIENT 0x00000200 */ |
#define T_SSL_FINISHED 0x00000200 |
228 |
/* -- #define T_SSL_SERVER 0x00000400 */ |
#define T_SSL_ONEWAY 0x00000400 |
229 |
#define T_SSL_FINISHED 0x00000800 |
#define T_SSL_CKCLIENT 0x00000800 |
230 |
#define T_SSL_ONEWAY 0x00001000 |
#define T_NAMES 0x00001000 |
231 |
#define T_SSL_CKCLIENT 0x00002000 |
#define T_LOCAL_MTA 0x00002000 |
232 |
#define T_NAMES 0x00004000 |
#define T_ALLOW_LOCAL_MTA 0x00004000 |
233 |
#define T_LOCAL_MTA 0x00008000 |
#define T_TRANSLATION_MAP 0x00008000 |
234 |
#define T_ALLOW_LOCAL_MTA 0x00010000 |
#define T_SUPERCLIENT 0x00010000 |
235 |
#define T_TRANSLATION_MAP 0x00020000 |
#define T_USER_NOTPRIVIL 0x00020000 |
236 |
#define T_SUPERCLIENT 0x00040000 |
#define T_STARTTLS 0x00040000 |
237 |
#define T_USER_NOTPRIVIL 0x00080000 |
#define T_ESMTP_AUTH 0x00080000 |
238 |
#define T_STARTTLS 0x00100000 |
#define T_NORC 0x00100000 |
239 |
#define T_ESMTP_AUTH 0x00200000 |
#define T_ALTRC 0x00200000 |
240 |
#define T_NORC 0x00400000 |
#define T_CHECK_CONFIG 0x00400000 |
241 |
#define T_ALTRC 0x00800000 |
#define T_RELAX_PERM_CHECK 0x00800000 |
242 |
#define T_CHECK_CONFIG 0x01000000 |
#define T_ENTIRE_BODY 0x01000000 |
|
#define T_RELAX_PERM_CHECK 0x02000000 |
|
|
#define T_ENTIRE_BODY 0x04000000 |
|
243 |
|
|
244 |
/* Regular expression flags */ |
/* Tags */ |
245 |
#define R_BASIC 0x00000001 |
#define R_BASIC 0x00000001 |
246 |
#define R_PERLRE 0x00000002 |
#define R_PERLRE 0x00000002 |
247 |
#define R_SCASE 0x00000004 |
#define R_SCASE 0x00000004 |
252 |
#define safe_strcpy(s, ct) \ |
#define safe_strcpy(s, ct) \ |
253 |
(s[sizeof(s) - 1] = '\0', strncpy((char *)s, (char *)ct, sizeof(s) - 1)) |
(s[sizeof(s) - 1] = '\0', strncpy((char *)s, (char *)ct, sizeof(s) - 1)) |
254 |
|
|
|
struct rc_regex; |
|
255 |
typedef struct rc_regex RC_REGEX; |
typedef struct rc_regex RC_REGEX; |
|
|
|
256 |
typedef struct assoc ASSOC; |
typedef struct assoc ASSOC; |
|
struct assoc { |
|
|
char *key; |
|
|
char *value; |
|
|
}; |
|
|
|
|
257 |
typedef struct message_struct MESSAGE; |
typedef struct message_struct MESSAGE; |
258 |
struct message_struct { |
typedef int (*net_io_t) (void *, char *, size_t, size_t *); |
259 |
struct list *commands; /* Associative list of SMTP commands */ |
typedef int (*net_close_t) (void *); |
260 |
struct list *header; /* Associative list of RFC822 headers */ |
typedef const char *(*strerror_t) (int); |
|
struct list *mime_hdr; /* List of lines before the first boundary |
|
|
marker */ |
|
|
char *body; /* Message body */ |
|
|
/* Additional data */ |
|
|
char *boundary; |
|
|
}; |
|
|
|
|
|
typedef int (*net_io_t) (void *sd, char *data, size_t size, size_t *nbytes); |
|
|
typedef int (*net_close_t) (void *sd); |
|
|
typedef const char *(*strerror_t) (int e); |
|
261 |
|
|
262 |
/* main.c */ |
/* main.c */ |
263 |
void anubis(char *arg); |
void anubis(char *); |
264 |
|
|
265 |
/* mem.c */ |
/* mem.c */ |
266 |
void *xmalloc(int); |
void *xmalloc(int); |
274 |
/* setenv.c */ |
/* setenv.c */ |
275 |
#if !defined(HAVE_SETENV) && defined(HAVE_PUTENV) |
#if !defined(HAVE_SETENV) && defined(HAVE_PUTENV) |
276 |
int setenv(const char *, const char *, int); |
int setenv(const char *, const char *, int); |
277 |
#endif /* not HAVE_SETENV and HAVE_PUTENV */ |
#endif |
278 |
|
|
279 |
/* env.c */ |
/* env.c */ |
280 |
void get_options(int, char *[]); |
void get_options(int, char *[]); |
293 |
void hostname_error(char *); |
void hostname_error(char *); |
294 |
|
|
295 |
/* log.c */ |
/* log.c */ |
296 |
void mprintf(char *format, ...); |
void mprintf(char *, ...); |
297 |
void info(int, char *, ...); |
void info(int, char *, ...); |
298 |
void filelog(char *, char *); |
void filelog(char *, char *); |
299 |
|
|
300 |
/* net.c */ |
/* net.c */ |
301 |
void net_set_io(int method, net_io_t read, net_io_t write, net_close_t close, |
void net_set_io(int, net_io_t, net_io_t, net_close_t, strerror_t); |
302 |
strerror_t strerror); |
void net_close(int, void *); |
|
void net_close(int method, void *sd); |
|
303 |
int make_remote_connection(char *, unsigned int); |
int make_remote_connection(char *, unsigned int); |
304 |
int bind_and_listen(char *, unsigned int); |
int bind_and_listen(char *, unsigned int); |
305 |
void swrite(int, void *, char *); |
void swrite(int, void *, char *); |
322 |
|
|
323 |
/* map.c */ |
/* map.c */ |
324 |
void parse_transmap(int *, char *, char *, char *, int); |
void parse_transmap(int *, char *, char *, char *, int); |
325 |
void translate_section_init(); |
void translate_section_init(void); |
326 |
|
|
327 |
/* tunnel.c */ |
/* tunnel.c */ |
328 |
void smtp_session(void *, void *); |
void smtp_session(void *, void *); |
329 |
|
|
330 |
/* message.c */ |
/* message.c */ |
331 |
void message_add_body(MESSAGE *msg, char *key, char *value); |
void message_add_body(MESSAGE *, char *, char *); |
332 |
void message_add_header(MESSAGE *msg, char *hdr, char *value); |
void message_add_header(MESSAGE *, char *, char *); |
333 |
void message_remove_headers(MESSAGE *msg, char *arg); |
void message_remove_headers(MESSAGE *, char *); |
334 |
void message_modify_headers(MESSAGE *msg, char *key, char *key2, char *value); |
void message_modify_headers(MESSAGE *, char *, char *, char *); |
335 |
void message_external_proc(MESSAGE *msg, char **argv); |
void message_external_proc(MESSAGE *, char **); |
336 |
void message_init(MESSAGE *msg); |
void message_init(MESSAGE *); |
337 |
void message_free(MESSAGE *msg); |
void message_free(MESSAGE *); |
338 |
|
|
339 |
/* exec.c */ |
/* exec.c */ |
340 |
char **gen_execargs(const char *); |
char **gen_execargs(const char *); |
341 |
int make_local_connection(char *, char **); |
int make_local_connection(char *, char **); |
342 |
char *external_program(int *, char *, char *, char *, int); |
char *external_program(int *, char *, char *, char *, int); |
343 |
char *exec_argv(int *rs, char **argv, char *src, char *dst, int dstsize); |
char *exec_argv(int *, char **, char *, char *, int); |
344 |
|
|
345 |
/* esmtp.c */ |
/* esmtp.c */ |
346 |
void esmtp_auth(void *, char *); |
void esmtp_auth(void *, char *); |
347 |
|
|
348 |
/* misc.c */ |
/* misc.c */ |
349 |
void assoc_free(ASSOC *asc); |
void assoc_free(ASSOC *); |
350 |
ASSOC *header_assoc(char *line); |
ASSOC *header_assoc(char *); |
351 |
void destroy_assoc_list(struct list **plist); |
void destroy_assoc_list(struct list **); |
352 |
void destroy_string_list(struct list **plist); |
void destroy_string_list(struct list **); |
353 |
void parse_mtaport(char *, char *, unsigned int *); |
void parse_mtaport(char *, char *, unsigned int *); |
354 |
void parse_mtahost(char *, char *, unsigned int *); |
void parse_mtahost(char *, char *, unsigned int *); |
355 |
void remline(char *, char *); |
void remline(char *, char *); |
356 |
void remcrlf(char *); |
void remcrlf(char *); |
357 |
char *substitute(char *, char **); |
char *substitute(char *, char **); |
|
char *insert(char *, char *, char *); |
|
358 |
void change_to_lower(char *); |
void change_to_lower(char *); |
359 |
|
|
360 |
/* files.c */ |
/* files.c */ |
362 |
void message_append_signature_file(MESSAGE *, char *); |
void message_append_signature_file(MESSAGE *, char *); |
363 |
|
|
364 |
/* regex.c */ |
/* regex.c */ |
365 |
int anubis_regex_match(RC_REGEX *re, char *line, int *refc, char ***refv); |
int anubis_regex_match(RC_REGEX *, char *, int *, char ***); |
366 |
RC_REGEX *anubis_regex_compile(char *line, int opt); |
RC_REGEX *anubis_regex_compile(char *, int); |
367 |
void anubis_regex_free(RC_REGEX *re); |
void anubis_regex_free(RC_REGEX *); |
368 |
char *anubis_regex_source(RC_REGEX *re); |
char *anubis_regex_source(RC_REGEX *); |
369 |
int anubis_regex_refcnt(RC_REGEX *re); |
int anubis_regex_refcnt(RC_REGEX *); |
370 |
|
|
371 |
/* rc.c */ |
/* rc.c */ |
372 |
void rc_system_init(); |
void rc_system_init(void); |
373 |
void open_rcfile(int); |
void open_rcfile(int); |
374 |
void process_rcfile(int method); |
void process_rcfile(int); |
375 |
void rcfile_process_section(int method, char *name, void *data, MESSAGE *msg); |
void rcfile_process_section(int, char *, void *, MESSAGE *); |
376 |
void rcfile_call_section(int method, char *name, void *data, MESSAGE *msg); |
void rcfile_call_section(int, char *, void *, MESSAGE *); |
377 |
|
|
378 |
/* help.c */ |
/* help.c */ |
379 |
void print_version(void); |
void print_version(void); |
401 |
|
|
402 |
/* guile.c */ |
/* guile.c */ |
403 |
#ifdef WITH_GUILE |
#ifdef WITH_GUILE |
404 |
void anubis_boot(void *closure, int argc, char **argv); |
void anubis_boot(void *, int, char **); |
405 |
void guile_load_path_append(char *filename); |
void guile_load_path_append(char *); |
406 |
void guile_debug(int enable); |
void guile_debug(int); |
407 |
void guile_load_program(char *name); |
void guile_load_program(char *); |
408 |
void guile_rewrite_line(char *procname, const char *source_line); |
void guile_rewrite_line(char *, const char *); |
409 |
void guile_postprocess_proc(char *procname, struct list **hdr, char **body); |
void guile_postprocess_proc(char *, struct list **, char **); |
410 |
void guile_section_init(); |
void guile_section_init(void); |
411 |
#endif /* WITH_GUILE */ |
#endif /* WITH_GUILE */ |
412 |
|
|
413 |
/* EOF */ |
/* EOF */ |