static int _parse_header_data(struct mailbox *mailbox,
                              const char *data, size_t datalen)
{
    if (!datalen) return IMAP_MAILBOX_BADFORMAT;

    struct parseentry_rock rock = { &mailbox->h, BUF_INITIALIZER, 0, 0, 0 };
    int r = dlist_parsesax(data, datalen, 0, parseentry_cb, &rock);

    buf_free(&rock.aclbuf); // should be noop, but cleans up after errors

    return r;
}
static int _parse_header_data(struct mailbox *mailbox,
                              const char *data, size_t datalen)
{
    if (!datalen) return IMAP_MAILBOX_BADFORMAT;

    struct parseentry_rock rock = { &mailbox->h, BUF_INITIALIZER, 0, 0, 0 };
    int r = dlist_parsesax(data, datalen, 0, parseentry_cb, &rock);

    buf_free(&rock.aclbuf);  

    return r;
}