mail-storage.h revision ab9a91eb05a54f7675e0bf861aca53f417e1980d
9a18f78f38e274f4906af6ef8e1a82d844fde4ccFabiano Fidêncio/* If some operation is taking long, call notify_ok every n seconds. */
9a18f78f38e274f4906af6ef8e1a82d844fde4ccFabiano Fidêncio /* Remember message headers' MD5 sum */
9a18f78f38e274f4906af6ef8e1a82d844fde4ccFabiano Fidêncio /* Don't try to autodetect anything, require that the given data
9a18f78f38e274f4906af6ef8e1a82d844fde4ccFabiano Fidêncio contains all the necessary information. */
9a18f78f38e274f4906af6ef8e1a82d844fde4ccFabiano Fidêncio /* Don't autocreate any directories. If they don't exist,
9a18f78f38e274f4906af6ef8e1a82d844fde4ccFabiano Fidêncio fail to create the storage. */
9a18f78f38e274f4906af6ef8e1a82d844fde4ccFabiano Fidêncio /* Don't verify existence or accessibility of any directories.
9a18f78f38e274f4906af6ef8e1a82d844fde4ccFabiano Fidêncio Create the storage in any case. */
9a18f78f38e274f4906af6ef8e1a82d844fde4ccFabiano Fidêncio /* Mailbox must not be modified even if asked */
9a18f78f38e274f4906af6ef8e1a82d844fde4ccFabiano Fidêncio /* Only saving/copying mails to mailbox works. */
9a18f78f38e274f4906af6ef8e1a82d844fde4ccFabiano Fidêncio /* Remove MAIL_RECENT flags when syncing */
9a18f78f38e274f4906af6ef8e1a82d844fde4ccFabiano Fidêncio /* Don't create index files for the mailbox */
9a18f78f38e274f4906af6ef8e1a82d844fde4ccFabiano Fidêncio /* Keep mailbox exclusively locked all the time while it's open */
9a18f78f38e274f4906af6ef8e1a82d844fde4ccFabiano Fidêncio /* Enable if mailbox is used for serving POP3. This allows making
9a18f78f38e274f4906af6ef8e1a82d844fde4ccFabiano Fidêncio better caching decisions. */
9a18f78f38e274f4906af6ef8e1a82d844fde4ccFabiano Fidêncio /* Enable if mailbox is used for saving a mail delivery using MDA.
9a18f78f38e274f4906af6ef8e1a82d844fde4ccFabiano Fidêncio This causes ACL plugin to use POST right rather than INSERT. */
9a18f78f38e274f4906af6ef8e1a82d844fde4ccFabiano Fidêncio /* Force opening mailbox and ignoring any ACLs */
9a18f78f38e274f4906af6ef8e1a82d844fde4ccFabiano Fidêncio /* Open mailbox even if it's already marked as deleted */
9a18f78f38e274f4906af6ef8e1a82d844fde4ccFabiano Fidêncio /* Enable tracking modsequences */
9a18f78f38e274f4906af6ef8e1a82d844fde4ccFabiano Fidêncio /* Enable tracking expunge modsequences */
9a18f78f38e274f4906af6ef8e1a82d844fde4ccFabiano Fidêncio /* Update search results whenever the mailbox view is synced.
9a18f78f38e274f4906af6ef8e1a82d844fde4ccFabiano Fidêncio Expunged messages are removed even without this flag. */
9a18f78f38e274f4906af6ef8e1a82d844fde4ccFabiano Fidêncio /* Queue changes so _sync() can be used. */
9a18f78f38e274f4906af6ef8e1a82d844fde4ccFabiano Fidêncio MAILBOX_SEARCH_RESULT_FLAG_QUEUE_SYNC = 0x02
9a18f78f38e274f4906af6ef8e1a82d844fde4ccFabiano Fidêncio/* Maximum size for sort program (each one separately + END) */
9a18f78f38e274f4906af6ef8e1a82d844fde4ccFabiano Fidêncio MAIL_SORT_FLAG_REVERSE = 0x1000, /* reverse this mask type */
9a18f78f38e274f4906af6ef8e1a82d844fde4ccFabiano Fidêncio MAIL_SORT_END = 0x0000 /* ends sort program */
9a18f78f38e274f4906af6ef8e1a82d844fde4ccFabiano Fidêncio /* Set has_nuls / has_no_nuls fields */
9a18f78f38e274f4906af6ef8e1a82d844fde4ccFabiano Fidêncio /* specials: */
9a18f78f38e274f4906af6ef8e1a82d844fde4ccFabiano Fidêncio MAIL_FETCH_IMAP_BODYSTRUCTURE = 0x00002000,
9a18f78f38e274f4906af6ef8e1a82d844fde4ccFabiano Fidêncio /* Hide changes done in this transaction from next view sync */
9a18f78f38e274f4906af6ef8e1a82d844fde4ccFabiano Fidêncio /* External transaction. Should be used for copying and appends,
9a18f78f38e274f4906af6ef8e1a82d844fde4ccFabiano Fidêncio but nothing else. */
9a18f78f38e274f4906af6ef8e1a82d844fde4ccFabiano Fidêncio /* Always assign UIDs to messages when saving/copying. Normally this
9a18f78f38e274f4906af6ef8e1a82d844fde4ccFabiano Fidêncio is done only if it can be done easily. */
9a18f78f38e274f4906af6ef8e1a82d844fde4ccFabiano Fidêncio MAILBOX_TRANSACTION_FLAG_ASSIGN_UIDS = 0x04,
9a18f78f38e274f4906af6ef8e1a82d844fde4ccFabiano Fidêncio /* Refresh the index so lookups return latest flags/modseqs */
9a18f78f38e274f4906af6ef8e1a82d844fde4ccFabiano Fidêncio /* Don't update caching decisions no matter what we do in this
9a18f78f38e274f4906af6ef8e1a82d844fde4ccFabiano Fidêncio transaction (useful for e.g. precaching) */
9a18f78f38e274f4906af6ef8e1a82d844fde4ccFabiano Fidêncio MAILBOX_TRANSACTION_FLAG_NO_CACHE_DEC = 0x10
9a18f78f38e274f4906af6ef8e1a82d844fde4ccFabiano Fidêncio /* Make sure we sync all external changes done to mailbox */
e17e37cd0e2109e7f1bd4ae48edfc8cca85b3f93Fabiano Fidêncio /* Make sure we write all our internal changes into the mailbox */
e17e37cd0e2109e7f1bd4ae48edfc8cca85b3f93Fabiano Fidêncio /* If it's not too much trouble, check if there are some changes */
e17e37cd0e2109e7f1bd4ae48edfc8cca85b3f93Fabiano Fidêncio /* Don't sync expunges from our view */
e17e37cd0e2109e7f1bd4ae48edfc8cca85b3f93Fabiano Fidêncio /* If mailbox is currently inconsistent, fix it instead of failing. */
e17e37cd0e2109e7f1bd4ae48edfc8cca85b3f93Fabiano Fidêncio /* Syncing after an EXPUNGE command. This is just an informational
e17e37cd0e2109e7f1bd4ae48edfc8cca85b3f93Fabiano Fidêncio flag for plugins. */
e17e37cd0e2109e7f1bd4ae48edfc8cca85b3f93Fabiano Fidêncio /* Force doing a full resync of indexes. */
e17e37cd0e2109e7f1bd4ae48edfc8cca85b3f93Fabiano Fidêncio /* Add all missing data to cache and fts index ("doveadm index") */
e17e37cd0e2109e7f1bd4ae48edfc8cca85b3f93Fabiano Fidêncio /* FIXME: kludge until something better comes along:
e17e37cd0e2109e7f1bd4ae48edfc8cca85b3f93Fabiano Fidêncio Request full text search index optimization */
e17e37cd0e2109e7f1bd4ae48edfc8cca85b3f93Fabiano Fidêncio /* NULL-terminated array of keywords */
e17e37cd0e2109e7f1bd4ae48edfc8cca85b3f93Fabiano Fidêncio /* These flags can be permanently modified */
e17e37cd0e2109e7f1bd4ae48edfc8cca85b3f93Fabiano Fidêncio /* Modseqs aren't permanent (index is in memory) */
e17e37cd0e2109e7f1bd4ae48edfc8cca85b3f93Fabiano Fidêncio /* All keywords can be permanently modified */
e17e37cd0e2109e7f1bd4ae48edfc8cca85b3f93Fabiano Fidêncio /* More keywords can be created */
d2a0b4a6a220bf9a58c7306c3f673891efc419ebFabiano Fidêncio /* sum of virtual size of all messages in mailbox */
d2a0b4a6a220bf9a58c7306c3f673891efc419ebFabiano Fidêncio /* Fields that have "temp" or "yes" caching decision. */
d2a0b4a6a220bf9a58c7306c3f673891efc419ebFabiano Fidêncio const ARRAY_TYPE(const_string) *cache_fields;
d2a0b4a6a220bf9a58c7306c3f673891efc419ebFabiano Fidêncio /* All non-zero fields are changed. */
d2a0b4a6a220bf9a58c7306c3f673891efc419ebFabiano Fidêncio /* Add these fields to be temporarily cached, if they aren't already. */
d2a0b4a6a220bf9a58c7306c3f673891efc419ebFabiano Fidêncio const char *const *cache_fields;
d2a0b4a6a220bf9a58c7306c3f673891efc419ebFabiano Fidêncio /* Unreference the pool to free memory used by these changes. */
d2a0b4a6a220bf9a58c7306c3f673891efc419ebFabiano Fidêncio /* UIDVALIDITY for assigned UIDs. */
d2a0b4a6a220bf9a58c7306c3f673891efc419ebFabiano Fidêncio /* UIDs assigned to saved messages. Not necessarily ascending. */
d2a0b4a6a220bf9a58c7306c3f673891efc419ebFabiano Fidêncio /* number of modseq changes that couldn't be changed as requested */
0f623456437c96f50330fe0ff21afd9638d14e57Fabiano Fidêncio /* There are expunges that haven't been synced yet */
0f623456437c96f50330fe0ff21afd9638d14e57Fabiano Fidêncio /* IMAP UID */
0f623456437c96f50330fe0ff21afd9638d14e57Fabiano Fidêncio /* 128 bit GUID. If the actual GUID has a different size, this
0f623456437c96f50330fe0ff21afd9638d14e57Fabiano Fidêncio contains last bits of its SHA1 sum. */
0f623456437c96f50330fe0ff21afd9638d14e57Fabiano FidêncioARRAY_DEFINE_TYPE(mailbox_expunge_rec, struct mailbox_expunge_rec);
0f623456437c96f50330fe0ff21afd9638d14e57Fabiano Fidêncio /* Perform everything no matter what it takes */
0f623456437c96f50330fe0ff21afd9638d14e57Fabiano Fidêncio /* Abort if the operation would require reading message header/body */
0f623456437c96f50330fe0ff21afd9638d14e57Fabiano Fidêncio /* Abort if the operation can't be done fully using cache file */
0f623456437c96f50330fe0ff21afd9638d14e57Fabiano Fidêncio /* always set */
0f623456437c96f50330fe0ff21afd9638d14e57Fabiano Fidêncio struct mailbox_transaction_context *transaction;
0f623456437c96f50330fe0ff21afd9638d14e57Fabiano Fidêncio unsigned int saving:1; /* This mail is still being saved */
0f623456437c96f50330fe0ff21afd9638d14e57Fabiano Fidêncio unsigned int has_nuls:1; /* message data is known to contain NULs */
0f623456437c96f50330fe0ff21afd9638d14e57Fabiano Fidêncio unsigned int has_no_nuls:1; /* -''- known to not contain NULs */
0f623456437c96f50330fe0ff21afd9638d14e57Fabiano Fidêncio /* If the lookup is aborted, error is set to MAIL_ERROR_NOTPOSSIBLE */
0f623456437c96f50330fe0ff21afd9638d14e57Fabiano Fidêncio /* "* OK <text>" */
0f623456437c96f50330fe0ff21afd9638d14e57Fabiano Fidêncio void (*notify_ok)(struct mailbox *mailbox, const char *text,
0f623456437c96f50330fe0ff21afd9638d14e57Fabiano Fidêncio /* "* NO <text>" */
0f623456437c96f50330fe0ff21afd9638d14e57Fabiano Fidêncio void (*notify_no)(struct mailbox *mailbox, const char *text,
0f623456437c96f50330fe0ff21afd9638d14e57Fabiano FidêncioARRAY_DEFINE_TYPE(mailbox_virtual_patterns, struct mailbox_virtual_pattern);
0f623456437c96f50330fe0ff21afd9638d14e57Fabiano FidêncioARRAY_DEFINE_TYPE(mail_storage, struct mail_storage *);
0f623456437c96f50330fe0ff21afd9638d14e57Fabiano FidêncioARRAY_DEFINE_TYPE(mailboxes, struct mailbox *);
0f623456437c96f50330fe0ff21afd9638d14e57Fabiano Fidêncioextern ARRAY_TYPE(mail_storage) mail_storage_classes;
0f623456437c96f50330fe0ff21afd9638d14e57Fabiano Fidênciotypedef void mailbox_notify_callback_t(struct mailbox *box, void *context);
0f623456437c96f50330fe0ff21afd9638d14e57Fabiano Fidêncio/* register all mail storages */
0f623456437c96f50330fe0ff21afd9638d14e57Fabiano Fidêncio/* Register mail storage class with given name - all methods that are NULL
0f623456437c96f50330fe0ff21afd9638d14e57Fabiano Fidêncio are set to default methods */
0f623456437c96f50330fe0ff21afd9638d14e57Fabiano Fidênciovoid mail_storage_class_register(struct mail_storage *storage_class);
0f623456437c96f50330fe0ff21afd9638d14e57Fabiano Fidênciovoid mail_storage_class_unregister(struct mail_storage *storage_class);
0f623456437c96f50330fe0ff21afd9638d14e57Fabiano Fidêncio/* Find mail storage class by name */
0f623456437c96f50330fe0ff21afd9638d14e57Fabiano Fidênciostruct mail_storage *mail_storage_find_class(const char *name);
0f623456437c96f50330fe0ff21afd9638d14e57Fabiano Fidêncio/* Create a new instance of registered mail storage class with given
0f623456437c96f50330fe0ff21afd9638d14e57Fabiano Fidêncio storage-specific data. If driver is NULL, it's tried to be autodetected
0f623456437c96f50330fe0ff21afd9638d14e57Fabiano Fidêncio from ns location. If ns location is NULL, it uses the first storage that
0f623456437c96f50330fe0ff21afd9638d14e57Fabiano Fidêncio exists. The storage is put into ns->storage. */
0f623456437c96f50330fe0ff21afd9638d14e57Fabiano Fidêncioint mail_storage_create(struct mail_namespace *ns, const char *driver,
0f623456437c96f50330fe0ff21afd9638d14e57Fabiano Fidêncio enum mail_storage_flags flags, const char **error_r);
0f623456437c96f50330fe0ff21afd9638d14e57Fabiano Fidênciovoid mail_storage_unref(struct mail_storage **storage);
0f623456437c96f50330fe0ff21afd9638d14e57Fabiano Fidêncio/* Returns the mail storage settings. */
0f623456437c96f50330fe0ff21afd9638d14e57Fabiano Fidênciomail_storage_get_settings(struct mail_storage *storage) ATTR_PURE;
ee164913f9c12a557044eb469f4498b9be9a8f50Fabiano Fidênciostruct mail_user *mail_storage_get_user(struct mail_storage *storage) ATTR_PURE;
ee164913f9c12a557044eb469f4498b9be9a8f50Fabiano Fidêncio/* Set storage callback functions to use. */
ee164913f9c12a557044eb469f4498b9be9a8f50Fabiano Fidênciovoid mail_storage_set_callbacks(struct mail_storage *storage,
ee164913f9c12a557044eb469f4498b9be9a8f50Fabiano Fidêncio/* Purge storage's mailboxes (freeing disk space from expunged mails),
ee164913f9c12a557044eb469f4498b9be9a8f50Fabiano Fidêncio if supported by the storage. Otherwise just a no-op. */
ee164913f9c12a557044eb469f4498b9be9a8f50Fabiano Fidêncioint mail_storage_purge(struct mail_storage *storage);
ee164913f9c12a557044eb469f4498b9be9a8f50Fabiano Fidêncio/* Returns the error message of last occurred error. */
ee164913f9c12a557044eb469f4498b9be9a8f50Fabiano Fidêncioconst char *mail_storage_get_last_error(struct mail_storage *storage,
ee164913f9c12a557044eb469f4498b9be9a8f50Fabiano Fidêncio/* Wrapper for mail_storage_get_last_error(); */
ee164913f9c12a557044eb469f4498b9be9a8f50Fabiano Fidêncioconst char *mailbox_get_last_error(struct mailbox *box,
ee164913f9c12a557044eb469f4498b9be9a8f50Fabiano Fidêncio/* Wrapper for mail_storage_get_last_error(); */
ee164913f9c12a557044eb469f4498b9be9a8f50Fabiano Fidêncioenum mail_error mailbox_get_last_mail_error(struct mailbox *box);
ee164913f9c12a557044eb469f4498b9be9a8f50Fabiano Fidêncio/* Returns TRUE if mailboxes are files. */
ee164913f9c12a557044eb469f4498b9be9a8f50Fabiano Fidênciobool mail_storage_is_mailbox_file(struct mail_storage *storage) ATTR_PURE;
ee164913f9c12a557044eb469f4498b9be9a8f50Fabiano Fidêncio/* Initialize mailbox without actually opening any files or verifying that
ee164913f9c12a557044eb469f4498b9be9a8f50Fabiano Fidêncio it exists. Note that append and copy may open the selected mailbox again
ee164913f9c12a557044eb469f4498b9be9a8f50Fabiano Fidêncio with possibly different readonly-state. */
ee164913f9c12a557044eb469f4498b9be9a8f50Fabiano Fidênciostruct mailbox *mailbox_alloc(struct mailbox_list *list, const char *vname,
ee164913f9c12a557044eb469f4498b9be9a8f50Fabiano Fidêncio/* Like mailbox_alloc(), but use mailbox GUID. */
ee164913f9c12a557044eb469f4498b9be9a8f50Fabiano Fidênciostruct mailbox *mailbox_alloc_guid(struct mailbox_list *list,
ee164913f9c12a557044eb469f4498b9be9a8f50Fabiano Fidêncio/* Get mailbox existence state. If auto_boxes=FALSE, return
ee164913f9c12a557044eb469f4498b9be9a8f50Fabiano Fidêncio MAILBOX_EXISTENCE_NONE for autocreated mailboxes that haven't been
ee164913f9c12a557044eb469f4498b9be9a8f50Fabiano Fidêncio physically created yet */
ee164913f9c12a557044eb469f4498b9be9a8f50Fabiano Fidêncioint mailbox_exists(struct mailbox *box, bool auto_boxes,
ee164913f9c12a557044eb469f4498b9be9a8f50Fabiano Fidêncio/* Open the mailbox. If this function isn't called explicitly, it's also called
ee164913f9c12a557044eb469f4498b9be9a8f50Fabiano Fidêncio internally by lib-storage when necessary. */
ee164913f9c12a557044eb469f4498b9be9a8f50Fabiano Fidêncio/* Open mailbox as read-only using the given stream as input. */
ee164913f9c12a557044eb469f4498b9be9a8f50Fabiano Fidêncioint mailbox_open_stream(struct mailbox *box, struct istream *input);
ee164913f9c12a557044eb469f4498b9be9a8f50Fabiano Fidêncio/* Close mailbox. Same as if mailbox was freed and re-allocated. */
ee164913f9c12a557044eb469f4498b9be9a8f50Fabiano Fidêncio/* Close and free the mailbox. */
ee164913f9c12a557044eb469f4498b9be9a8f50Fabiano Fidêncio/* Create a mailbox. Returns failure if it already exists. Mailbox name is
ee164913f9c12a557044eb469f4498b9be9a8f50Fabiano Fidêncio allowed to contain multiple new nonexistent hierarchy levels. If directory
ee164913f9c12a557044eb469f4498b9be9a8f50Fabiano Fidêncio is TRUE, the mailbox should be created so that it can contain children. The
ee164913f9c12a557044eb469f4498b9be9a8f50Fabiano Fidêncio mailbox itself doesn't have to be created as long as it shows up in LIST.
ee164913f9c12a557044eb469f4498b9be9a8f50Fabiano Fidêncio If update is non-NULL, its contents are used to set initial mailbox
ee164913f9c12a557044eb469f4498b9be9a8f50Fabiano Fidêncioint mailbox_create(struct mailbox *box, const struct mailbox_update *update,
ee164913f9c12a557044eb469f4498b9be9a8f50Fabiano Fidêncio/* Update existing mailbox's metadata. */
ee164913f9c12a557044eb469f4498b9be9a8f50Fabiano Fidêncioint mailbox_update(struct mailbox *box, const struct mailbox_update *update);
ee164913f9c12a557044eb469f4498b9be9a8f50Fabiano Fidêncio/* Delete mailbox (and its parent directory, if it has no siblings) */
ee164913f9c12a557044eb469f4498b9be9a8f50Fabiano Fidêncio/* Rename mailbox. Renaming across different mailbox lists is possible only
ee164913f9c12a557044eb469f4498b9be9a8f50Fabiano Fidêncio between private namespaces and storages of the same type. If the rename
ee164913f9c12a557044eb469f4498b9be9a8f50Fabiano Fidêncio fails, the error is set to src's storage. */
ee164913f9c12a557044eb469f4498b9be9a8f50Fabiano Fidêncioint mailbox_rename(struct mailbox *src, struct mailbox *dest,
ee164913f9c12a557044eb469f4498b9be9a8f50Fabiano Fidêncio/* Subscribe/unsubscribe mailbox. Subscribing to
ee164913f9c12a557044eb469f4498b9be9a8f50Fabiano Fidêncio nonexistent mailboxes is optional. */
ee164913f9c12a557044eb469f4498b9be9a8f50Fabiano Fidêncioint mailbox_set_subscribed(struct mailbox *box, bool set);
ee164913f9c12a557044eb469f4498b9be9a8f50Fabiano Fidêncio/* Enable the given feature for the mailbox. */
ee164913f9c12a557044eb469f4498b9be9a8f50Fabiano Fidêncioint mailbox_enable(struct mailbox *box, enum mailbox_feature features);
ee164913f9c12a557044eb469f4498b9be9a8f50Fabiano Fidêncio/* Returns all enabled features. */
ee164913f9c12a557044eb469f4498b9be9a8f50Fabiano Fidênciomailbox_get_enabled_features(struct mailbox *box) ATTR_PURE;
ee164913f9c12a557044eb469f4498b9be9a8f50Fabiano Fidêncio/* Returns storage of given mailbox */
ee164913f9c12a557044eb469f4498b9be9a8f50Fabiano Fidênciostruct mail_storage *mailbox_get_storage(const struct mailbox *box) ATTR_PURE;
ee164913f9c12a557044eb469f4498b9be9a8f50Fabiano Fidêncio/* Return namespace of given mailbox. */
ee164913f9c12a557044eb469f4498b9be9a8f50Fabiano Fidênciomailbox_get_namespace(const struct mailbox *box) ATTR_PURE;
ee164913f9c12a557044eb469f4498b9be9a8f50Fabiano Fidêncio/* Returns the storage's settings. */
ee164913f9c12a557044eb469f4498b9be9a8f50Fabiano Fidênciomailbox_get_settings(struct mailbox *box) ATTR_PURE;
ee164913f9c12a557044eb469f4498b9be9a8f50Fabiano Fidêncio/* Returns name of given mailbox */
ee164913f9c12a557044eb469f4498b9be9a8f50Fabiano Fidêncioconst char *mailbox_get_name(const struct mailbox *box) ATTR_PURE;
ee164913f9c12a557044eb469f4498b9be9a8f50Fabiano Fidêncio/* Returns the virtual name of the given mailbox. This is the same as using
ee164913f9c12a557044eb469f4498b9be9a8f50Fabiano Fidêncio mail_namespace_get_vname(). */
ee164913f9c12a557044eb469f4498b9be9a8f50Fabiano Fidêncioconst char *mailbox_get_vname(const struct mailbox *box) ATTR_PURE;
ee164913f9c12a557044eb469f4498b9be9a8f50Fabiano Fidêncio/* Returns TRUE if mailbox is read-only. */
ee164913f9c12a557044eb469f4498b9be9a8f50Fabiano Fidênciobool mailbox_is_readonly(struct mailbox *box);
ee164913f9c12a557044eb469f4498b9be9a8f50Fabiano Fidêncio/* Returns TRUE if two mailboxes point to the same physical mailbox. */
ee164913f9c12a557044eb469f4498b9be9a8f50Fabiano Fidênciobool mailbox_backends_equal(const struct mailbox *box1,
ee164913f9c12a557044eb469f4498b9be9a8f50Fabiano Fidêncio/* Returns TRUE if mailbox is now in inconsistent state, meaning that
ee164913f9c12a557044eb469f4498b9be9a8f50Fabiano Fidêncio the message IDs etc. may have changed - only way to recover this
ee164913f9c12a557044eb469f4498b9be9a8f50Fabiano Fidêncio would be to fully close the mailbox and reopen it. With IMAP
ee164913f9c12a557044eb469f4498b9be9a8f50Fabiano Fidêncio connection this would mean a forced disconnection since we can't
ee164913f9c12a557044eb469f4498b9be9a8f50Fabiano Fidêncio do forced CLOSE. */
ee164913f9c12a557044eb469f4498b9be9a8f50Fabiano Fidênciobool mailbox_is_inconsistent(struct mailbox *box);
ee164913f9c12a557044eb469f4498b9be9a8f50Fabiano Fidêncio/* Gets the mailbox status information, opening the mailbox if necessary. */
ee164913f9c12a557044eb469f4498b9be9a8f50Fabiano Fidêncioint mailbox_get_status(struct mailbox *box, enum mailbox_status_items items,
ee164913f9c12a557044eb469f4498b9be9a8f50Fabiano Fidêncio/* Gets the mailbox status, requires that mailbox is already opened. */
ee164913f9c12a557044eb469f4498b9be9a8f50Fabiano Fidênciovoid mailbox_get_open_status(struct mailbox *box,
ee164913f9c12a557044eb469f4498b9be9a8f50Fabiano Fidêncio/* Gets mailbox metadata */
struct mailbox_sync_context *
#ifdef CONTEXT_TYPE_SAFETY
struct mailbox_transaction_context *
struct mailbox_transaction_context **t,
struct mailbox *
struct mailbox_header_lookup_ctx *
struct mail_search_context *
struct mail_search_result *
struct mail_keywords *
const char *const keywords[]);
struct mail_keywords *
const char **error_r);
struct mail_save_context *
replicating/restoring an existing mailbox. */
const char *envelope);
const char *uidl);
struct mailbox_transaction_context *
const char **value_r);
const char **value_r);
const char *const **value_r);
const char *const **value_r);
const char **value_r);