Back to index

citadel  8.12
serv_sieve.h
Go to the documentation of this file.
00001 
00002 
00003 #include <sieve2.h>
00004 #include <sieve2_error.h>
00005 
00006 struct sdm_script {
00007        struct sdm_script *next;
00008        char script_name[256];
00009        int script_active;
00010        char *script_content;
00011 };
00012 
00013 struct sdm_vacation {
00014        struct sdm_vacation *next;
00015        char fromaddr[256];
00016        time_t timestamp;
00017 };
00018 
00019 struct sdm_userdata {
00020        sieve2_context_t *sieve2_context;  
00021        long config_msgnum;                
00022        char config_roomname[ROOMNAMELEN];
00023        long lastproc;                            
00024        struct sdm_script *first_script;
00025        struct sdm_vacation *first_vacation;
00026 };
00027 
00028 struct ctdl_sieve {
00029        char *rfc822headers;
00030        int cancel_implicit_keep;   /* Set to 1 if the message was successfully acted upon */
00031        int keep;                   /* Set to 1 to suppress message deletion from the inbox */
00032        long usernum;               /* Owner of the mailbox we're processing */
00033        long msgnum;                /* Message base ID of the message being processed */
00034        struct sdm_userdata *u;            /* Info related to the current session */
00035        char recp_user[256];
00036        char recp_node[256];
00037        char recp_name[256];
00038        char sender[256];           /* To whom shall we send reject bounces or vacation messages? */
00039        char subject[1024];         /* Retain msg subject so we can use it in vacation messages */
00040        char envelope_from[1024];
00041        char envelope_to[1024];
00042 };
00043 
00044 
00045 /* If you change this string you will break all of your Sieve configs. */
00046 #define CTDLSIEVECONFIGSEPARATOR   "\n-=<CtdlSieveConfigSeparator>=-\n"
00047 
00048 /* Maximum time we keep vacation fromaddr records online.  This implies that a vacation
00049  * rule cannot exceed this amount of time.   (Any more than 30 days is a ridiculously
00050  * long vacation which the person probably doesn't deserve.)
00051  */
00052 #define MAX_VACATION 30
00053 
00054 extern struct RoomProcList *sieve_list;
00055 
00056 void sieve_queue_room(struct ctdlroom *);
00057 void perform_sieve_processing(void);
00058 
00059 void msiv_load(struct sdm_userdata *u);
00060 void msiv_store(struct sdm_userdata *u, int changes_made);
00061 int msiv_setactive(struct sdm_userdata *u, char *script_name);
00062 char *msiv_getscript(struct sdm_userdata *u, char *script_name);
00063 int msiv_deletescript(struct sdm_userdata *u, char *script_name);
00064 void msiv_putscript(struct sdm_userdata *u, char *script_name, char *script_content);
00065 extern char *msiv_extensions;