# $missing's $mbx2, which is not in the database and
# doesn't exist on $exists
msg($exists, "Rename mailbox $mbx to $mbx2[0]");
- $sth->{rename}->execute($mbx2[0],$idx);
+ $sth->{rename}->execute($mbx2[0],$idx) or
+ msg('database', "WARNING: Can't rename $mbx to $mbx2[0]");
$IMAP->{$exists}->{client}->rename($mbx, $mbx2[0]);
$DBH->commit();
mv_tree($IMAP->{$exists}->{mailboxes}, $mbx, $mbx2[0], %children);
# database as associated with $mbx2, which exists on
# $missing but not on $exists
msg($missing, "Rename mailbox $mbx2 to $mbx");
- $sth->{rename}->execute($mbx,$idx);
+ $sth->{rename}->execute($mbx,$idx) or
+ msg('database', "WARNING: Can't rename $mbx2 to $mbx2");
$IMAP->{$missing}->{client}->rename($mbx2, $mbx);
$DBH->commit();
mv_tree($IMAP->{$missing}->{mailboxes}, $mbx2, $mbx, %children);
# don't store the new UIDNEXTs before to avoid downloading these
# mails again in the event of a crash
- $STH_UPDATE_LOCAL->execute($lIMAP->get_cache( qw/UIDNEXT HIGHESTMODSEQ/), $idx);
- $STH_UPDATE_REMOTE->execute($rIMAP->get_cache(qw/UIDNEXT HIGHESTMODSEQ/), $idx);
+ $STH_UPDATE_LOCAL->execute($lIMAP->get_cache( qw/UIDNEXT HIGHESTMODSEQ/), $idx) or
+ msg('database', "WARNING: Can't update remote UIDNEXT/HIGHESTMODSEQ for $mailbox");
+ $STH_UPDATE_REMOTE->execute($rIMAP->get_cache(qw/UIDNEXT HIGHESTMODSEQ/), $idx) or
+ msg('database', "WARNING: Can't update remote UIDNEXT/HIGHESTMODSEQ for $mailbox");
$DBH->commit();
}
elsif (sync_known_messages($IDX, $MAILBOX)) {
# sync updates to known messages before fetching new messages
# get_cache is safe after pull_update
- $STH_UPDATE_LOCAL_HIGHESTMODSEQ->execute( $lIMAP->get_cache('HIGHESTMODSEQ'), $IDX);
- $STH_UPDATE_REMOTE_HIGHESTMODSEQ->execute($rIMAP->get_cache('HIGHESTMODSEQ'), $IDX);
+ $STH_UPDATE_LOCAL_HIGHESTMODSEQ->execute( $lIMAP->get_cache('HIGHESTMODSEQ'), $IDX) and
+ msg('database', "WARNING: Can't update local HIGHESTMODSEQ for $MAILBOX");
+ $STH_UPDATE_REMOTE_HIGHESTMODSEQ->execute($rIMAP->get_cache('HIGHESTMODSEQ'), $IDX) or
+ msg('database', "WARNING: Can't update remote HIGHESTMODSEQ for $MAILBOX");
$DBH->commit();
}
sync_messages($IDX, $MAILBOX);