mail-storage.h revision 9293bf90039454f47e94e4ba3722a775cfa7d25c
25757faf029c369a8318349dafe952e2358df1d8Timo Sirainen/* If some operation is taking long, call notify_ok every n seconds. */
25757faf029c369a8318349dafe952e2358df1d8Timo Sirainen /* Print debugging information while initializing the storage */
25757faf029c369a8318349dafe952e2358df1d8Timo Sirainen /* Allow full filesystem access with absolute or relative paths. */
25757faf029c369a8318349dafe952e2358df1d8Timo Sirainen /* Don't try to mmap() files */
25757faf029c369a8318349dafe952e2358df1d8Timo Sirainen /* Don't try to write() to mmap()ed files. Required for the few
25757faf029c369a8318349dafe952e2358df1d8Timo Sirainen OSes that don't have unified buffer cache
16f46efe0e090fe6975acf012a61a160f4787985Andrey Panin (currently OpenBSD <= 3.5) */
25757faf029c369a8318349dafe952e2358df1d8Timo Sirainen /* Remember message headers' MD5 sum */
25757faf029c369a8318349dafe952e2358df1d8Timo Sirainen /* Use CRLF linefeeds when saving mails. */
25757faf029c369a8318349dafe952e2358df1d8Timo Sirainen /* Don't try to autodetect anything, require that the given data
25757faf029c369a8318349dafe952e2358df1d8Timo Sirainen contains all the necessary information. */
25757faf029c369a8318349dafe952e2358df1d8Timo Sirainen /* Don't autocreate any directories. If they don't exist,
25757faf029c369a8318349dafe952e2358df1d8Timo Sirainen fail to create the storage. */
25757faf029c369a8318349dafe952e2358df1d8Timo Sirainen /* Rely on O_EXCL when creating dotlocks */
7242e1ce7803b83bc82e239ef111b47c1c72dd4bAndrey Panin /* Flush NFS caches for mail storage / index */
d1414c09cf0d58ac983054e2f4e1a1f329272dcfTimo Sirainen /* Don't use fsync() or fdatasync() */
d1414c09cf0d58ac983054e2f4e1a1f329272dcfTimo Sirainen /* Mailbox must not be modified even if asked */
d1414c09cf0d58ac983054e2f4e1a1f329272dcfTimo Sirainen /* Only saving/copying mails to mailbox works. */
e70d5895795732b8247ab9abb045b438e954bc46Timo Sirainen /* Any extra time consuming operations shouldn't be performed
e70d5895795732b8247ab9abb045b438e954bc46Timo Sirainen (eg. when opening mailbox just for STATUS). */
e70d5895795732b8247ab9abb045b438e954bc46Timo Sirainen /* Don't reset MAIL_RECENT flags when syncing */
e70d5895795732b8247ab9abb045b438e954bc46Timo Sirainen /* Don't create index files for the mailbox */
e70d5895795732b8247ab9abb045b438e954bc46Timo Sirainen /* Keep mailbox exclusively locked all the time while it's open */
648d24583c1574441c4fa0331a90bd4d6e7996c5Timo Sirainen /* Enable tracking modsequences */
e70d5895795732b8247ab9abb045b438e954bc46Timo Sirainen /* Enable tracking expunge modsequences */
704fbadd78375da18dcaf2c5d93ac8cfe2c61358Timo Sirainen/* Maximum size for sort program (each one separately + END) */
2c38504860da8a8de915f8e0f5f39d7e7bd00cf8Timo Sirainen MAIL_SORT_FLAG_REVERSE = 0x1000, /* reverse this mask type */
6e873f135368bcfdd1de4458dded791d0c4d00cdTimo Sirainen MAIL_SORT_END = 0x0000 /* ends sort program */
25757faf029c369a8318349dafe952e2358df1d8Timo Sirainen /* Set has_nuls / has_no_nuls fields */
8eea67470c1bd8562a62e7445d930bb2079b1a43Timo Sirainen /* specials: */
6e873f135368bcfdd1de4458dded791d0c4d00cdTimo Sirainen /* Hide changes done in this transaction from next view sync */
e9e2d23e1ea5a149a7d8828d2a45b9f2313c3785Timo Sirainen /* External transaction. Should be used for copying and appends,
e9e2d23e1ea5a149a7d8828d2a45b9f2313c3785Timo Sirainen but nothing else. */
b7c2065b3f10f9ae27787a9db5aaefbfc70d4502Timo Sirainen /* Always assign UIDs to messages when saving/copying. Normally this
f97cf1c086715db87094bc3d0a4fefdd80bd869cTimo Sirainen is done only if the mailbox is synced, or if dest_mail parameter
0469ed17dafcc56589ce00960a23f4f06817dfb5Timo Sirainen was non-NULL to mailbox_save_init() or mailbox_copy() */
25757faf029c369a8318349dafe952e2358df1d8Timo Sirainen /* Refresh the index so lookups return latest flags/modseqs */
enum mailbox_sync_flags {
enum mailbox_sync_type {
struct message_part;
struct mail_namespace;
struct mail_storage;
struct mail_search_arg;
struct mail_keywords;
struct mail_save_context;
struct mailbox;
struct mailbox_transaction_context;
struct mailbox_status {
struct mailbox_sync_rec {
struct mail {
struct mail_storage_callbacks {
void *context);
void *context);
void mail_storage_init(void);
void mail_storage_deinit(void);
void mail_storage_register_all(void);
const char **error_r);
void *context);
bool directory);
const char *name);
const char *name);
struct mailbox_sync_context *
#ifdef CONTEXT_TYPE_SAFETY
struct mailbox_transaction_context *
/* If no messages were saved/copied, first/last_saved_uid_r are 0. */
struct mailbox *
struct mail_keywords *
const char *const keywords[]);
struct mailbox_header_lookup_ctx *
struct mail_search_context *
const char **value_r);
const char **value_r);
const char *const **value_r);
const char *const **value_r);
const char **value_r);