/* rollback DB changes if it was an mupdate failure */
if(mupdatecommiterror){
r=0;
/* delete the new entry */
if(!isusermbox)
r=mboxlist_update_entry(newname,NULL,&tid);
/* recreate an old entry */
if(!r)
r=mboxlist_update_entry(oldname,newmbentry,&tid);
/* Commit transaction */
if(!r)
r=cyrusdb_commit(mbdb,tid);
tid=NULL;
if(r){
/* XXX HOWTO repair this mess! */
syslog(LOG_ERR,"DBERROR: failed DB rollback on mailboxrename %s %s: %s",
oldname,newname,cyrusdb_strerror(r));
syslog(LOG_ERR,"DBERROR: mailboxdb on mupdate and backend ARE NOT CONSISTENT");
syslog(LOG_ERR,"DBERROR: mailboxdb on mupdate has entry for %s, mailboxdb on backend has entry for %s and files are on the old position",oldname,newname);