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

IMAP supports only LOGIN authentication method. Ignores LOGINDISABLE capability. #258

Open
abelardoacosta opened this issue Jan 31, 2024 · 2 comments
Labels
Bug Something isn't working Enhancement

Comments

@abelardoacosta
Copy link

Bug Report

Q A
Version(s) x.y.z

Unknown version, it is the version used in the latest version of GLPI-Project and according to the LOGIN code it is the same. The module requirement is the following:
"php": "^7.3 || ~8.0.0 || ~8.1.0",
"ext-iconv": "*",
"laminas/laminas-loader": "^2.8",
"laminas/laminas-mime": "^2.9.1",
"laminas/laminas-stdlib": "^3.6",
"laminas/laminas-validator": "^2.15",
"symfony/polyfill-mbstring": "^1.12.0",
"webmozart/assert": "^1.10",
"symfony/polyfill-intl-idn": "^1.24.0"

Summary

We have changed the mail server and receiving mail via IMAP has stopped working. It always gave a username/password failure problem. After investigating and doing some tests, the problem is in the login that sends "LOGIN USERNAME PASSWORD" and it must send:
AUTHENTICATE LOGIN

  • VXNlcm5hbWU6
    BASE64(USERNAME)
  • UGFzc3dvcmQ6
    BASE64(PASSWORD)

The server displays the following header on the connection:

  • OK [CAPABILITY IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE LITERAL+ LOGINDISABLED AUTH=LOGIN] Dovecot (Ubuntu) ready.

I think it is already implemented in the SMTP protocol.

I have temporarily fixed it by modifying the login function in the Protocol\Imap.php file and changing the line:

return $this->requestAndResponse('LOGIN', $this->escapeString($user, $password), true);

by:

return $this->requestAndResponse('AUTHENTICATE LOGIN',["",base64_encode($user)."\r\n".base64_encode($password)], true);

But surely this is not the correct solution since I am not a programmer.

Greetings

@abelardoacosta abelardoacosta added the Bug Something isn't working label Jan 31, 2024
@Xerkus Xerkus changed the title IMAP: Login failed IMAP supports only LOGIN authentication method. Ignores LOGINDISABLE capability. Jan 31, 2024
@Xerkus
Copy link
Member

Xerkus commented Jan 31, 2024

Imap implementation here follows obsoleted RFC2060 which had no LOGINDISABLE capability. Conversely, LOGIN is the only authentication mechanism supported by imap implementation here.

Not a bug strictly speaking. Marking it as feature request.

@abelardoacosta
Copy link
Author

Hi @Xerkus

After speaking with my provider, he tells me that the RFC indicated (RFC2060) is obsolete. The next revision was done (RFC3051) as well. The latest is RFC9051
RFC-2060 Documentation → https://datatracker.ietf.org/doc/html/rfc2060 (December 1996)
RFC-3051 Documentation → https://datatracker.ietf.org/doc/html/rfc3501 (March 2003)
RFC-9051 Documentation → https://datatracker.ietf.org/doc/html/rfc9051 (August 2021)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Enhancement
Projects
None yet
Development

No branches or pull requests

2 participants