1 (edited by timmy 2014-01-10 03:21:45)

Topic: backup mx idea using mysql replication

======== Required information ====
- iRedMail version: latest
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): mysql
- Linux/BSD distribution name and version: debian 7
- Related log if you're reporting an issue:
====
Hi all,

I'm planning on setting up a simple automated backup MX server. I dont think its necessary to have the whole iredmail setup on the backup mx (correct me if im wrong), but I do want to automatically sync to the backup mx what domains and email addresses it should accept for delivery..

So, I'm planning on having a basic debian server with MySQL installed and postfix. Ill then replicate my iRedMail MySQL database to the backup mx via mysql replication.

Ill then tell postfix to use get the relay domains and recipients from the replicated database, eg something like:

relay_domains = mysql:/etc/postfix/mysql_relay_domains.cf
relay_recipient_maps = mysql:/etc/postfix/mysql_relay_recipients.cf

where /etc/postfix/mysql_relay_domains.cf :
----------------------------
hosts = 127.0.0.1
dbname = vmail
user = mxreadonly
password = password
query = SELECT domain FROM domain WHERE domain='%s';
----------------------------

and /etc/postfix/mysql_relay_recipients.cf :
----------------------------
hosts = 127.0.0.1
dbname = vmail
user = mxreadonly
password = password
query = SELECT address FROM alias WHERE address = '%s';
----------------------------

Question: Am I right understanding all valid email addresses will be in the alias table?

Question: What about alias domains? would I need something like:


transport_maps = mysql:/etc/postfix/mysql_transport.cf

/etc/postfix/mysql_transport.cf :
----------------------------
hosts = 127.0.0.1
dbname = vmail
user = mxreadonly
password = password
query = SELECT target_domain FROM alias_domain WHERE alias_domain = '%s';
----------------------------

Any comments or suggestions welcome

Thanks

----

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

2

Re: backup mx idea using mysql replication

timmy wrote:

Question: Am I right understanding all valid email addresses will be in the alias table?

Yes.

timmy wrote:

Question: What about alias domains? would I need something like:
transport_maps = mysql:/etc/postfix/mysql_transport.cf

Yes.

3

Re: backup mx idea using mysql replication

timmy wrote:

[..]
Hi all,

I'm planning on setting up a simple automated backup MX server.[..]


Hi timmy,
I am thinking of doing the same thing, could I contact you or do you think it is preferable to continue in the same post?


Many thanks ;-)

Davide
Italy