+enum {
+ ACL_LOOKUP = 0,
+ ACL_READ,
+ ACL_SEEN,
+ ACL_WRITE,
+ ACL_INSERT,
+ ACL_POST,
+ ACL_CREATE,
+ ACL_DELETE,
+ ACL_ADMIN,
+
+ RIGHTSMAX
+};
+
+/* ugly hack to define macro once (for pager+index) */
+#define CHECK_MX_ACL(c,f,s) if(!mx_acl_check(c,f)) \
+ {\
+ mutt_flushinp (); \
+ mutt_error(_("%s not permitted by ACL."), s); \
+ break; \
+ }
+
+typedef struct {
+ /* folder magic */
+ int type;
+ /* may we stat() it? */
+ unsigned int local : 1;
+ /* tests if given path is of its magic */
+ int (*mx_is_magic) (const char*);
+ /* tests if folder is empty */
+ int (*mx_check_empty) (const char*);
+ /* test for access */
+ int (*mx_access) (const char*, int);
+ /* read mailbox into ctx structure */
+ int (*mx_open_mailbox) (CONTEXT*);
+ /* check ACL flags; if not implemented, always assume granted
+ * permissions */
+ int (*mx_acl_check) (CONTEXT*, int);
+} mx_t;
+
+/* called from main: init all folder types */
+void mx_init (void);
+
+/* flags for mx_open_mailbox() */
+#define M_NOSORT (1<<0) /* do not sort the mailbox after opening it */
+#define M_APPEND (1<<1) /* open mailbox for appending messages */
+#define M_READONLY (1<<2) /* open in read-only mode */
+#define M_QUIET (1<<3) /* do not print any messages */
+#define M_NEWFOLDER (1<<4) /* create a new folder - same as M_APPEND, but uses
+ * safe_fopen() for mbox-style folders.
+ */
+
+/* mx_open_new_message() */
+#define M_ADD_FROM 1 /* add a From_ line */