Dovecot authentication with existing MD5 hash fails.

  • It seems that existing mailbox MD5 ends up nicely in /etc/dovecot/passwd. Problem is that authentication fails. It just seems that dovecot refuses to authenticate with that scheme, so I tried to add plain-md5 to the configuration, but it does not recognise it either:


    dovecot: auth: Fatal: Unknown authentication mechanism 'plain-md5'


    Could this be a distribution issue? May be the Ubuntu version does not support it any more?

  • I found the solution. With pre-existing $1$ type of hashes, the presently used label {MD5-CRYPT}, that is put there by LC's SOAP API, is not correct. The right label to use here is {CRYPT}. I just tried changing the MD5-CRYPT to CRYPT and then it would authenticate correctly. Please correct this bug!

  • An update. All good for the Dovecot (pop3) side of things. Now the Postfix side. There it still fails and the log tells me:



    Code
    postfix/smtpd[12000]: warning: server[ip]: SASL CRAM-MD5 authentication failed:


    Apparently it still is considering it a CRAM-MD5 hash. How do you make Postfix respect the same {CRYPT} label?

  • I felt now free to change this in /usr/lib/liveconfig/lua/dovecot.lua:

  • I noticed another error. Sometimes the CRYPT hash is not recognised as such and there must be something wrong in string.match pattern. For now I changed it to:


    Zitat

    string.match(data.password, "^$1$[%w./]+$[%w./]+$")


    .. which seems be a better match for the hashes I've seen.

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!