1

Topic: High Availability with Percona

==== Required information ====
- iRedMail version: 0.8.5
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Linux/BSD distribution name and version: Ubuntu 12.04.2 LTS
- Related log if you're reporting an issue:
====

Hi, I'm trying to configure a high-availability mail server using GlusterFS and Percona XTra DB Cluster on a EC2 environment. I want to deploy 2 nodes. I need to be able to use my percona cluster as the mysql backend. I followed this guide: https://code.google.com/p/iredmail/wiki … ation_Tips to use an existing mysql server but when iRedmail is being installed, it cannot connect to the mysql server.

I was able to configure GlusterFS to be used as the MailDir, but I cannot use an existing mysql as database. I also need 2 other things:

1. Remove the timestamp from the mailbox dir. I saw a guide that configures the iRedmail Admin python file to configure the maildir format but this is no good for me because I will be creating mailboxes directly in the database. How can I do that?

2. I need to completely disable virus and scan check for ALL mailboxes on specific SUBDOMAINS. Possible?

Thank you very much!

----

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

2

Re: High Availability with Percona

Could you please show us what files in iRedMail script you modified to use existing MySQL server?

DanielJorge wrote:

1. Remove the timestamp from the mailbox dir. I saw a guide that configures the iRedmail Admin python file to configure the maildir format but this is no good for me because I will be creating mailboxes directly in the database. How can I do that?

Just don't prepend a timestamp when you create mailbox.

DanielJorge wrote:

2. I need to completely disable virus and scan check for ALL mailboxes on specific SUBDOMAINS. Possible?

Yes, but you have to modify Amavisd config file yourself. You can find samples here:
http://www200.pair.com/mecham/spam/bypassing.html

3

Re: High Availability with Percona

ZhangHuangbin wrote:

Could you please show us what files in iRedMail script you modified to use existing MySQL server?

Thank you very much for the reply!

I'm modifying the conf/global

export MYSQL_SERVER="${LOCAL_ADDRESS}" <---- I'm changing this to my DB endpoint
export MYSQL_SERVER_PORT='3306'
export MYSQL_ROOT_USER='root' <--- I'm changing this to 'admin' (which has ALL root privileges)

This "kinda" works: It creates the databases, aditional users and everything. It installs the iRedMail.  BUT:

1. When I try to access roundcube it says that the database cannot be accessed.

2. the test message at the end of the installation IS NOT delivered and there is no directories at all under vmail1. (the postmaster mailbox is not there)

3. I cannot configure thunderbird for the postmaster account... It keeps "Checking password" (probably because the iRedMail system cannot access the database at all, right?)

4. Basically, nothing works.

I did a test and installed iRedMail using the traditional instalation with a local mysql database and it worked. The server is correct, DNS is correct, etc... But I REALLY need to store everything in my percona cluster! (the cluster is a production cluster and IT IS working for all other applications I have on it)

Thank you very much for the help

4

Re: High Availability with Percona

DanielJorge wrote:

1. When I try to access roundcube it says that the database cannot be accessed.

Did you check SQL username/password set in Roundcube config file (config/db.inc.php under roundcube directory)? Is it correct?

DanielJorge wrote:

2. the test message at the end of the installation IS NOT delivered and there is no directories at all under vmail1. (the postmaster mailbox is not there)

Any related log in Postfix/Dovecot log files? Maildir will be created automatically when delivering mail.

DanielJorge wrote:

3. I cannot configure thunderbird for the postmaster account... It keeps "Checking password" (probably because the iRedMail system cannot access the database at all, right?)

Then i guess its password is wrong during iRedMail installation. Does reset a password work for you?

DanielJorge wrote:

4. Basically, nothing works.
I did a test and installed iRedMail using the traditional instalation with a local mysql database and it worked. The server is correct, DNS is correct, etc... But I REALLY need to store everything in my percona cluster! (the cluster is a production cluster and IT IS working for all other applications I have on it)

Please check related log files to see why everything is not working as expected.

5

Re: High Availability with Percona

Thank you again for your reply!

I made it work by changing the SQL_HOSTNAME variable to '%' and I'm able to install the first mail node. The problem is that I want to have 2 identical mail servers (that is why I'm using percona and gluster). Everything works, my first server sends and receives email. The problem is that when I install iRedMail in my second node, it will override all users passwords in my percona db because I'm installing using the same database server. Then, the first node stops working because the passwords won't work anymore. This happens because iRedMail generate random strings as passwords for all the users (vmail, vmailadmin, roundcube, etc...).

Is there a way to define all the users passwords at installation time, without using a random string?

Thanks!

6

Re: High Availability with Percona

DanielJorge wrote:

Is there a way to define all the users passwords at installation time, without using a random string?

Sure, when you finished configuration wizard, iRedMail will ask you to continue or not, you should press Ctrl+C to abort installation process and update a hidden file '.config' with new passwords, then re-execute "bash iRedMail.sh", it will find existing config file and ask you to use it or not, just choose 'y' to use it.

Another simple way is, copy '.config' from your first server. then you got all passwords same as first server.