maildir-storage.h revision 303079fb1b356981de656c9b3d419a925c6e70a3
#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_UNLINK_DIRNAME "DOVECOT-TRASHED"
#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
#define MAILDIR_SAVE_FLAG_HARDLINK 0x10000000
#define MAILDIR_SAVE_FLAG_DELETED 0x20000000
/* 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"
#include "mailbox-list-private.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;
unsigned int save_size_in_filename:1;
};
struct maildir_mailbox {
struct index_mailbox ibox;
struct maildir_storage *storage;
struct mail_index_view *flags_view;
struct timeout *keep_lock_to;
/* maildir sync: */
struct maildir_uidlist *uidlist;
struct maildir_keywords *keywords;
struct maildir_index_header maildir_hdr;
unsigned int syncing_commit:1;
};
struct maildir_transaction_context {
struct index_transaction_context ictx;
struct maildir_save_context *save_ctx;
};
extern struct mail_vfuncs maildir_mail_vfuncs;
/* Return -1 = error, 0 = file not found, 1 = ok */
#ifdef CONTEXT_TYPE_SAFETY
#else
#endif
void maildir_transaction_class_init(void);
void maildir_transaction_class_deinit(void);
struct mail_save_context *
struct maildir_save_context *
struct mail_keywords *keywords,
const char *maildir_save_file_get_path(struct mailbox_transaction_context *t,
#endif