maildir-storage.h revision ce742bbf646d5cc46c6aff6d8da7786c13203f47
4bc96ba6f1d67a90a75fa131bcd2cd508ea5a05aTimo Sirainen#define MAILDIR_SUBSCRIPTION_FILE_NAME "subscriptions"
4bc96ba6f1d67a90a75fa131bcd2cd508ea5a05aTimo Sirainen#define MAILDIR_UNLINK_DIRNAME "DOVECOT-TRASHED"
4bc96ba6f1d67a90a75fa131bcd2cd508ea5a05aTimo Sirainen/* "base,S=123:2," means:
4bc96ba6f1d67a90a75fa131bcd2cd508ea5a05aTimo Sirainen <base> [<extra sep> <extra data> [..]] <info sep> 2 <flags sep> */
63e2edd14ae7b1dc4a08e2e659501dbf519462f9Timo Sirainen/* ":2," is the standard flags separator */
63e2edd14ae7b1dc4a08e2e659501dbf519462f9Timo Sirainen#define MAILDIR_FLAGS_FULL_SEP MAILDIR_INFO_SEP_S "2" MAILDIR_FLAGS_SEP_S
029cfcdce65b284d5230adf1c920a5f526b03b5cTimo Sirainen#define MAILDIR_MAX_KEYWORDS (MAILDIR_KEYWORD_LAST - MAILDIR_KEYWORD_FIRST + 1)
029cfcdce65b284d5230adf1c920a5f526b03b5cTimo Sirainen/* Maildir++ extension: include file size in the filename to avoid stat() */
029cfcdce65b284d5230adf1c920a5f526b03b5cTimo Sirainen/* Something (can't remember what anymore) could use 'W' in filename to avoid
029cfcdce65b284d5230adf1c920a5f526b03b5cTimo Sirainen calculating file's virtual size (added missing CRs). */
90c23747727c85f80e4e8eed7968f0edbeac7ac5Timo Sirainen/* How often to scan tmp/ directory for old files (based on dir's atime) */
90c23747727c85f80e4e8eed7968f0edbeac7ac5Timo Sirainen/* Delete files having ctime older than this from tmp/. 36h is standard. */
90c23747727c85f80e4e8eed7968f0edbeac7ac5Timo Sirainen/* How often to touch the uidlist lock file when it's locked.
90c23747727c85f80e4e8eed7968f0edbeac7ac5Timo Sirainen This is done both when using KEEP_LOCKED flag and when syncing a large
90c23747727c85f80e4e8eed7968f0edbeac7ac5Timo Sirainen/* If an operation fails with ENOENT, we'll check if the mailbox is deleted
90c23747727c85f80e4e8eed7968f0edbeac7ac5Timo Sirainen or if some directory is just missing. If it's missing, we'll create the
90c23747727c85f80e4e8eed7968f0edbeac7ac5Timo Sirainen directories and try again this many times before failing. */
4bc96ba6f1d67a90a75fa131bcd2cd508ea5a05aTimo Sirainen uint32_t new_check_time, new_mtime, new_mtime_nsecs;
19e8adccba16ff419f5675b1575358c2956dce83Timo Sirainen uint32_t cur_check_time, cur_mtime, cur_mtime_nsecs;
4bc96ba6f1d67a90a75fa131bcd2cd508ea5a05aTimo Sirainen union mailbox_list_module_context list_module_ctx;
4bc96ba6f1d67a90a75fa131bcd2cd508ea5a05aTimo Sirainen /* maildir sync: */
4bc96ba6f1d67a90a75fa131bcd2cd508ea5a05aTimo Sirainen union mail_index_transaction_module_context module_ctx;
029cfcdce65b284d5230adf1c920a5f526b03b5cTimo Sirainen/* Return -1 = error, 0 = file not found, 1 = ok */
029cfcdce65b284d5230adf1c920a5f526b03b5cTimo Sirainentypedef int maildir_file_do_func(struct maildir_mailbox *mbox,
4bc96ba6f1d67a90a75fa131bcd2cd508ea5a05aTimo Sirainenint maildir_file_do(struct maildir_mailbox *mbox, uint32_t uid,
029cfcdce65b284d5230adf1c920a5f526b03b5cTimo Sirainen maildir_file_do_func *callback, void *context);
4bc96ba6f1d67a90a75fa131bcd2cd508ea5a05aTimo Sirainen# define maildir_file_do(mbox, seq, callback, context) \
4bc96ba6f1d67a90a75fa131bcd2cd508ea5a05aTimo Sirainen ({(void)(1 ? 0 : callback((struct maildir_mailbox *)NULL, \
4bc96ba6f1d67a90a75fa131bcd2cd508ea5a05aTimo Sirainen (maildir_file_do_func *)callback, context); })
4bc96ba6f1d67a90a75fa131bcd2cd508ea5a05aTimo Sirainen# define maildir_file_do(mbox, seq, callback, context) \
4bc96ba6f1d67a90a75fa131bcd2cd508ea5a05aTimo Sirainen maildir_file_do(mbox, seq, (maildir_file_do_func *)callback, context)
4bc96ba6f1d67a90a75fa131bcd2cd508ea5a05aTimo Sirainenbool maildir_set_deleted(struct maildir_mailbox *mbox);
4bc96ba6f1d67a90a75fa131bcd2cd508ea5a05aTimo Sirainenint maildir_save_init(struct mailbox_transaction_context *_t,
85144b5f0bc763de14c7d87291a90ef74ac241a2Timo Sirainen enum mail_flags flags, struct mail_keywords *keywords,
85144b5f0bc763de14c7d87291a90ef74ac241a2Timo Sirainen const char *from_envelope, struct istream *input,
85144b5f0bc763de14c7d87291a90ef74ac241a2Timo Sirainen struct mail *dest_mail, struct mail_save_context **ctx_r);
85144b5f0bc763de14c7d87291a90ef74ac241a2Timo Sirainenint maildir_save_continue(struct mail_save_context *ctx);
85144b5f0bc763de14c7d87291a90ef74ac241a2Timo Sirainenint maildir_save_finish(struct mail_save_context *ctx);
85144b5f0bc763de14c7d87291a90ef74ac241a2Timo Sirainenvoid maildir_save_cancel(struct mail_save_context *ctx);
85144b5f0bc763de14c7d87291a90ef74ac241a2Timo Sirainenmaildir_save_transaction_init(struct maildir_transaction_context *t);
85144b5f0bc763de14c7d87291a90ef74ac241a2Timo Sirainenuint32_t maildir_save_add(struct maildir_transaction_context *t,
85144b5f0bc763de14c7d87291a90ef74ac241a2Timo Sirainen const char *base_fname, enum mail_flags flags,
4bc96ba6f1d67a90a75fa131bcd2cd508ea5a05aTimo Sirainenconst char *maildir_save_file_get_path(struct mailbox_transaction_context *t,
85144b5f0bc763de14c7d87291a90ef74ac241a2Timo Sirainenint maildir_transaction_save_commit_pre(struct maildir_save_context *ctx);
85144b5f0bc763de14c7d87291a90ef74ac241a2Timo Sirainenvoid maildir_transaction_save_commit_post(struct maildir_save_context *ctx);
85144b5f0bc763de14c7d87291a90ef74ac241a2Timo Sirainenvoid maildir_transaction_save_rollback(struct maildir_save_context *ctx);
0bf3eac1110a902e7ec7e695c64e8e46c114e623Timo Sirainenint maildir_copy(struct mailbox_transaction_context *t, struct mail *mail,
85144b5f0bc763de14c7d87291a90ef74ac241a2Timo Sirainen enum mail_flags flags, struct mail_keywords *keywords,
85144b5f0bc763de14c7d87291a90ef74ac241a2Timo Sirainenint maildir_transaction_copy_commit(struct maildir_copy_context *ctx);