EXPORTED int mailbox_cacherecord(struct mailbox *mailbox, const struct index_record *record)
{
    enum mbcache_rewrite_t rewrite = mailbox_index_islocked(mailbox, 1) ? MBCACHE_REWRITE : MBCACHE_PARSEONLY;
    return mailbox_cacherecord_internal(mailbox, record, rewrite);
}
EXPORTED int mailbox_cacherecord(struct mailbox *mailbox, const struct index_record *record)
{
    enum mbcache_rewrite_t rewrite = mailbox_index_islocked(mailbox, 1) ? MBCACHE_REWRITE : MBCACHE_PARSEONLY;
    return mailbox_cacherecord_internal(mailbox, record, rewrite);
}