1

Topic: Trouble changing passwords in database

==== Required information ====
- iRedMail version (check /etc/iredmail-release): 0.9.2
- Linux/BSD distribution name and version: ubuntu 14.04 LTS
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro?: Yes
- Related log if you're reporting an issue:
====

I am adding a domain with 12 users. I created the users with iRedAdmin-Pro, and gave them all the same temporary password. The company then provided me with a current list of passwords that they wanted to use. Some of them do not meed the guidelines/restrictions, so I was going to change them manually.

As an example, say the first user is bob@bigmail.com and has a password of '543210'

I run the command: python generate_password_hash.py 'SSHA512' '543210'

which outputs: {SSHA512}Nza4+WKB9qVAyL/fd0Tm6Xy+LHJuRDsLRWG26C9NumUslqvpwphpeDeMI4efHhcCBI8tbhiBC5dgWuG5ha5mHLKInRA+0Iin

Lets call this log string above 'MyPassword'.

I then log into MySQL as the root user and enter the following commands:

UPDATE mailbox SET password='MyPassword'  WHERE username='bob@bigmail.com';
exit

If I log into RoundCube, and try the username and password, I get a failed login.

The following is in mail.log
May 23 03:23:10 iredmail roundcube: <ik3h4hdh> IMAP Error: Login failed for bob@bigmail.com from 123.145.167.189. LOGIN: Internal error occurred. Refer to server log for more information. in /opt/www/roundcubemail-1.1.1/program/lib/Roundcube/rcube_imap.php on line 198 (POST /mail/?_task=login?_task=login&_action=login)

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Trouble changing passwords in database

SteveInAkron wrote:

May 23 03:23:10 iredmail roundcube: <ik3h4hdh> IMAP Error: Login failed for bob@bigmail.com from 123.145.167.189. LOGIN: Internal error occurred. Refer to server log for more information. in /opt/www/roundcubemail-1.1.1/program/lib/Roundcube/rcube_imap.php on line 198 (POST /mail/?_task=login?_task=login&_action=login)

Seems Dovecot has some error. Please turn on debug mode in Dovecot, then try login again.
Reference: http://www.iredmail.org/docs/debug.dovecot.html

3 (edited by SteveInAkron 2016-05-23 19:54:53)

Re: Trouble changing passwords in database

2 login attemps:

May 23 07:32:05 auth: Debug: auth client connected (pid=30473)
May 23 07:32:05 auth: Debug: client in: AUTH    1       PLAIN   service=imap    secured session=/l1ByoAzHwB/AAAB        lip=127.0.0.1   rip=127.0.0.1    lport=143       rport=59935     resp=ADMwMHNsQGxlay5uZXQAdzhiZ2U= (previous base64 data may contain sensitive data)
May 23 07:32:05 auth-worker(30309): Debug: sql(bob@bigmail.com,127.0.0.1): query: SELECT password, allow_nets FROM mailbox WHERE username='bob@bigmail.com' AND enableimapsecured=1 AND active=1
May 23 07:32:05 auth: Debug: client passdb out: OK      1       user=bob@bigmail.com
May 23 07:32:05 auth: Debug: master in: REQUEST 1435107329      30473   1       659782a38e911e2572fbf428067ceaea        session_pid=30474request_auth_token
May 23 07:32:05 auth-worker(30309): Debug: sql(bob@bigmail.com,127.0.0.1): SELECT 'bob@bigmail.com' AS master_user, CONCAT(mailbox.storagebasedirectory, '/', mailbox.storagenode, '/', mailbox.maildir) AS home, CONCAT('*:bytes=', mailbox.quota*1048576) AS quota_rule FROM mailbox,domain WHERE mailbox.username='bob@bigmail.com' AND mailbox.domain='bigmail.com' AND mailbox.`enableimapsecured`=1 AND mailbox.domain=domain.domain AND domain.backupmx=0 AND domain.active=1 AND mailbox.active=1
May 23 07:32:05 auth-worker(30309): Info: sql(bob@bigmail.com,127.0.0.1): unknown user
May 23 07:32:05 auth: Error: userdb(bob@bigmail.com,127.0.0.1,</l1ByoAzHwB/AAAB>): user not found from userdb sql
May 23 07:32:05 auth: Debug: master userdb out: NOTFOUND        1435107329
May 23 07:32:05 imap: Error: Authenticated user not found from userdb, auth lookup id=1435107329 (client-pid=30473 client-id=1)
May 23 07:32:05 imap-login: Info: Internal login failure (pid=30473 id=1) (internal failure, 1 successful auths): user=<bob@bigmail.com>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, mpid=30474, secured, session=</l1ByoAzHwB/AAAB>



May 23 07:45:11 auth: Debug: auth client connected (pid=30832)
May 23 07:45:11 auth: Debug: client in: AUTH    1       PLAIN   service=imap    secured session=9u8Q+YAz4gB/AAAB        lip=127.0.0.1   rip=127.0.0.1   lport=143       rport=60130     resp=ADMwMHNsQGxlay5uZXQAdzhiZ2U= (previous base64 data may contain sensitive data)
May 23 07:45:11 auth-worker(30309): Debug: sql(bob@bigmail.com,127.0.0.1): query: SELECT password, allow_nets FROM mailbox WHERE username='bob@bigmail.com' AND enableimapsecured=1 AND active=1
May 23 07:45:11 auth: Debug: client passdb out: OK      1       user=bob@bigmail.com
May 23 07:45:11 auth: Debug: master in: REQUEST 2158231553      30832   1       c492d9e1eb835c2fbb6482ef7dedfadf        session_pid=30833       request_auth_token
May 23 07:45:11 auth-worker(30309): Debug: sql(bob@bigmail.com,127.0.0.1): SELECT 'bob@bigmail.com' AS master_user, CONCAT(mailbox.storagebasedirectory, '/', mailbox.storagenode, '/', mailbox.maildir) AS home, CONCAT('*:bytes=', mailbox.quota*1048576) AS quota_rule FROM mailbox,domain WHERE mailbox.username='bob@bigmail.com' AND mailbox.domain='bigmail.com' AND mailbox.`enableimapsecured`=1 AND mailbox.domain=domain.domain AND domain.backupmx=0 AND domain.active=1 AND mailbox.active=1
May 23 07:45:11 auth-worker(30309): Info: sql(bob@bigmail.com,127.0.0.1): unknown user
May 23 07:45:11 auth: Error: userdb(bob@bigmail.com,127.0.0.1,<9u8Q+YAz4gB/AAAB>): user not found from userdb sql
May 23 07:45:11 auth: Debug: master userdb out: NOTFOUND        2158231553
May 23 07:45:11 imap: Error: Authenticated user not found from userdb, auth lookup id=2158231553 (client-pid=30832 client-id=1)
May 23 07:45:11 imap-login: Info: Internal login failure (pid=30832 id=1) (internal failure, 1 successful auths): user=<bob@bigmail.com>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, mpid=30833, secured, session=<9u8Q+YAz4gB/AAAB>

4

Re: Trouble changing passwords in database

Not sure what the issue was, but I deleted and then recreated the same domain, and it works now. I could not figure out exactly what the error was.

5

Re: Trouble changing passwords in database

SteveInAkron wrote:

SELECT 'bob@bigmail.com' AS master_user, CONCAT(mailbox.storagebasedirectory, '/', mailbox.storagenode, '/', mailbox.maildir) AS home, CONCAT('*:bytes=', mailbox.quota*1048576) AS quota_rule FROM mailbox,domain WHERE mailbox.username='bob@bigmail.com' AND mailbox.domain='bigmail.com' AND mailbox.`enableimapsecured`=1 AND mailbox.domain=domain.domain AND domain.backupmx=0 AND domain.active=1 AND mailbox.active=1
May 23 07:45:11 auth-worker(30309): Info: sql(bob@bigmail.com,127.0.0.1): unknown user

You should compare above SQL command with the real SQL record.

Anyway, glad to hear that it works for you now.