Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-19096

SMTP "LOGIN" auth fails after trying "NTLM"

    XMLWordPrintable

Details

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Medium Medium
    • None
    • 4.4.1, 4.5.0, 4.6.0
    • Misc
    • None

    Description

      If you use a Microsoft SMTP server. The server announces GSSAPI, NTLM and LOGIN as supported authentication methods.

      220 smtp.server.local Microsoft ESMTP MAIL Service, Version: 6.0.3790.4675 ready at  Sun, 1 Jan 2012 18:29:54 +0100 
      EHLO lx01
      250-smtp.server.local Hello [x.x.x.x]
      250-TURN
      250-SIZE
      250-ETRN
      250-PIPELINING
      250-DSN
      250-ENHANCEDSTATUSCODES
      250-8bitmime
      250-BINARYMIME
      250-CHUNKING
      250-VRFY
      250-X-EXPS GSSAPI NTLM LOGIN
      250-X-EXPS=LOGIN
      250-AUTH GSSAPI NTLM LOGIN
      250-AUTH=LOGIN
      250-X-LINK2STATE
      250-XEXCH50
      250 OK
      

      The eZSMTPTransport class uses ezcMailSmtpTransport() and doesn't set any preferred AUTH method. So it tries all supported methods from most secure to weakest. In this case, it tries NTLM first, fails, then LOGIN (GSSAPI isn't supported by ezcMailSmtpTransport).

      This seems to confuse the Microsoft SMTP server and it gives a wrong status code, so the ezc-Class throws a "SMTP server does not accept AUTH LOGIN." exception. The mail (in our case the "Reset password" mail) is not sent.

      A temporary solution is to add the line:

      $options->preferredAuthMethod = ezcMailSmtpTransport::AUTH_LOGIN;
      

      after line #87 in lib/ezutils/classes/ezsmtptransport.php . Using this, sending mails works fine.

      A better solution would be to make the preferred auth method configurable in the site.ini MailSettings.

      Or maybe this is even a problem with the ezcMailSmtpTransport class.

      Steps to reproduce

      1. set up eZ with a Microsoft SMTP server, configured to accept NTLM and LOGIN, provide eZ with SMTP credentials that only work with the LOGIN method.
      2. make eZ send a mail
      3. see error.log

      Attachments

        Activity

          People

            unknown unknown
            edf@ez.no edf@ez.no
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: