1

Topic: Create backup mail server (Synchronize- one way only)

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

Hi,
I'm trying this and running well, please correct me if i'm wrong and if there is a better way, please ignore this
*using ssh with rsync and without entering root password

base on this :
http://www.iredmail.org/forum/topic4876 … tting.html
http://www.iredmail.org/forum/topic4434 … fails.html


MASTER, ip : 100.100.1.1
Linux/BSD distribution : Ubuntu 12.04 LTS, iRedmail-0.8.6 - LDAP

SLAVE, ip : 100.100.1.2
Linux/BSD distribution : Ubuntu 12.04 LTS, iRedmail-0.8.6 - LDAP

-------------------------------------------Start --------------------------------------------------------------

(MASTER):
sudo nano /etc/ldap/slapd.conf
###append this to bottom of file and change the settings to your own
     moduleload syncprov
     index entryCSN,entryUUID eq
     overlay syncprov
     syncprov-checkpoint 100 10
     syncprov-sessionlog 200


(SLAVE):
sudo nano /etc/ldap/slapd.conf
##append this to bottom of file and change the settings to your own
    syncrepl   rid=001
               provider=ldap://100.100.1.1:389
               searchbase="dc=example,dc=co,dc=id"
               bindmethod=simple
               binddn="cn=Manager,dc=example,dc=co,dc=id"
               credentials=<PASSWORD>
               schemachecking=on
               type=refreshOnly
               retry="60 +"
               scope=sub
               interval=00:00:01:00
               attrs="*,+"


(SLAVE):              
sudo nano /etc/postfix/ldap/relay_domains.cf
##append this to bottom of file and change the settings to your own
    change this :
    query_filter    = (&(objectClass=mailDomain)(|(domainName=%s)(&(enabledService=domainalias)(domainAliasName=%s)))(domainBackupMX=yes)(accountStatus=active)(enabledService=mail)) # this is the old line
   
    In to this :   
    query_filter    = (&(objectClass=mailDomain)(|(domainName=%s)(&(enabledService=domainalias)(domainAliasName=%s)))(accountStatus=active)(enabledService=mail))

   
************ RSYNC using SSH ************

(SLAVE):
## generate id
    sudo -i
    ssh-keygen -t rsa
    ssh-copy-id -i /root/.ssh/id_rsa.pub t10@100.100.1.1

(MASTER) :
    sudo -i
## copying rsa-id or you can use cat and if thereis no ".ssh" folder do this :
    mkdir .ssh
    chmod 700 .ssh

    sudo cp /home/t10/.ssh/authorized_keys .ssh/

(SLAVE):
##testing rsync
    rsync -av -e 'ssh' 100.100.1.1:/var/vmail/vmail1/example.co.id/ /var/vmail/vmail1/example.co.id/

## now, for scheduling
    crontab -e
##append this to bottom of file (3 minutes for sync all) and change the settings to your own
    */3 *   *   *   *   rsync -av -delete -e 'ssh'

-------------------------------------------End --------------------------------------------------------------

hopefully useful, thanks..

t10

----

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

2

Re: Create backup mail server (Synchronize- one way only)

t10 wrote:

(SLAVE):              
sudo nano /etc/postfix/ldap/relay_domains.cf
##append this to bottom of file and change the settings to your own
    change this :
    query_filter    = (&(objectClass=mailDomain)(|(domainName=%s)(&(enabledService=domainalias)(domainAliasName=%s)))(domainBackupMX=yes)(accountStatus=active)(enabledService=mail)) # this is the old line
   
    In to this :   
    query_filter    = (&(objectClass=mailDomain)(|(domainName=%s)(&(enabledService=domainalias)(domainAliasName=%s)))(accountStatus=active)(enabledService=mail))

Why is this (avoid backup mx check) necessary?

3

Re: Create backup mail server (Synchronize- one way only)

ZhangHuangbin wrote:
t10 wrote:

(SLAVE):              
sudo nano /etc/postfix/ldap/relay_domains.cf
##append this to bottom of file and change the settings to your own
    change this :
    query_filter    = (&(objectClass=mailDomain)(|(domainName=%s)(&(enabledService=domainalias)(domainAliasName=%s)))(domainBackupMX=yes)(accountStatus=active)(enabledService=mail)) # this is the old line
   
    In to this :   
    query_filter    = (&(objectClass=mailDomain)(|(domainName=%s)(&(enabledService=domainalias)(domainAliasName=%s)))(accountStatus=active)(enabledService=mail))

Why is this (avoid backup mx check) necessary?

ahhh... ic,, it is really not necessary
just remove this config for relay_domains.cf