Author Topic: IMAP Authentication failure - hopefully a quick fix!  (Read 10939 times)

Offline GrapeSoda

  • Newbie
  • *
  • Posts: 2
IMAP Authentication failure - hopefully a quick fix!
« on: March 19, 2013, 06:43:46 AM »
I have an OSX Mountain Lion Mailserver with Roundcube installed locally. However I can't seem to authenticate at all.

Here is the CAPABILITY telnet gives me:
Code: [Select]
* OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE START
TLS LOGINDISABLED XAPPLEPUSHSERVICE AUTH=CRAM-MD5 AUTH=DIGEST-MD5 AUTH=GSSAPI] D
ovecot ready.

Here is the relevant part of my config file:
Code: [Select]
$rcmail_config['default_host'] = 'tls://localhost';
$rcmail_config['default_port'] = 143;
$rcmail_config['imap_auth_type'] = DIGEST-MD5;

All other IMAP settings are still as their defaults, however I can provide the full config upon request.

This I have tried: 127.0.0.1, the outside domain, ssl, tls, plain, blank auth type (so it's determined automatically). All seem to work server wise, I get the same authentication failed message rather than a failed to connect message. Logs seem to provide no further information into the matter.

I can confirm SMTP works fine in roundcube, and logging in via Mail.app works fine. I've confirmed I'm using correct credentials in the user@domain.com:password format. I can also confirm it isn't blacklist/IP related - we have tried from multiple locations.

Hopefully I am missing something obvious and it's a simple fix.

Thanks in advance.

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,879
    • SKaero - Custom Roundcube development
Re: IMAP Authentication failure - hopefully a quick fix!
« Reply #1 on: March 19, 2013, 08:28:50 AM »
Is the auth fail happening on the installer?

Offline GrapeSoda

  • Newbie
  • *
  • Posts: 2
Re: IMAP Authentication failure - hopefully a quick fix!
« Reply #2 on: March 19, 2013, 08:31:40 AM »
Yes, in both /?_step=3 and the standard login page I get the same problem.

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,879
    • SKaero - Custom Roundcube development
Re: IMAP Authentication failure - hopefully a quick fix!
« Reply #3 on: March 19, 2013, 08:41:47 AM »
I just noticed DIGEST-MD5 should have quotes around it:
Code: [Select]
$rcmail_config['imap_auth_type'] = 'DIGEST-MD5'
If that doesn't work enable imap_debug and post the log.

Offline benbull

  • Newbie
  • *
  • Posts: 2
Re: IMAP Authentication failure - hopefully a quick fix!
« Reply #4 on: April 09, 2013, 06:32:31 AM »
I'm having exactly the same issues on ML Server 10.8.3

Code: [Select]
[09-Apr-2013 10:10:21 +0100]: [CF6D] S: * OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE XAPPLEPUSHSERVICE AUTH=CRAM-MD5 AUTH=X-PLAIN-SUBMIT AUTH=DIGEST-MD5 AUTH=PLAIN AUTH=LOGIN] Dovecot ready.
[09-Apr-2013 10:10:21 +0100]: [CF6D] C: A0001 ID ("name" "Roundcube Webmail" "version" "0.8.6" "php" "5.3.15" "os" "Darwin" "command" "/")
[09-Apr-2013 10:10:21 +0100]: [CF6D] S: * ID ("name" "Dovecot" "version" "2.0.19apple1")
[09-Apr-2013 10:10:21 +0100]: [CF6D] S: A0001 OK ID completed.
[09-Apr-2013 10:10:21 +0100]: [CF6D] C: A0002 AUTHENTICATE DIGEST-MD5
[09-Apr-2013 10:10:21 +0100]: [CF6D] S: [a hash]
[09-Apr-2013 10:10:21 +0100]: [CF6D] C:[a hash]
[09-Apr-2013 10:10:23 +0100]: [CF6D] S: A0002 NO [AUTHENTICATIONFAILED] Authentication failed.
[09-Apr-2013 10:10:23 +0100]: [CF6D] C: A0003 LOGOUT
[09-Apr-2013 10:10:23 +0100]: [CF6D] S: * BYE Logging out
[09-Apr-2013 10:10:23 +0100]: [CF6D] S: A0003 OK Logout completed.
[09-Apr-2013 11:13:48 +0100]: [C04F] C: A0001 LOGOUT

My IMAP config is as follows;

Code: [Select]
$rcmail_config['default_host'] = 'tls://[my domain name].com';

// TCP port used for IMAP connections
$rcmail_config['default_port'] = 8993;

// IMAP AUTH type (DIGEST-MD5, CRAM-MD5, LOGIN, PLAIN or empty to use
// best server supported one)
$rcmail_config['imap_auth_type'] = '';

On the installer imap test I get this;

Code: [Select]
Connecting to tls://[my domain].com...
IMAP connect:  NOT OK(Login failed for webmaster from 192.168.1.254. Empty startup greeting ([my domain].com:8993))

My domain is fully qualified and I'm naming the server with its external name.  I've tried so many combinations in the config I'm now a bit lost.  Any help would be greatly appreciated.

Offline benbull

  • Newbie
  • *
  • Posts: 2
Re: IMAP Authentication failure - hopefully a quick fix!
« Reply #5 on: April 09, 2013, 06:36:20 AM »
Amazing what a pause and post on a forum can do for the thinking process, I've solved it - turns out I was using the wrong port with TLS, I've now mapped to 143 internally on my firewall and all is well.