fix: don't log errors caused by empty SELECT

This commit is contained in:
James Houlahan
2021-01-14 14:00:41 +01:00
parent 014c8af560
commit c677b78f16
2 changed files with 11 additions and 1 deletions

View File

@ -136,7 +136,16 @@ func (iu *imapUser) GetMailbox(name string) (mb goIMAPBackend.Mailbox, err error
storeMailbox, err := iu.storeAddress.GetMailbox(name)
if err != nil {
log.WithField("name", name).WithError(err).Error("Could not get mailbox")
logMsg := log.WithField("name", name).WithError(err)
// GODT-97: some clients perform SELECT "" in order to unselect.
// We don't want to fill the logs with errors in this case.
if name != "" {
logMsg.Error("Could not get mailbox")
} else {
logMsg.Debug("Failed attempt to get mailbox with empty name")
}
return
}