1 #ifndef PERDITION_MANAGESIEVE_H
2 #define PERDITION_MANAGESIEVE_H
3 
4 #include "io.h"
5 #include "protocol_t.h"
6 #include "perdition_types.h"
7 
8 /**********************************************************************
9  * managesieve_capability_msg
10  * String for imap greeting
11  * pre: tls_flags: the encryption flags that have been set
12  *      tls_state: the current state of encryption for the session
13  *      tail: string to append to the message
14  * return capabilituy message, should be freed by caller
15  *        NULL on error
16  **********************************************************************/
17 
18 char *managesieve_capability_msg(flag_t tls_flags, flag_t tls_state,
19 				 const char *tail);
20 
21 /**********************************************************************
22  * managesieve_greeting
23  * Send a greeting to the user
24  * pre: io_t: io_t to write to
25  *	flag: Flags as per greeting.h
26  *	tls_flags: the encryption flags that have been set
27  * post: greeting is written to io
28  * return 0 on success
29  *	  -1 on error
30  **********************************************************************/
31 
32 int managesieve_greeting(io_t *io, flag_t flag);
33 
34 /**********************************************************************
35  * managesieve_initialise_protocol
36  * Initialise the protocol structure for the managesieve protocol
37  * pre: protocol: pointer to an allocated protocol structure
38  * return: seeded protocol structure
39  *	   NULL on error
40  **********************************************************************/
41 
42 protocol_t *managesieve_initialise_protocol(protocol_t *protocol);
43 
44 /**********************************************************************
45  * managesieve_capability
46  * Return the capability string to be used.
47  * pre: tls_flags: the encryption flags that have been set
48  *	tls_state: the current state of encryption for the session
49  * return: capability to use, as per protocol_capability with
50  *	   managesieve parameters
51  *	   NULL on error
52  **********************************************************************/
53 
54 char *managesieve_capability(flag_t tls_flags, flag_t tls_state);
55 
56 #endif /* PERDITION_MANAGESIEVE_H */
57