mailbox-list.h revision ff7056842f14fd3b30a2d327dfab165b9d15dd30
#ifndef __MAILBOX_LIST_H
#define __MAILBOX_LIST_H
#include "mail-error.h"
struct mail_namespace;
struct mailbox_list;
struct mailbox_list_iterate_context;
enum mailbox_list_flags {
/* Print debugging information while initializing the driver */
MAILBOX_LIST_FLAG_DEBUG = 0x01,
/* Allow full filesystem access with absolute or relative paths. */
MAILBOX_LIST_FLAG_FULL_FS_ACCESS = 0x04,
/* Rely on O_EXCL when creating dotlocks */
};
enum mailbox_info_flags {
MAILBOX_NOSELECT = 0x001,
MAILBOX_NONEXISTENT = 0x002,
MAILBOX_CHILDREN = 0x004,
MAILBOX_NOCHILDREN = 0x008,
MAILBOX_NOINFERIORS = 0x010,
MAILBOX_MARKED = 0x020,
MAILBOX_UNMARKED = 0x040
};
enum mailbox_name_status {
};
enum mailbox_list_iter_flags {
/* List only subscribed mailboxes */
MAILBOX_LIST_ITER_SUBSCRIBED = 0x01,
/* Don't return any flags unless it can be done without cost */
MAILBOX_LIST_ITER_FAST_FLAGS = 0x02,
/* Return children flags */
MAILBOX_LIST_ITER_CHILDREN = 0x04,
/* Ignore index file and ACLs (used by ACL plugin internally) */
MAILBOX_LIST_ITER_RAW_LIST = 0x08
};
enum mailbox_list_path_type {
/* Return mailbox path (eg. ~/dbox/INBOX/dbox-Mails) */
/* Return control directory */
/* Return index file directory */
};
enum mailbox_list_file_type {
};
struct mailbox_list_settings {
const char *root_dir;
const char *index_dir;
const char *control_dir;
const char *inbox_path;
const char *subscription_fname;
/* If non-empty, it means that mails exist in a maildir_name
subdirectory. eg. if you have a directory containing directories:
mail/
If mailbox_name is "Maildir", you have a non-selectable mailbox
const char *maildir_name;
/* If mailbox index is used, use these settings for it
(pointers, so they're set to NULL after init is finished): */
const enum mail_storage_flags *mail_storage_flags;
const enum file_lock_method *lock_method;
};
struct mailbox_info {
const char *name;
enum mailbox_info_flags flags;
};
/* register all drivers */
void mailbox_list_register_all(void);
/* Returns 0 if ok, -1 if initialization failed. */
const struct mailbox_list_settings *set,
enum mailbox_list_flags flags,
/* Returns TRUE if the name doesn't contain any invalid characters.
The create name check can be more strict. */
const char *name);
const char *name);
/* Return full path for the given mailbox name. The name must be a valid
existing mailbox name, or NULL to get the root directory.
For INDEX=MEMORY it returns "" as the path. */
enum mailbox_list_path_type type);
/* Returns the mode, UID and GID that should be used when creating new files
to the given mailbox. (uid_t)-1 and (gid_t)-1 is returned if it's not
necessary to change the default UID or GID. The name must be a valid
existing mailbox name, or NULL to get global permissions.
Returns -1 if error, 0 if mailbox not found, 1 if ok. */
/* Returns mailbox name status */
const char *name,
enum mailbox_name_status *status);
/* Returns a prefix that temporary files should use without conflicting
with the namespace. */
/* Returns a single mask from given reference and mask. */
/* Initialize new mailbox list request. mask may contain '%' and '*'
wildcards as defined by RFC-3501. */
struct mailbox_list_iterate_context *
enum mailbox_list_iter_flags flags);
/* Get next mailbox. Returns the mailbox name */
struct mailbox_info *
/* Deinitialize mailbox list request. Returns FALSE if some error
occurred while listing. */
/* Subscribe/unsubscribe mailbox. There should be no error when
subscribing to already subscribed mailbox. Subscribing to
unexisting mailboxes is optional. */
/* Delete the given mailbox. If it has children, they aren't deleted. */
/* If the name has inferior hierarchical names, then the inferior
hierarchical names MUST also be renamed (ie. foo -> bar renames
hierarchies.
If oldname is case-insensitively "INBOX", the mails are moved
into new mailbox but the INBOX mailbox must not be deleted. */
/* Returns the error message of last occurred error. */
enum mail_error *error_r);
#endif