Skip to content

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

@abelardoacosta

Description

@abelardoacosta

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions