serv_managesieve.c is now only built on Citadel servers that
[citadel.git] / citadel / serv_sieve.h
1 /*
2  * $Id: $
3  */
4
5
6 #ifdef HAVE_LIBSIEVE
7
8 #include <sieve2.h>
9 #include <sieve2_error.h>
10
11 struct sdm_script {
12         struct sdm_script *next;
13         char script_name[256];
14         int script_active;
15         char *script_content;
16 };
17
18 struct sdm_userdata {
19         sieve2_context_t *sieve2_context;       /**< for libsieve's use */
20         long config_msgnum;                     /**< confirms that a sieve config was located */
21         char config_roomname[ROOMNAMELEN];
22         long lastproc;                          /**< last message processed */
23         struct sdm_script *first_script;
24 };
25
26 struct ctdl_sieve {
27         char *rfc822headers;
28         int actiontaken;                /* Set to 1 if the message was successfully acted upon */
29         int keep;                       /* Set to 1 to suppress message deletion from the inbox */
30         long usernum;                   /* Owner of the mailbox we're processing */
31         long msgnum;                    /* Message base ID of the message being processed */
32         struct sdm_userdata *u;         /* Info related to the current session */
33 };
34
35
36 /* If you change this string you will break all of your Sieve configs. */
37 #define CTDLSIEVECONFIGSEPARATOR        "\n-=<CtdlSieveConfigSeparator>=-\n"
38
39 extern struct RoomProcList *sieve_list;
40
41 void sieve_queue_room(struct ctdlroom *);
42 void perform_sieve_processing(void);
43
44 void msiv_load(struct sdm_userdata *u);
45 void msiv_store(struct sdm_userdata *u);
46 int msiv_setactive(struct sdm_userdata *u, char *script_name);
47 char *msiv_getscript(struct sdm_userdata *u, char *script_name);
48 int msiv_deletescript(struct sdm_userdata *u, char *script_name);
49 void msiv_putscript(struct sdm_userdata *u, char *script_name, char *script_content);
50
51 #endif /* HAVE_LIBSIEVE */