2011-11-14 15:57:52 +01:00
|
|
|
/*
|
|
|
|
* piler.h, SJ
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _PILER_H
|
|
|
|
#define _PILER_H
|
|
|
|
|
|
|
|
#include <misc.h>
|
|
|
|
#include <list.h>
|
|
|
|
#include <parser.h>
|
|
|
|
#include <errmsg.h>
|
|
|
|
#include <smtpcodes.h>
|
|
|
|
#include <decoder.h>
|
2011-11-16 14:47:47 +01:00
|
|
|
#include <list.h>
|
2011-11-19 21:25:44 +01:00
|
|
|
#include <rules.h>
|
2011-11-14 15:57:52 +01:00
|
|
|
#include <defs.h>
|
2011-11-19 21:25:44 +01:00
|
|
|
#include <tai.h>
|
2011-11-14 15:57:52 +01:00
|
|
|
#include <sig.h>
|
|
|
|
#include <av.h>
|
2011-11-19 21:25:44 +01:00
|
|
|
#include <rules.h>
|
2011-11-14 15:57:52 +01:00
|
|
|
#include <config.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
|
|
|
|
#ifdef HAVE_MEMCACHED
|
|
|
|
#include "memc.h"
|
|
|
|
#endif
|
|
|
|
|
2011-11-22 12:31:54 +01:00
|
|
|
int read_key(struct __config *cfg);
|
2013-01-31 22:20:23 +01:00
|
|
|
void insert_offset(struct session_data *sdata, int server_id);
|
2011-11-22 12:31:54 +01:00
|
|
|
|
2012-10-03 23:32:44 +02:00
|
|
|
int do_av_check(struct session_data *sdata, char *rcpttoemail, char *virusinfo, struct __data *data, struct __config *cfg);
|
2011-11-14 15:57:52 +01:00
|
|
|
|
2011-12-29 12:11:28 +01:00
|
|
|
int make_digests(struct session_data *sdata, struct __config *cfg);
|
2011-11-19 21:25:44 +01:00
|
|
|
void digest_file(char *filename, char *digest);
|
2012-01-09 23:15:39 +01:00
|
|
|
void digest_string(char *s, char *digest);
|
2011-11-14 15:57:52 +01:00
|
|
|
|
2012-01-07 00:00:36 +01:00
|
|
|
int handle_smtp_session(int new_sd, struct __data *data, struct __config *cfg);
|
|
|
|
|
2012-12-15 21:25:36 +01:00
|
|
|
void remove_stripped_attachments(struct _state *state);
|
2012-02-07 17:21:23 +01:00
|
|
|
int process_message(struct session_data *sdata, struct _state *state, struct __data *data, struct __config *cfg);
|
2011-11-19 21:25:44 +01:00
|
|
|
int store_file(struct session_data *sdata, char *filename, int startpos, int len, struct __config *cfg);
|
2012-05-29 14:08:56 +02:00
|
|
|
int remove_stored_message_files(struct session_data *sdata, struct _state *state, struct __config *cfg);
|
2013-01-28 12:10:39 +01:00
|
|
|
int store_attachments(struct session_data *sdata, struct _state *state, struct __data *data, struct __config *cfg);
|
|
|
|
int query_attachments(struct session_data *sdata, struct __data *data, struct ptr_array *ptr_arr, struct __config *cfg);
|
2011-11-14 15:57:52 +01:00
|
|
|
|
|
|
|
struct __config read_config(char *configfile);
|
|
|
|
|
|
|
|
void check_and_create_directories(struct __config *cfg, uid_t uid, gid_t gid);
|
|
|
|
|
2012-01-07 00:00:36 +01:00
|
|
|
void update_counters(struct session_data *sdata, struct __data *data, struct __counters *counters, struct __config *cfg);
|
2011-11-14 15:57:52 +01:00
|
|
|
|
2013-01-28 12:10:39 +01:00
|
|
|
int retrieve_email_from_archive(struct session_data *sdata, struct __data *data, FILE *dest, struct __config *cfg);
|
2012-01-07 16:40:06 +01:00
|
|
|
|
2012-02-07 17:21:23 +01:00
|
|
|
int prepare_a_mysql_statement(struct session_data *sdata, MYSQL_STMT **stmt, char *s);
|
|
|
|
|
2012-05-26 15:18:22 +02:00
|
|
|
int import_message(char *filename, struct session_data *sdata, struct __data *data, struct __config *cfg);
|
2013-01-28 13:40:44 +01:00
|
|
|
unsigned long get_folder_id(struct session_data *sdata, struct __data *data, char *foldername, int parent_id);
|
|
|
|
unsigned long add_new_folder(struct session_data *sdata, struct __data *data, char *foldername, int parent_id);
|
2012-01-07 16:40:06 +01:00
|
|
|
|
2012-08-23 10:23:58 +02:00
|
|
|
int store_index_data(struct session_data *sdata, struct _state *state, struct __data *data, uint64 id, struct __config *cfg);
|
2012-06-01 14:25:49 +02:00
|
|
|
|
2012-09-11 14:11:17 +02:00
|
|
|
void extract_attachment_content(struct session_data *sdata, struct _state *state, char *filename, char *type, int *rec);
|
|
|
|
|
2012-10-03 23:32:44 +02:00
|
|
|
int retrieve_file_from_archive(char *filename, int mode, char **buffer, FILE *dest, struct __config *cfg);
|
|
|
|
|
2013-01-06 22:16:21 +01:00
|
|
|
void load_mydomains(struct session_data *sdata, struct __data *data, struct __config *cfg);
|
|
|
|
|
2013-02-15 20:58:58 +01:00
|
|
|
int create_prepared_statements(struct session_data *sdata, struct __data *data);
|
|
|
|
void close_prepared_statements(struct __data *data);
|
|
|
|
|
2011-11-14 15:57:52 +01:00
|
|
|
#endif /* _PILER_H */
|
|
|
|
|