Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mail-app vs. dovecot: LOGIN after AUTHENTICATE -> BAD Error in IMAP command LOGIN: Unknown command #10606

Open
FuxPCN opened this issue Jan 26, 2025 · 2 comments

Comments

@FuxPCN
Copy link

FuxPCN commented Jan 26, 2025

Steps to reproduce

  1. Add new mail account (manually)
  2. Enter credentials for dovecot imap-Server (localhost, no ssl/tls)
  3. Click "Connect"

Expected behavior

Successful login.

Actual behavior

Connect fails - tells wrong password.

tshark shows, mail-app is first sending AUTHENTICATE (successful) and afterwards - unnecessary - LOGIN too, which fails with "BAD Error in IMAP command LOGIN: Unknown command".

Mail app version

No response

Nextcloud version

30.0.5

Mailserver or service

dovecot 2.3.21

Operating system

linux devuan stable

PHP engine version

PHP 8.2

Nextcloud memory caching

No response

Web server

Apache (supported)

Database

MariaDB

Additional info

No response

@SebastianKrupinski
Copy link
Contributor

Morning @FuxPCN,

Are you saying that the mail app is double logging in?

Mail app sends credentials -> server
Server sends -> authenticated
Mail app sends credentials again -> server

Can you turn on debugging in the NC configuration, this will cause the IMAP communication to be logged to a file called horde_imap.log, then post the output.

@FuxPCN
Copy link
Author

FuxPCN commented Jan 27, 2025

Hi @SebastianKrupinski ,

after enabling debug log I found the reason:

`>> Connection to: imap://localhost/

Server connection took 0.0002 seconds.
S: * OK [CAPABILITY IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE LITERAL+ STARTTLS AUTH=PLAIN] Dovecot (Debian) ready.
C: 1 AUTHENTICATE PLAIN [INITIAL CLIENT RESPONSE (username: [email protected])]
Slow Command: 5.005 seconds
ERROR: read timeout error.
Slow Command: 5.005 seconds
ERROR: read timeout error.
S: 1 OK [CAPABILITY IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS THREAD=ORDEREDSUBJECT MULTIAPPEND URL-PARTIAL CATENATE UNSELECT CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS BINARY MOVE SNIPPET=FUZZY PREVIEW=FUZZY PREVIEW STATUS=SIZE SAVEDATE LITERAL+ NOTIFY SPECIAL-USE] Logged in
Command 1 took 10.021 seconds.
C: 2 LOGIN [email protected] [PASSWORD]
S: 2 BAD Error in IMAP command LOGIN: Unknown command (0.001 + 0.000 secs).
`
Dovecot auth process was too slow (ldap). And so the client was repeating the login.

I enabled dovecot auth-cache and now it works.

Thanks for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants