| 411 | } |
| 412 | |
| 413 | func (store *Storage) Lookup(ctx context.Context, key string) (string, bool, error) { |
| 414 | accountName, err := store.authNormalize(ctx, key) |
| 415 | if err != nil { |
| 416 | return "", false, nil |
| 417 | } |
| 418 | |
| 419 | usr, err := store.Back.GetUser(accountName) |
| 420 | if err != nil { |
| 421 | if errors.Is(err, imapsql.ErrUserDoesntExists) { |
| 422 | return "", false, nil |
| 423 | } |
| 424 | return "", false, err |
| 425 | } |
| 426 | if err := usr.Logout(); err != nil { |
| 427 | store.log.Error("logout failed", err, "username", accountName) |
| 428 | } |
| 429 | |
| 430 | return "", true, nil |
| 431 | } |
| 432 | |
| 433 | func (store *Storage) Stop() error { |
| 434 | // Stop backend from generating new updates. |