8ccdf195768afdfbc32088d7be77dfca7dddd829Stephan Bosch#define IMAP_METADATA_PRIVATE_PREFIX "/private"
8ccdf195768afdfbc32088d7be77dfca7dddd829Stephan Bosch/* Checks whether IMAP metadata entry name is valid */
8ccdf195768afdfbc32088d7be77dfca7dddd829Stephan Bosch/* Set IMAP metadata entry to value. */
8ccdf195768afdfbc32088d7be77dfca7dddd829Stephan Boschint imap_metadata_set(struct imap_metadata_transaction *imtrans,
8ccdf195768afdfbc32088d7be77dfca7dddd829Stephan Bosch const char *entry, const struct mail_attribute_value *value);
8ccdf195768afdfbc32088d7be77dfca7dddd829Stephan Bosch/* Delete IMAP metadata entry. This is just a wrapper to
8ccdf195768afdfbc32088d7be77dfca7dddd829Stephan Bosch imap_metadata_set() with value->value=NULL. */
8ccdf195768afdfbc32088d7be77dfca7dddd829Stephan Boschint imap_metadata_unset(struct imap_metadata_transaction *imtrans,
8ccdf195768afdfbc32088d7be77dfca7dddd829Stephan Bosch const char *entry);
8ccdf195768afdfbc32088d7be77dfca7dddd829Stephan Bosch/* Returns value for IMAP metadata entry. Returns 1 if value was returned,
8ccdf195768afdfbc32088d7be77dfca7dddd829Stephan Bosch 0 if value wasn't found (set to NULL), -1 if error */
8ccdf195768afdfbc32088d7be77dfca7dddd829Stephan Boschint imap_metadata_get(struct imap_metadata_transaction *imtrans,
8ccdf195768afdfbc32088d7be77dfca7dddd829Stephan Bosch const char *entry, struct mail_attribute_value *value_r);
8ccdf195768afdfbc32088d7be77dfca7dddd829Stephan Bosch/* Same as imap_metadata_get(), but the returned value may be either an
8ccdf195768afdfbc32088d7be77dfca7dddd829Stephan Bosch input stream or a string. */
8ccdf195768afdfbc32088d7be77dfca7dddd829Stephan Boschint imap_metadata_get_stream(struct imap_metadata_transaction *imtrans,
8ccdf195768afdfbc32088d7be77dfca7dddd829Stephan Bosch const char *entry, struct mail_attribute_value *value_r);
8ccdf195768afdfbc32088d7be77dfca7dddd829Stephan Bosch/* Iterate through IMAP metadata entries names under the specified entry. */
8ccdf195768afdfbc32088d7be77dfca7dddd829Stephan Boschimap_metadata_iter_init(struct imap_metadata_transaction *imtrans,
8ccdf195768afdfbc32088d7be77dfca7dddd829Stephan Bosch const char *entry);
8ccdf195768afdfbc32088d7be77dfca7dddd829Stephan Bosch/* Returns the next IMAP metadata entry name or NULL if there are no more
8ccdf195768afdfbc32088d7be77dfca7dddd829Stephan Boschconst char *imap_metadata_iter_next(struct imap_metadata_iter *iter);
8ccdf195768afdfbc32088d7be77dfca7dddd829Stephan Boschint imap_metadata_iter_deinit(struct imap_metadata_iter **_iter);
8ccdf195768afdfbc32088d7be77dfca7dddd829Stephan Boschimap_metadata_transaction_begin(struct mailbox *box);
8ccdf195768afdfbc32088d7be77dfca7dddd829Stephan Boschimap_metadata_transaction_begin_mailbox(struct mail_user *user,
8ccdf195768afdfbc32088d7be77dfca7dddd829Stephan Bosch const char *mailbox);
8ccdf195768afdfbc32088d7be77dfca7dddd829Stephan Boschimap_metadata_transaction_begin_server(struct mail_user *user);
8ccdf195768afdfbc32088d7be77dfca7dddd829Stephan Bosch enum mail_error *error_code_r, const char **error_r);