static int mailbox_commit_sieve(struct mailbox *mailbox)
{
    int r;

    free(mailbox->sievedir);
    mailbox->sievedir = NULL;

    if (mailbox->local_sieve) {
        r = sievedb_commit(mailbox->local_sieve);
        sievedb_close(mailbox->local_sieve);
        mailbox->local_sieve = NULL;
        if (r) return r;
    }

    return 0;
}
static int mailbox_commit_sieve(struct mailbox *mailbox)
{
    int r;

    free(mailbox->sievedir);
    mailbox->sievedir = NULL;

    if (mailbox->local_sieve) {
        r = sievedb_commit(mailbox->local_sieve);
        sievedb_close(mailbox->local_sieve);
        mailbox->local_sieve = NULL;
        if (r) return r;
    }

    return 0;
}