mbox-storage.h revision 1a073dd6184645b026583274e05afba10dcc20bb
#ifndef MBOX_STORAGE_H
#define MBOX_STORAGE_H
#include "index-storage.h"
#include "mbox-settings.h"
#include "mbox-md5.h"
/* Padding to leave in X-Keywords header when rewriting mbox */
#define MBOX_HEADER_PADDING 50
/* Don't write Content-Length header unless it's value is larger than this. */
#define MBOX_MIN_CONTENT_LENGTH_SIZE 1024
#define MBOX_STORAGE_NAME "mbox"
#define MBOX_SUBSCRIPTION_FILE_NAME ".subscriptions"
#define MBOX_INDEX_PREFIX "dovecot.index"
#define MBOX_INDEX_DIR_NAME ".imap"
#define MBOX_UIDVALIDITY_FNAME "dovecot-uidvalidity"
struct mbox_index_header {
};
struct mbox_storage {
struct mail_storage storage;
const struct mbox_settings *set;
enum mbox_lock_type *read_locks;
enum mbox_lock_type *write_locks;
unsigned int lock_settings_initialized:1;
};
struct mbox_mailbox {
struct mbox_storage *storage;
int mbox_fd;
int mbox_lock_type;
unsigned int mbox_excl_locks, mbox_shared_locks;
struct dotlock *mbox_dotlock;
unsigned int mbox_lock_id, mbox_global_lock_id;
struct timeout *keep_lock_to;
bool mbox_writeonly;
struct mbox_index_header mbox_hdr;
const struct mailbox_update *sync_hdr_update;
struct mbox_md5_vfuncs md5_v;
unsigned int no_mbox_file:1;
unsigned int invalid_mbox_file:1;
unsigned int mbox_broken_offsets:1;
unsigned int mbox_save_md5:1;
unsigned int mbox_dotlocked:1;
unsigned int mbox_used_privileges:1;
unsigned int mbox_privileged_locking:1;
unsigned int syncing:1;
unsigned int backend_readonly:1;
unsigned int backend_readonly_set:1;
};
struct mbox_transaction_context {
struct mailbox_transaction_context t;
unsigned int mbox_lock_id;
};
extern struct mail_vfuncs mbox_mail_vfuncs;
extern const char *mbox_hide_headers[], *mbox_save_drop_headers[];
extern unsigned int mbox_hide_headers_count, mbox_save_drop_headers_count;
struct mailbox_sync_context *
struct mail_save_context *
struct mail_index_transaction_commit_result *result);
#endif