]> code.citadel.org Git - citadel.git/blob - citadel/serv_sieve.h
* Implemented the 'getsubaddress' callback, but then realized
[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         char recp_user[256];
34         char recp_node[256];
35         char recp_name[256];
36 };
37
38
39 /* If you change this string you will break all of your Sieve configs. */
40 #define CTDLSIEVECONFIGSEPARATOR        "\n-=<CtdlSieveConfigSeparator>=-\n"
41
42 extern struct RoomProcList *sieve_list;
43
44 void sieve_queue_room(struct ctdlroom *);
45 void perform_sieve_processing(void);
46
47 void msiv_load(struct sdm_userdata *u);
48 void msiv_store(struct sdm_userdata *u);
49 int msiv_setactive(struct sdm_userdata *u, char *script_name);
50 char *msiv_getscript(struct sdm_userdata *u, char *script_name);
51 int msiv_deletescript(struct sdm_userdata *u, char *script_name);
52 void msiv_putscript(struct sdm_userdata *u, char *script_name, char *script_content);
53
54 #endif /* HAVE_LIBSIEVE */