maildir-storage.h revision bfa38f13d605bdd4c6d1f257c46a57bb28c0dd06
#ifndef MAILDIR_STORAGE_H
#define MAILDIR_STORAGE_H
#include "maildir-settings.h"
#define MAILDIR_STORAGE_NAME "maildir"
#define MAILDIR_SUBSCRIPTION_FILE_NAME "subscriptions"
#define MAILDIR_INDEX_PREFIX "dovecot.index"
#define MAILDIR_UIDVALIDITY_FNAME "dovecot-uidvalidity"
/* "base,S=123:2," means:
<base> [<extra sep> <extra data> [..]] <info sep> 2 <flags sep> */
#define MAILDIR_INFO_SEP ':'
#define MAILDIR_EXTRA_SEP ','
#define MAILDIR_FLAGS_SEP ','
#define MAILDIR_INFO_SEP_S ":"
#define MAILDIR_EXTRA_SEP_S ","
#define MAILDIR_FLAGS_SEP_S ","
/* ":2," is the standard flags separator */
#define MAILDIR_KEYWORD_FIRST 'a'
#define MAILDIR_KEYWORD_LAST 'z'
/* Maildir++ extension: include file size in the filename to avoid stat() */
#define MAILDIR_EXTRA_FILE_SIZE 'S'
/* Something (can't remember what anymore) could use 'W' in filename to avoid
calculating file's virtual size (added missing CRs). */
#define MAILDIR_EXTRA_VIRTUAL_SIZE 'W'
/* How often to scan tmp/ directory for old files (based on dir's atime) */
/* Delete files having ctime older than this from tmp/. 36h is standard. */
/* How often to touch the uidlist lock file when it's locked.
This is done both when using KEEP_LOCKED flag and when syncing a large
maildir. */
#define MAILDIR_LOCK_TOUCH_SECS 10
/* If an operation fails with ENOENT, we'll check if the mailbox is deleted
or if some directory is just missing. If it's missing, we'll create the
directories and try again this many times before failing. */
#define MAILDIR_DELETE_RETRY_COUNT 3
#include "index-storage.h"
struct timeval;
struct maildir_save_context;
struct maildir_copy_context;
struct maildir_index_header {
};
struct maildir_list_index_record {
};
struct maildir_storage {
struct mail_storage storage;
const struct maildir_settings *set;
const char *temp_prefix;
};
struct maildir_mailbox {
struct maildir_storage *storage;
struct mail_index_view *flags_view;
struct timeout *keep_lock_to;
/* Filled lazily by mailbox_get_private_flags_mask() */
/* maildir sync: */
struct maildir_uidlist *uidlist;
struct maildir_keywords *keywords;
struct maildir_index_header maildir_hdr;
unsigned int synced:1;
unsigned int syncing_commit:1;
unsigned int private_flags_mask_set:1;
unsigned int backend_readonly:1;
unsigned int backend_readonly_set:1;
unsigned int sync_uidlist_refreshed:1;
};
extern struct mail_vfuncs maildir_mail_vfuncs;
/* Return -1 = error, 0 = file not found, 1 = ok */
#ifdef CONTEXT_TYPE_SAFETY
#else
#endif
struct mail_save_context *
struct maildir_filename *
struct maildir_filename *mf,
const char *basename);
const char *maildir_save_file_get_path(struct mailbox_transaction_context *t,
struct mail_index_transaction_commit_result *result);
#endif