EXPORTED void mailbox_cleanup_uid(struct mailbox *mailbox, uint32_t uid, const char *flagstr)
{
    const char *spoolfname = mailbox_spool_fname(mailbox, uid);
    const char *archivefname = mailbox_archive_fname(mailbox, uid);

    if (unlink(spoolfname) == 0) {
        if (config_auditlog) {
            syslog(LOG_NOTICE, "auditlog: unlink sessionid=<%s> "
                   "mailbox=<%s> uniqueid=<%s> uid=<%u> sysflags=<%s>",
                   session_id(), mailbox_name(mailbox), mailbox_uniqueid(mailbox),
                   uid, flagstr);
        }
    }

    if (strcmp(spoolfname, archivefname)) {
        if (unlink(archivefname) == 0) {
            if (config_auditlog) {
                syslog(LOG_NOTICE, "auditlog: unlinkarchive sessionid=<%s> "
                       "mailbox=<%s> uniqueid=<%s> uid=<%u> sysflags=<%s>",
                       session_id(), mailbox_name(mailbox), mailbox_uniqueid(mailbox),
                       uid, flagstr);
            }
        }
    }
}
EXPORTED void mailbox_cleanup_uid(struct mailbox *mailbox, uint32_t uid, const char *flagstr)
{
    const char *spoolfname = mailbox_spool_fname(mailbox, uid);
    const char *archivefname = mailbox_archive_fname(mailbox, uid);

    if (unlink(spoolfname) == 0) {
        if (config_auditlog) {
            syslog(LOG_NOTICE, "auditlog: unlink sessionid=<%s> "
                   "mailbox=<%s> uniqueid=<%s> uid=<%u> sysflags=<%s>",
                   session_id(), mailbox_name(mailbox), mailbox_uniqueid(mailbox),
                   uid, flagstr);
        }
    }

    if (strcmp(spoolfname, archivefname)) {
        if (unlink(archivefname) == 0) {
            if (config_auditlog) {
                syslog(LOG_NOTICE, "auditlog: unlinkarchive sessionid=<%s> "
                       "mailbox=<%s> uniqueid=<%s> uid=<%u> sysflags=<%s>",
                       session_id(), mailbox_name(mailbox), mailbox_uniqueid(mailbox),
                       uid, flagstr);
            }
        }
    }
}