Mailing list header changes (fuck you Google)
[citadel.git] / citadel / serv_sieve.h
1
2 #include <sieve2.h>
3 #include <sieve2_error.h>
4
5 struct sdm_script {
6         struct sdm_script *next;
7         char script_name[256];
8         int script_active;
9         char *script_content;
10 };
11
12 struct sdm_vacation {
13         struct sdm_vacation *next;
14         char fromaddr[256];
15         time_t timestamp;
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         struct sdm_vacation *first_vacation;
25 };
26
27 struct ctdl_sieve {
28         char *rfc822headers;
29         int cancel_implicit_keep;       /* Set to 1 if the message was successfully acted upon */
30         int keep;                       /* Set to 1 to suppress message deletion from the inbox */
31         long usernum;                   /* Owner of the mailbox we're processing */
32         long msgnum;                    /* Message base ID of the message being processed */
33         struct sdm_userdata *u;         /* Info related to the current session */
34         char recp_user[256];
35         char recp_node[256];
36         char recp_name[256];
37         char sender[256];               /* To whom shall we send reject bounces or vacation messages? */
38         char subject[1024];             /* Retain msg subject so we can use it in vacation messages */
39         char envelope_from[1024];
40         char envelope_to[1024];
41 };
42
43
44 /* If you change this string you will break all of your Sieve configs. */
45 #define CTDLSIEVECONFIGSEPARATOR        "\n-=<CtdlSieveConfigSeparator>=-\n"
46
47 /* Maximum time we keep vacation fromaddr records online.  This implies that a vacation
48  * rule cannot exceed this amount of time.   (Any more than 30 days is a ridiculously
49  * long vacation which the person probably doesn't deserve.)
50  */
51 #define MAX_VACATION    30
52
53 extern struct RoomProcList *sieve_list;
54
55 void sieve_queue_room(struct ctdlroom *);
56 void perform_sieve_processing(void);
57
58 void msiv_load(struct sdm_userdata *u);
59 void msiv_store(struct sdm_userdata *u, int changes_made);
60 int msiv_setactive(struct sdm_userdata *u, char *script_name);
61 char *msiv_getscript(struct sdm_userdata *u, char *script_name);
62 int msiv_deletescript(struct sdm_userdata *u, char *script_name);
63 void msiv_putscript(struct sdm_userdata *u, char *script_name, char *script_content);
64 extern char *msiv_extensions;