Do not ignore errors

This commit is contained in:
Michal Horejsek
2020-09-03 14:36:12 +02:00
parent 9218598140
commit bb1d27a5be
9 changed files with 63 additions and 22 deletions

View File

@ -164,7 +164,9 @@ func (ib *imapBackend) Login(_ *imap.ConnInfo, username, password string) (goIMA
if err := imapUser.user.CheckBridgeLogin(password); err != nil {
log.WithError(err).Error("Could not check bridge password")
_ = imapUser.Logout()
if err := imapUser.Logout(); err != nil {
log.WithError(err).Warn("Could not logout user after unsuccessful login check")
}
// Apple Mail sometimes generates a lot of requests very quickly.
// It's therefore good to have a timeout after a bad login so that we can slow
// those requests down a little bit.