mail-storage-private.h revision 30d50c7e8706f2d750215e009504109ca19cd485
6c073ea23cd0e3760b072727cc18114860c27647Timo Sirainen/* Default prefix for indexes */
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen/* Block size when read()ing message header. */
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen/* Block size when read()ing message (header and) body. */
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen#define MAIL_READ_FULL_BLOCK_SIZE IO_BLOCK_SIZE
2271d1a3dfc7191e610f039e86b9245bbc5dfb8cTimo Sirainen unsigned int id;
9865d9e7c5713e41db939222ed9c0225a11fb99eTimo Sirainen unsigned int id;
9865d9e7c5713e41db939222ed9c0225a11fb99eTimo Sirainen const struct setting_parser_info *(*get_setting_parser_info)(void);
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen int (*create)(struct mail_storage *storage, struct mail_namespace *ns,
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen const char **error_r);
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen void (*destroy)(struct mail_storage *storage);
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen void (*add_list)(struct mail_storage *storage,
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen void (*get_list_settings)(const struct mail_namespace *ns,
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen bool (*autodetect)(const struct mail_namespace *ns,
dd4f30895ebbddd77e000472fbadcb3128ae2883Timo Sirainen struct mailbox *(*mailbox_alloc)(struct mail_storage *storage,
57bf90f66f393c2807b2fc543655013f61d1d9e4Timo Sirainen /* Called when mailbox list index corruption has been detected.
57bf90f66f393c2807b2fc543655013f61d1d9e4Timo Sirainen The callback should add any missing mailboxes to the list index.
5b62dea2f88165f3f4d87bba9011343f3ff415ffTimo Sirainen Returns 0 on success, -1 on temporary failure that didn't properly
5b62dea2f88165f3f4d87bba9011343f3ff415ffTimo Sirainen fix the index. */
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen int (*list_index_corrupted)(struct mail_storage *storage);
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen /* mailboxes are files, not directories */
804fa3f03bd9170272168a5ad214053bbe3160c7Josef 'Jeff' Sipek MAIL_STORAGE_CLASS_FLAG_MAILBOX_IS_FILE = 0x01,
804fa3f03bd9170272168a5ad214053bbe3160c7Josef 'Jeff' Sipek /* root_dir points to a unique directory */
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen /* mailbox_open_stream() is supported */
b9f564d00b7a115f465ffd6840341c7b8f9bfc8aTimo Sirainen /* never use quota for this storage (e.g. virtual mailboxes) */
b9f564d00b7a115f465ffd6840341c7b8f9bfc8aTimo Sirainen /* Storage doesn't need a mail root directory */
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen /* Storage uses one file per message */
7b15788793354ca0fd4fdb4dda8e426ca1e9e9d7Timo Sirainen /* Messages have GUIDs (always set mailbox_status.have_guids=TRUE) */
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen MAIL_STORAGE_CLASS_FLAG_HAVE_MAIL_GUIDS = 0x40,
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen /* mailbox_save_set_guid() works (always set
48d8312488089dc1a8360991f0881d91095c21eaTimo Sirainen mailbox_status.have_save_guids=TRUE) */
48d8312488089dc1a8360991f0881d91095c21eaTimo Sirainen MAIL_STORAGE_CLASS_FLAG_HAVE_MAIL_SAVE_GUIDS = 0x80,
755abfa2bc6c5f072519b545faa1487357046b27Timo Sirainen /* message content can be unstructured binary data
9865d9e7c5713e41db939222ed9c0225a11fb99eTimo Sirainen (e.g. zlib plugin is allowed to compress/decompress mails) */
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen /* Message GUIDs can only be 128bit (always set
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen mailbox_status.have_only_guid128) */
struct mail_binary_cache {
bool include_hdr;
struct mail_storage_error {
char *error_string;
char *last_internal_error;
bool last_error_is_internal;
struct mail_storage {
const char *name;
int refcount;
int obj_refcount;
const char *unique_root_dir;
char *last_internal_error;
char *error_string;
const char *temp_path_prefix;
void *callback_context;
struct mail_attachment_part {
struct virtual_mailbox_vfuncs {
bool only_with_msgs);
struct mailbox_vfuncs {
struct mailbox_attribute_iter *
const char *prefix);
struct mailbox_sync_context *
struct mailbox_transaction_context *
struct mail *
struct mail_search_context *
struct mail_save_context *
void (*transaction_save_commit_post)
union mailbox_module_context {
struct mail_msgpart_partial_cache {
struct mailbox_index_vsize {
struct mailbox_index_pop3_uidl {
struct mailbox_index_first_saved {
struct mailbox {
const char *name;
const char *vname;
const char *_path;
const char *_index_path;
const char *reason;
const char *index_prefix;
unsigned int transaction_count;
void *notify_context;
unsigned int generation_sequence;
struct mail_vfuncs {
const char **value_r);
const char *reason);
union mail_module_context {
struct mail_private {
const char *get_stream_reason;
struct mailbox_list_context {
bool failed;
struct mailbox_transaction_stats {
unsigned long open_lookup_count;
unsigned long stat_lookup_count;
unsigned long fstat_lookup_count;
unsigned long files_read_count;
unsigned long long files_read_bytes;
unsigned long cache_hit_count;
struct mail_save_private_changes {
unsigned int mailnum;
struct mailbox_transaction_context {
char *reason;
int mail_ref_count;
unsigned int save_count;
union mail_search_module_context {
struct mail_search_context {
struct mail_save_data {
int received_tz_offset;
unsigned int pop3_order;
struct mail_save_context {
struct mailbox_sync_context {
struct mailbox_header_lookup_ctx {
int refcount;
unsigned int count;
const char *const *name;
unsigned int *idx;
const char **path_r);
int *fd_r);
unsigned int secs);