Author Topic: Can´t login to IMAP server ssl  (Read 9261 times)

Offline juanqui

  • Newbie
  • *
  • Posts: 9
Can´t login to IMAP server ssl
« on: April 18, 2013, 12:13:03 AM »
Hi, I am new to roundcube, i have ubuntu 11.10, postfix and dovecot installed.
Dovecot only accept ssl conections, and imap server is in port 993.

Round cube is in a mysql database.

when i degub the imap, the error log is ...

[18-Apr-2013 00:52:06 -0300]: S: * OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE AUTH=LOGIN AUTH=DIGEST-MD5 AUTH=CRAM-MD5] Dovecot ready.
[18-Apr-2013 00:52:06 -0300]: C: A0001 ID ("name" "Roundcube Webmail" "version" "0.5.3" "php" "5.3.6-13ubuntu3.6" "os" "Linux" "command" "/roundcube/")
[18-Apr-2013 00:52:06 -0300]: S: * ID NIL
[18-Apr-2013 00:52:06 -0300]: S: A0001 OK ID completed.
[18-Apr-2013 00:52:06 -0300]: C: A0002 AUTHENTICATE DIGEST-MD5
[18-Apr-2013 00:52:06 -0300]: S: + cmVhbG09IiIsbm9uY2U9ImhpR0VqQlNB....Wxnb3JpdGhtPSJtZDUtc2VzcyI=
[18-Apr-2013 00:52:06 -0300]: C:...YyNTE1YmI3MTA5NDE0YzE4NTBjMjU5NjdhOGZmNzYsbWF4YnVmPTY1NTM2
[18-Apr-2013 00:52:08 -0300]: S: A0002 NO [AUTHENTICATIONFAILED] Authentication failed.
[18-Apr-2013 00:52:08 -0300]: C: A0003 LOGOUT
[18-Apr-2013 00:52:08 -0300]: S: * BYE Logging out
[18-Apr-2013 00:52:08 -0300]: S: A0003 OK Logout completed.

my config is ...

// ----------------------------------
// LOGGING/DEBUGGING
// ----------------------------------

// system error reporting: 1 = log; 2 = report (not implemented yet), 4 = show, 8 = trace
$rcmail_config['debug_level'] = 1;

// log driver:  'syslog' or 'file'.
$rcmail_config['log_driver'] = 'file';

// date format for log entries
// (read http://php.net/manual/en/function.date.php for all format characters)
$rcmail_config['log_date_format'] = 'd-M-Y H:i:s O';

// Syslog ident string to use, if using the 'syslog' log driver.
$rcmail_config['syslog_id'] = 'roundcube';

// Syslog facility to use, if using the 'syslog' log driver.
// For possible values see installer or http://php.net/manual/en/function.openlog.php
$rcmail_config['syslog_facility'] = LOG_USER;

// Log sent messages to <log_dir>/sendmail or to syslog
$rcmail_config['smtp_log'] = true;

// Log successful logins to <log_dir>/userlogins or to syslog
$rcmail_config['log_logins'] = false;

// Log SQL queries to <log_dir>/sql or to syslog
$rcmail_config['sql_debug'] = true;

// Log IMAP conversation to <log_dir>/imap or to syslog
$rcmail_config['imap_debug'] = true;

// Log LDAP conversation to <log_dir>/ldap or to syslog
$rcmail_config['ldap_debug'] = true;

// Log SMTP conversation to <log_dir>/smtp or to syslog
$rcmail_config['smtp_debug'] = false;

// the default locale setting
$rcmail_config['locale_string'] = 'es';

// ----------------------------------
// IMAP
// ----------------------------------

$rcmail_config['default_host'] = 'ssl://mydomain.com:993';

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

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

// If you know your imap's folder delimiter, you can specify it here.
// Otherwise it will be determined automatically
$rcmail_config['imap_delimiter'] = null;

// If IMAP server doesn't support NAMESPACE extension, but you're
// using shared folders or personal root folder is non-empty, you'll need to
// set these options. All can be strings or arrays of strings.
// Folders need to be ended with directory separator, e.g. "INBOX."
// (special directory "~" is an exception to this rule)
// These can be used also to overwrite server's namespaces
$rcmail_config['imap_ns_personal'] = null;
$rcmail_config['imap_ns_other']    = null;
$rcmail_config['imap_ns_shared']   = null;

// By default IMAP capabilities are readed after connection to IMAP server
// In some cases, e.g. when using IMAP proxy, there's a need to refresh the list
// after login. Set to True if you've got this case.
$rcmail_config['imap_force_caps'] = false;

...

Could you please tell me what can i do, or where to change to get it work ?

Thanks Juan.

Offline alec

  • Hero Member
  • *****
  • Posts: 1,366
Re: Can´t login to IMAP server ssl
« Reply #1 on: April 18, 2013, 01:45:50 AM »
[18-Apr-2013 00:52:06 -0300]: C: A0002 AUTHENTICATE DIGEST-MD5
[18-Apr-2013 00:52:06 -0300]: S: + cmVhbG09IiIsbm9uY2U9ImhpR0VqQlNB....Wxnb3JpdGhtPSJtZDUtc2VzcyI=
[18-Apr-2013 00:52:06 -0300]: C:...YyNTE1YmI3MTA5NDE0YzE4NTBjMjU5NjdhOGZmNzYsbWF4YnVmPTY1NTM2
[18-Apr-2013 00:52:08 -0300]: S: A0002 NO [AUTHENTICATIONFAILED] Authentication failed.

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

Try with imap_auth_type='PLAIN' (or CRAM-MD5).

Offline juanqui

  • Newbie
  • *
  • Posts: 9
Re: Can´t login to IMAP server ssl
« Reply #2 on: April 18, 2013, 08:10:19 AM »
Thanks for response, i tried with CRAM-MD5

[18-Apr-2013 08:49:03 -0300]: C: A0002 AUTHENTICATE CRAM-MD5
[18-Apr-2013 08:49:03 -0300]: S: + PDY4MDQ5NjUwODY0NjUzMDcuMTM2NjI4NTc0M0BkZWx5c29mdD4=
[18-Apr-2013 08:49:03 -0300]: C: YWRtaW5AZGVseXNvZnQuY29tIDQ2NzNiMmZmMmMxMzVmYTgwOGYxODZiN2NiNmE4Y2Fk
[18-Apr-2013 08:49:06 -0300]: S: A0002 NO [AUTHENTICATIONFAILED] Authentication failed.
[18-Apr-2013 08:49:06 -0300]: C: A0003 LOGOUT
[18-Apr-2013 08:49:06 -0300]: S: * BYE Logging out
[18-Apr-2013 08:49:06 -0300]: S: A0003 OK Logout completed.

and with PLAIN correctly says unsupported ...

[18-Apr-2013 09:08:10 -0300]: S: A0001 OK ID completed.
[18-Apr-2013 09:08:10 -0300]: C: A0002 AUTHENTICATE PLAIN YWRtaW5AZGVseXNvZnQuY29tAGFkbWluQGRlbHlzb2Z0LmNvbQBwb3N0Zml4MjEzMw==
[18-Apr-2013 09:08:10 -0300]: S: A0002 NO [ALERT] Unsupported authentication mechanism.
[18-Apr-2013 09:08:10 -0300]: C: A0003 LOGOUT
[18-Apr-2013 09:08:10 -0300]: S: * BYE Logging out
[18-Apr-2013 09:08:10 -0300]: S: A0003 OK Logout completed.


my dovecot config 10-auth.conf is ...
disable_plaintext_auth = yes

and in auth-sql.con.ext

userdb {
    driver = sql
    args = /etc/dovecot/dovecot-mysql.conf
}
passdb {
    driver = sql
    args = /etc/dovecot/dovecot-mysql.conf
}

and in dovecot-mysql.conf

default_pass_scheme = MD5-CRYPT

The corresponding MD5-CRYPT in dovecot for roundcube is CRAM-MD5 or DIGEST-MD5 ?

Thanks, Juan

Offline alec

  • Hero Member
  • *****
  • Posts: 1,366
Re: Can´t login to IMAP server ssl
« Reply #3 on: April 18, 2013, 10:49:46 AM »
and with PLAIN correctly says unsupported ...
My mistake, how about LOGIN?

Offline juanqui

  • Newbie
  • *
  • Posts: 9
Re: Can´t login to IMAP server ssl
« Reply #4 on: April 18, 2013, 11:29:54 AM »
No, LOGIN  is unsupported also, something more to test ?

Thanks, Juan.


Offline juanqui

  • Newbie
  • *
  • Posts: 9
Re: Can´t login to IMAP server ssl
« Reply #5 on: April 26, 2013, 05:06:18 PM »
Thanks, the only thing to make it work was add plain to the auth_mechanisms, and it worked, i also mantained the disable_plaintext_auth = yes and can login through the webmail with ssl.

Thanks, Juan