1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen#define DBOX_SUBSCRIPTION_FILE_NAME "subscriptions"
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen#define DBOX_UIDVALIDITY_FILE_NAME "dovecot-uidvalidity"
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen/* Delete temp files having ctime older than this. */
2271d1a3dfc7191e610f039e86b9245bbc5dfb8cTimo Sirainen/* Flag specifies if the message should be in primary or alternative storage */
2271d1a3dfc7191e610f039e86b9245bbc5dfb8cTimo Sirainen#define DBOX_INDEX_FLAG_ALT MAIL_INDEX_MAIL_FLAG_BACKEND
9865d9e7c5713e41db939222ed9c0225a11fb99eTimo Sirainen /* messages' metadata contain POP3 UIDLs */
9865d9e7c5713e41db939222ed9c0225a11fb99eTimo Sirainen DBOX_INDEX_HEADER_FLAG_HAVE_POP3_UIDLS = 0x01,
9865d9e7c5713e41db939222ed9c0225a11fb99eTimo Sirainen /* messages' metadata contain POP3 orders */
9865d9e7c5713e41db939222ed9c0225a11fb99eTimo Sirainen DBOX_INDEX_HEADER_FLAG_HAVE_POP3_ORDERS = 0x02
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen /* dbox file has zero references now. it should be either freed or
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen left open in case it's accessed again soon */
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen /* create a new file using the same permissions as file.
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen if parents=TRUE, create the directory if necessary */
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen int (*file_create_fd)(struct dbox_file *file, const char *path,
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen /* open the mail and return its file/offset */
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen int (*mail_open)(struct dbox_mail *mail, uoff_t *offset_r,
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen /* create/update mailbox indexes */
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen int (*mailbox_create_indexes)(struct mailbox *box,
b9f564d00b7a115f465ffd6840341c7b8f9bfc8aTimo Sirainen /* returns attachment path suffix. mdbox returns "", sdbox returns
b9f564d00b7a115f465ffd6840341c7b8f9bfc8aTimo Sirainen "-<mailbox_guid>-<uid>" */
b9f564d00b7a115f465ffd6840341c7b8f9bfc8aTimo Sirainen const char *(*get_attachment_path_suffix)(struct dbox_file *file);
57bf90f66f393c2807b2fc543655013f61d1d9e4Timo Sirainen /* mark the mailbox corrupted */
57bf90f66f393c2807b2fc543655013f61d1d9e4Timo Sirainen void (*set_mailbox_corrupted)(struct mailbox *box);
5b62dea2f88165f3f4d87bba9011343f3ff415ffTimo Sirainen /* mark the file corrupted */
5b62dea2f88165f3f4d87bba9011343f3ff415ffTimo Sirainen void (*set_file_corrupted)(struct dbox_file *file);
804fa3f03bd9170272168a5ad214053bbe3160c7Josef 'Jeff' Sipek#define DBOX_STORAGE(s) container_of(s, struct dbox_storage, storage)
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainenvoid dbox_storage_get_list_settings(const struct mail_namespace *ns,
b9f564d00b7a115f465ffd6840341c7b8f9bfc8aTimo Sirainenint dbox_storage_create(struct mail_storage *storage,
b9f564d00b7a115f465ffd6840341c7b8f9bfc8aTimo Sirainen const char **error_r);
b9f564d00b7a115f465ffd6840341c7b8f9bfc8aTimo Sirainenvoid dbox_storage_destroy(struct mail_storage *storage);
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainenuint32_t dbox_get_uidvalidity_next(struct mailbox_list *list);
7b15788793354ca0fd4fdb4dda8e426ca1e9e9d7Timo Sirainenint dbox_mailbox_check_existence(struct mailbox *box, time_t *path_ctime_r);
7b15788793354ca0fd4fdb4dda8e426ca1e9e9d7Timo Sirainenint dbox_mailbox_open(struct mailbox *box, time_t path_ctime);
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen const struct mailbox_update *update, bool directory);
48d8312488089dc1a8360991f0881d91095c21eaTimo Sirainenint dbox_mailbox_create_indexes(struct mailbox *box,
755abfa2bc6c5f072519b545faa1487357046b27Timo Sirainenint dbox_verify_alt_storage(struct mailbox_list *list);