1

Topic: Install using Remote Mysql

Hello Dear Friend

is there anyway for install or configuring iRedMail Using Remote Mysql Server ?

i have installed iredmail on my Centos Server but it was using local mysql server , i need to setup that for using remote mysql server ( where is the config file ) ?

2

Re: Install using Remote Mysql

Reference: http://www.iredmail.org/wiki/index.php? … sql.server

3

Re: Install using Remote Mysql

thank you for your answer

i see that but i have installed 2 iredmail in 2 separated server , there is an attached storege ( NAS)
and email directory path is located in that storage and both server can access to it , so i need to make change for using one mysql for both servers


so if i want to use that help so i need to clear all database table , i need to change iredmail config files for connection to that mysql server

4

Re: Install using Remote Mysql

Using one MySQL server for both servers? If the server running MySQL is down, mail service on another server will be down too.

5

Re: Install using Remote Mysql

ZhangHuangbin wrote:

Using one MySQL server for both servers? If the server running MySQL is down, mail service on another server will be down too.

Hello again and thanks for your answer

there is replication on mysql , if any of mysql was down we can use another one

6

Re: Install using Remote Mysql

You can try to install 2 iRedMail servers, let's say server A and B, and run MySQL on server A.

*) Update iptables rules to allow remote MySQL connection through port 3306.
*) Grant privilege for SQL 'vmail' and 'vmailadmin' to allow remote connection from server B.
*) On server B, update Postfix/Dovecot/Roundcube/Policyd (or Cluebringer)/Amavisd config files to query MySQL server on server A instead of localhost (127.0.0.1).

7

Re: Install using Remote Mysql

ZhangHuangbin wrote:

You can try to install 2 iRedMail servers, let's say server A and B, and run MySQL on server A.

*) Update iptables rules to allow remote MySQL connection through port 3306.
*) Grant privilege for SQL 'vmail' and 'vmailadmin' to allow remote connection from server B.
*) On server B, update Postfix/Dovecot/Roundcube/Policyd (or Cluebringer)/Amavisd config files to query MySQL server on server A instead of localhost (127.0.0.1).


thanks for your complete answer

so i need to search about that packages config files

8

Re: Install using Remote Mysql

ermya wrote:

so i need to search about that packages config files

Check file "iRedMail.tips" under iRedMail installation directory will help you a lot.

9

Re: Install using Remote Mysql

Hello Dear Zhang

thank you for your good answer

can you please tell me what is the password encryption stored in database ( vmail-> mailbox->password )

i want to make an php script for make and change password
i read that file " iredutils.py " and i undrestand password makes with md5 encryption by defult  ( mybe my think is wrong )  but i cant make an password with md5 in php similar your password

im confused

10

Re: Install using Remote Mysql

ermya wrote:

can you please tell me what is the password encryption stored in database ( vmail-> mailbox->password )

Salted MD5.

11

Re: Install using Remote Mysql

sure i see that is salted md5 ( with 8 charterer random ) but what is the random char in that string ? for example that is salted md5 = > $1$HV98gvCH$Hr1/Zy5cTDrD0d9MD/TQY. makes from iredadmin
and  that string must be md5 . salted string or salted string . md5 right ?

other ways
how can i change it to plain MD5 ? just from iredadmin setting ? or i need to change something in postfix and dovecot ?

12

Re: Install using Remote Mysql

ermya wrote:

sure i see that is salted md5 ( with 8 charterer random ) but what is the random char in that string ?

You can generate random strings as salt.

ermya wrote:

how can i change it to plain MD5 ? just from iredadmin setting ? or i need to change something in postfix and dovecot ?

Postfix uses Dovecot as SMTP SASL authentication server, so what you need to care about is just Dovecot.
To use other password hashes, check this tutorial:
http://www.iredmail.org/wiki/index.php? … ord.hashes

13

Re: Install using Remote Mysql

hello Dear Zhang

i have resolved that problem , i wrote an php class for making that password

that is not just simple md5 it's unix_md5_crypt
unix_md5_crypt() provides a crypt()-compatible interface to the rather new MD5-based crypt() function found in modern operating systems.
It's based on the implementation found on FreeBSD 2.2.[56]-RELEASE

salt is random 8 character and start after $1$ adn end befor $
 
now there is another problem i have more that 5 days im confused

( i found a bug in iredadmin when you trying to install iredmail with remote mysql with that article http://www.iredmail.org/wiki/index.php? … sql.server
roundcube dose not install correctly and roundcube username password and table dose not makes in remote mysql ) anyway i have resolved that problem


all thing is good i can login with roundcube and send an receive email
i have another email interface like roundcube that script using imap  for send and receive email
when i try to config that script from another server to connect to iredmail server and using imap face me error and a can see that error ,log in dovecot

Mar 09 13:24:48 auth-worker(31424): Info: mysql(192.168.1.10): Connected to database vmail
Mar 09 13:24:50 imap-login: Info: Disconnected (auth failed, 1 attempts in 2 secs): user=<test@mydomain.com>, method=PLAIN, rip=192.168.1.21, lip=192.168.1.11, TLS, session=<z6qPwy/0IwCaL6AL>
Mar 09 13:24:59 imap-login: Info: Disconnected (auth failed, 1 attempts in 6 secs): user=<test@mydomain.com>, method=PLAIN, rip=192.168.1.21, lip=192.168.1.11, TLS, session=<TeHawy/0PACaL6AL>


but roundcube can work correctly ! roundcube installed on that iredmail server but my other script is installed on another server that can access to iredmail server over localnetwork

14

Re: Install using Remote Mysql

i found the problem

that is from my webmail script , i was trying to turn on debug mode on dovecot and found the problem and resolved