if parents=TRUE, create the directory if necessary */
int (*file_create_fd)(struct dbox_file *file, const char *path,
bool parents);
+ /* Initialize the mail file, but don't actually open it. */
+ int (*mail_file_set)(struct dbox_mail *mail);
/* open the mail and return its file/offset */
int (*mail_open)(struct dbox_mail *mail, uoff_t *offset_r,
struct dbox_file **file_r);
struct dbox_storage_vfuncs mdbox_deleted_dbox_storage_vfuncs = {
mdbox_file_unrefed,
mdbox_file_create_fd,
+ mdbox_mail_file_set,
mdbox_mail_open,
mdbox_deleted_mailbox_create_indexes,
mdbox_get_attachment_path_suffix,
return 0;
}
-static int mdbox_mail_file_set(struct dbox_mail *mail)
+int mdbox_mail_file_set(struct dbox_mail *mail)
{
struct mail *_mail = &mail->imail.mail.mail;
struct mdbox_mailbox *mbox = MDBOX_MAILBOX(_mail->box);
struct dbox_storage_vfuncs mdbox_dbox_storage_vfuncs = {
mdbox_file_unrefed,
mdbox_file_create_fd,
+ mdbox_mail_file_set,
mdbox_mail_open,
mdbox_mailbox_create_indexes,
mdbox_get_attachment_path_suffix,
extern struct dbox_storage_vfuncs mdbox_dbox_storage_vfuncs;
extern struct mail_vfuncs mdbox_mail_vfuncs;
+int mdbox_mail_file_set(struct dbox_mail *mail);
int mdbox_mail_open(struct dbox_mail *mail, uoff_t *offset_r,
struct dbox_file **file_r);
sdbox_set_mailbox_corrupted(_mail->box);
}
-static int sdbox_mail_file_set(struct dbox_mail *mail)
+int sdbox_mail_file_set(struct dbox_mail *mail)
{
struct mail *_mail = &mail->imail.mail.mail;
struct sdbox_mailbox *mbox = SDBOX_MAILBOX(_mail->box);
struct dbox_storage_vfuncs sdbox_dbox_storage_vfuncs = {
sdbox_file_free,
sdbox_file_create_fd,
+ sdbox_mail_file_set,
sdbox_mail_open,
sdbox_mailbox_create_indexes,
sdbox_get_attachment_path_suffix,
extern struct mail_vfuncs sdbox_mail_vfuncs;
+int sdbox_mail_file_set(struct dbox_mail *mail);
int sdbox_mail_open(struct dbox_mail *mail, uoff_t *offset_r,
struct dbox_file **file_r);