1

Topic: setup issue with remote database

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

Hi, I'm trying to setup iredmail with a remote mysql/mariadb server using the instruction on
http://www.iredmail.org/docs/install.ir … rver.html, but it seems to ignore
the launch setting and use the defaults instead

I've had a quick look in the forum but can't find anything similar(I could of missed it though)

I'm doing this as a learning experience
any help is appreciated
James

----

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

2

Re: setup issue with remote database

Excuse me, what do you mean "ignore the launch setting"? Any error message?

3

Re: setup issue with remote database

It ignores the address i enter for the sql server, then uses the
Loopback instead

Any help is appreciated
James

4

Re: setup issue with remote database

You use below command to start iRedMail installer, right?

MYSQL_SERVER='192.168.1.100' MYSQL_ROOT_USER='admin_iredmail' MYSQL_GRANT_HOST='192.168.1.200' bash iRedMail.sh

If it doesn't work, i need your help to figure it out. Please follow steps below:

1) Reinstall server OS.
2) Cleanup old databases in remote mysql server by following our tutorial: http://www.iredmail.org/docs/install.ir … erver.html
3) Before you run iRedMail installer, please open file 'conf/global' in iRedMail-0.9.2:

3.1) Find below line:

if [ X"${LOCAL_ADDRESS}" == X'127.0.0.1' ]; then

Add one line above it:

set -x
if [ X"${LOCAL_ADDRESS}" == X'127.0.0.1' ]; then

3.2) Find below line:

export IMAP_SERVER="${LOCAL_ADDRESS}"

Add one line above it:

set +x
export IMAP_SERVER="${LOCAL_ADDRESS}"

4) Now run iRedMail installer (replace the IP address with the real ones):

MYSQL_SERVER='192.168.1.100' MYSQL_ROOT_USER='admin_iredmail' MYSQL_GRANT_HOST='192.168.1.200' bash iRedMail.sh

After you pressed ENTER to start the installer, it will print some debug message on terminal, please press Ctrl+C to interrupt the iRedMail installer, copy the terminal output and paste here. I need this message for troubleshooting.

5

Re: setup issue with remote database

Here is the command I used and it's output

mysql_server='sql.dragon.lan' mysql_root_user='mail_admin' mysql_grant_host='email.dragon.lan' bash iRedMail.sh
++ '[' X127.0.0.1 == X127.0.0.1 ']'
++ export MYSQL_GRANT_HOST=localhost
++ MYSQL_GRANT_HOST=localhost
++ export LDAP_SERVER_HOST=127.0.0.1
++ LDAP_SERVER_HOST=127.0.0.1
++ export LDAP_SERVER_PORT=389
++ LDAP_SERVER_PORT=389
++ export MYSQL_SERVER=127.0.0.1
++ MYSQL_SERVER=127.0.0.1
++ export MYSQL_SERVER_PORT=3306
++ MYSQL_SERVER_PORT=3306
++ export MYSQL_ROOT_USER=root
++ MYSQL_ROOT_USER=root
++ export PGSQL_SERVER=127.0.0.1
++ PGSQL_SERVER=127.0.0.1
++ export PGSQL_SERVER_PORT=5432
++ PGSQL_SERVER_PORT=5432
++ export MYSQL_BACKUP_DATABASES=
++ MYSQL_BACKUP_DATABASES=
++ export PGSQL_BACKUP_DATABASES=
++ PGSQL_BACKUP_DATABASES=
++ export USE_LOCAL_MYSQL_SERVER=YES
++ USE_LOCAL_MYSQL_SERVER=YES
++ '[' X127.0.0.1 '!=' X127.0.0.1 ']'
++ set +x
++ '[' X127.0.0.1 == X127.0.0.1 ']'
++ export MYSQL_GRANT_HOST=localhost
++ MYSQL_GRANT_HOST=localhost
++ export LDAP_SERVER_HOST=127.0.0.1
++ LDAP_SERVER_HOST=127.0.0.1
++ export LDAP_SERVER_PORT=389
++ LDAP_SERVER_PORT=389
++ export MYSQL_SERVER=127.0.0.1
++ MYSQL_SERVER=127.0.0.1
++ export MYSQL_SERVER_PORT=3306
++ MYSQL_SERVER_PORT=3306
++ export MYSQL_ROOT_USER=root
++ MYSQL_ROOT_USER=root
++ export PGSQL_SERVER=127.0.0.1
++ PGSQL_SERVER=127.0.0.1
++ export PGSQL_SERVER_PORT=5432
++ PGSQL_SERVER_PORT=5432
++ export MYSQL_BACKUP_DATABASES=
++ MYSQL_BACKUP_DATABASES=
++ export PGSQL_BACKUP_DATABASES=
++ PGSQL_BACKUP_DATABASES=
++ export USE_LOCAL_MYSQL_SERVER=YES
++ USE_LOCAL_MYSQL_SERVER=YES
++ '[' X127.0.0.1 '!=' X127.0.0.1 ']'
++ set +x

I get the same output if I enter the addresses in their ip form instead

any help is appreciated
James

6

Re: setup issue with remote database

James wrote:

mysql_server='sql.dragon.lan' mysql_root_user='mail_admin' mysql_grant_host='email.dragon.lan' bash iRedMail.sh

You use lower cases? mysql_server, mysql_root_user, mysql_grant_host? WRONG. Please use upper cases, just like the tutorial:

MYSQL_SERVER='192.168.1.100' MYSQL_ROOT_USER='admin_iredmail' MYSQL_GRANT_HOST='192.168.1.200' bash iRedMail.sh

7

Re: setup issue with remote database

Thanks, I didn't release the command was case sensitive.

I can access the roundcube page but it gives a "DATABASE ERROR: CONNECTION FAILED!"
I can log in from to the database server into the database server with the same credentials

the maillog gives the following errors:
email roundcube: <u2mial4b> DB Error: SQLSTATE[28000] [1045] Access denied for user 'roundcube'@'email.dragon.lan' (using password: YES) in /var/www/roundcubemail-1.1.1/program/lib/Roundcube/rcube_db.php on line 177 (GET /mail/)
email roundcube: <u2mial4b> DB Error: SQLSTATE[28000] [1045] Access denied for user 'roundcube'@'email.dragon.lan' (using password: YES) (GET /mail/)

I'm not sure how to deal with this

any help is appreciated
James

8

Re: setup issue with remote database

James wrote:

Thanks, I didn't release the command was case sensitive.

Not your fault, i didn't clearly mention this. Updated the document and fixed it moment ago.

James wrote:

I can access the roundcube page but it gives a "DATABASE ERROR: CONNECTION FAILED!"
I can log in from to the database server into the database server with the same credentials
the maillog gives the following errors:
email roundcube: <u2mial4b> DB Error: SQLSTATE[28000] [1045] Access denied for user 'roundcube'@'email.dragon.lan' (using password: YES) in /var/www/roundcubemail-1.1.1/program/lib/Roundcube/rcube_db.php on line 177 (GET /mail/)

Please check Roundcube config file (/var/www/roundcubemail/config/config.inc.php), make sure it's using correct SQL server address, database name, username and password.

If SQL credential is correct in Roundcube config file, please check the privilege on remote mysql server.

9

Re: setup issue with remote database

roundcubes config only has the following in the database section

// SQL DATABASE
$config['db_dsnw'] = 'mysqli://roundcube:bqqu4YbCzEvfdaWWjAQcbtUnu3DIix@sql.dragon.lan/roundcubemail';

should there be anything else in this section?

any help is appreciated
James

10

Re: setup issue with remote database

Can you connect to remote SQL server with command below?

mysql -h sql.dragon.lan -u roundcube -p

11

Re: setup issue with remote database

Yes, connects no problem and can see the databases

Any help is appreciated
James

12

Re: setup issue with remote database

I have no idea...

Does it work if you replace 'sql.dragon.lan' by its IP address in '$config['db_dsnw'] ='?