1 (edited by ngiamol 2012-10-14 23:41:50)

Topic: Unable to login in roundcube (Solved)

==== Required information ====
- iRedMail version: 0.7.3
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): mysql
- Linux/BSD distribution name and version: centos 5.8
====
Good evening all

Before several months i installed iredmail 0.7.3 for backup mx. the setup and the first tests was fine and machine unpluged.
Today i reconnected the machine to my network but i cannot log in from web. the message i got is login failed.
For several hours trying to find an answer on web but no luck yet.
ill post 2 lines from log.

auth-worker(default): Info: sql(user@website.com,127.0.0.1): query: SELECT password FROM mailbox WHERE username='user@website.com' AND active='1'
Oct 13 15:39:55 auth-worker(default): Info: sql(user@website.com,127.0.0.1): unknown user

Oct 13 14:59:27 mx2 roundcube: IMAP Error: Login failed for user2@website.com from 192.168.0.49. AUTHENTICATE PLAIN: * BYE Internal login failure. Refer to server log for more information. in /var/www/roundcubemail-0.5.4/program/include/rcube_imap.php on line 192 (POST /webmail/?_task=login&_action=login)

when trying to log via telnet i got the following error.
telnet localhost pop3
Connected to localhost.localdomain (127.0.0.1).
+OK Dovecot ready.
user user2
+OK
pass password
-ERR [IN-USE] Internal login failure. Refer to server log for more information

While trying to telnet port 2000, connection refused.
telnet 127.0.0.1 2000
Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection refused


Any ideas?

Thanks in advance

2

Re: Unable to login in roundcube (Solved)

ngiamol wrote:

-ERR [IN-USE] Internal login failure. Refer to server log for more information

Any related log in /var/log/dovecot.log?

Also, does this SQL command return some records?

mysql> USE vmail;
mysql> SELECT password FROM mailbox WHERE username='user@website.com' AND active='1';

3 (edited by ngiamol 2012-10-14 22:23:42)

Re: Unable to login in roundcube (Solved)

ZhangHuangbin wrote:
ngiamol wrote:

-ERR [IN-USE] Internal login failure. Refer to server log for more information

Any related log in /var/log/dovecot.log?

Also, does this SQL command return some records?

mysql> USE vmail;
mysql> SELECT password FROM mailbox WHERE username='user@website.com' AND active='1';

dovecot.log

Oct 14 14:58:28 auth-worker(default): Info: sql(user@domain.gr,127.0.0.1): SELECT CONCAT(mailbox.storagebasedirectory, '/', mailbox.storagenode, '/', mailbox.maildir) AS home, CONCAT('*:bytes=', mailbox.quota*1048576) AS quota_rule FROM mailbox,domain WHERE mailbox.username='user@domain.gr' AND mailbox.domain='domain.gr' AND mailbox.enableimapsecured=1 AND mailbox.domain=domain.domain AND domain.backupmx=0 AND domain.active=1 AND mailbox.active=1
Oct 14 14:58:28 auth-worker(default): Info: sql(user@domain.gr,127.0.0.1): Unknown user
Oct 14 14:58:28 auth(default): Error: userdb(user@domain.gr,127.0.0.1): user not found from userdb sql
Oct 14 14:58:28 auth(default): Info: master out: NOTFOUND    3

the sql command gives

+------------------------------------+
| password                           |
+------------------------------------+
| xxxxxxxxxxxxxxxxxxxxxx. |
+------------------------------------+
1 row in set (0.00 sec)

im not any guru but, the user mailbox is is working because then the setup was done i was able to login (before several months) and it contains 2 mails (test mails).
The "(user@domain.gr,127.0.0.1): Unknown user" tells me that it looks in a wrong place to find the login user, or bad credentials.
If i try to use a wrong passwd it gives me "login failed" but when i use the right one it gives me "connection to imap server failed".

4

Re: Unable to login in roundcube (Solved)

Does this command return some records?

mysql> USE vmail;
mysql> SELECT CONCAT(mailbox.storagebasedirectory, '/', mailbox.storagenode, '/', mailbox.maildir) AS home, CONCAT('*:bytes=', mailbox.quota*1048576) AS quota_rule FROM mailbox,domain WHERE mailbox.username='user@domain.gr' AND mailbox.domain='domain.gr' AND mailbox.enableimapsecured=1 AND mailbox.domain=domain.domain AND domain.backupmx=0 AND domain.active=1 AND mailbox.active=1;

Could you please show me whole file of /etc/dovecot/dovecot-mysql.conf? Remove password before pasting.

5

Re: Unable to login in roundcube (Solved)

ZhangHuangbin wrote:

Does this command return some records?

mysql> USE vmail;
mysql> SELECT CONCAT(mailbox.storagebasedirectory, '/', mailbox.storagenode, '/', mailbox.maildir) AS home, CONCAT('*:bytes=', mailbox.quota*1048576) AS quota_rule FROM mailbox,domain WHERE mailbox.username='user@domain.gr' AND mailbox.domain='domain.gr' AND mailbox.enableimapsecured=1 AND mailbox.domain=domain.domain AND domain.backupmx=0 AND domain.active=1 AND mailbox.active=1;

Could you please show me whole file of /etc/dovecot/dovecot-mysql.conf? Remove password before pasting.

The dovecot-mysql.conf is located in /etc/dovecot-mysql.conf

driver = mysql
default_pass_scheme = CRYPT
connect = host=127.0.0.1 dbname=vmail user=vmail password=xxxxxxxxx
password_query = SELECT password FROM mailbox WHERE username='%u' AND active='1'
user_query = SELECT CONCAT(mailbox.storagebasedirectory, '/', mailbox.storagenode, '/', mailbox.maildir) AS home, CONCAT('*:bytes=', mailbox.quota*1048576) AS quota_rule FROM mailbox,domain WHERE mailbox.username='%u' AND mailbox.domain='%d' AND mailbox.enable%Ls%Lc=1 AND mailbox.domain=domain.domain AND domain.backupmx=0 AND domain.active=1 AND mailbox.active=1

6

Re: Unable to login in roundcube (Solved)

You forgot my another question in previous post:

Does this command return some records?

mysql> USE vmail;
mysql> SELECT CONCAT(mailbox.storagebasedirectory, '/', mailbox.storagenode, '/', mailbox.maildir) AS home, CONCAT('*:bytes=', mailbox.quota*1048576) AS quota_rule FROM mailbox,domain WHERE mailbox.username='user@domain.gr' AND mailbox.domain='domain.gr' AND mailbox.enableimapsecured=1 AND mailbox.domain=domain.domain AND domain.backupmx=0 AND domain.active=1 AND mailbox.active=1;

7 (edited by ngiamol 2012-10-14 22:49:33)

Re: Unable to login in roundcube (Solved)

ZhangHuangbin wrote:

You forgot my another question in previous post:

Does this command return some records?

mysql> USE vmail;
mysql> SELECT CONCAT(mailbox.storagebasedirectory, '/', mailbox.storagenode, '/', mailbox.maildir) AS home, CONCAT('*:bytes=', mailbox.quota*1048576) AS quota_rule FROM mailbox,domain WHERE mailbox.username='user@domain.gr' AND mailbox.domain='domain.gr' AND mailbox.enableimapsecured=1 AND mailbox.domain=domain.domain AND domain.backupmx=0 AND domain.active=1 AND mailbox.active=1;

Ohh sorry,

if i replace the backupmx from 0 to 1 i get this

+----------------------------------------------------------------------+--------------------+
| home                                                                 | quota_rule         |
+----------------------------------------------------------------------+--------------------+
| /var/vmail/vmail1/domain.gr/u/s/e/user-2012.06.13.15.13.29/ | *:bytes=1073741824 |
+----------------------------------------------------------------------+--------------------+
1 row in set (0.00 sec)

This machine planed to be a backup mx

8

Re: Unable to login in roundcube (Solved)

ngiamol wrote:
ZhangHuangbin wrote:

You forgot my another question in previous post:

Does this command return some records?

mysql> USE vmail;
mysql> SELECT CONCAT(mailbox.storagebasedirectory, '/', mailbox.storagenode, '/', mailbox.maildir) AS home, CONCAT('*:bytes=', mailbox.quota*1048576) AS quota_rule FROM mailbox,domain WHERE mailbox.username='user@domain.gr' AND mailbox.domain='domain.gr' AND mailbox.enableimapsecured=1 AND mailbox.domain=domain.domain AND domain.backupmx=0 AND domain.active=1 AND mailbox.active=1;

Ohh sorry,

if i replace the backupmx from 0 to 1 i get this

+----------------------------------------------------------------------+--------------------+
| home                                                                 | quota_rule         |
+----------------------------------------------------------------------+--------------------+
| /var/vmail/vmail1/domain.gr/u/s/e/user-2012.06.13.15.13.29/ | *:bytes=1073741824 |
+----------------------------------------------------------------------+--------------------+
1 row in set (0.00 sec)

This machine planed to be a backup mx

Bleh, broblem solved. It was too simple but it took me almost 2 days tongue

solution.
at dovecot.conf-mysql.conf the "AND domain.backupmx=0" turned to "AND domain.backupmx=1" because planed as backup mx.
restarted dovecot and worked.

Thank you very much for your realy precious help smile