NS Mail server replication - How to sync email addreses

I am setting up a second NS mail server as backup of the primary one, to be located
remotely. So I need to do the following

  • Need to sync mailbox, mail users, databases, and a few files
  • Two nodes - Have exact same config except for hostname/IP related files
  • Seems DRDB not applicable since I need to also replicate LDAP
  • One node will be in remote location and I dont want to necessarily use virtual IP

I believe I need to replicate the following

  • Users/Aliases - ?
  • Mailboxes - I can use Dovecot dsync
  • SQL DBs - I can do Master-Master or Master-Slave Replication
  • LDAP - I can do Master-Master or Master-Slave Replication
  • Mailfilter spam whitelists/blacklists - rsync ?

So, I also need to sync email users and my assumption is that they are stored in ldap.
But the Postfix/Dovecot configs indicate that the UserDB is stored in
passwd file, yet they dont appear in /etc/passwd , (but idemail id” displays them) !

So which specific file/s (or db) contains the email accounts that i will need to sync ?



Hi @wclemo

in the past with other distros I have used with success rsync to replicate exactly my servers with configurations, services information, data.

Honestly I don’t know if it is possible to replicate a NethServer in real time but could be also useful with a time offset of, for example, 15 minutes?

In my case a script had to do some additional operations before starting rsync such as stopping services and so on.

What do you think about this method?

Please let me know, it’s a very interesting argument and useful think in real world.

1 Like

Hi Roberto,

To be specific, I used Lsyncd, a very nice light-weight live mirror tool that monitors directory trees for changes, and syncs them in almost realtime (but actually after very few seconds). I used this tool to sync samba shares in postfix/dovecot/mysql & also other data files. There is even an rpm for it in Centos repos.

Unison is another excellent tool that I have used to replicate/sync and does so in realtime. I even used it to replicate dovecot maildirs with so much success, and I even wonder whether its better than dovecot’s own dsync ! Its also resilient and very lightweight.

With both of these tools I have never found it necessary to stop the services. Lsyncd can even sync to multiple servers.

So I believe we have tools out there which can be used in real world.


I think you should find the list of files to synch inside the backup configuration: /etc/backup-data.d and /etc/backup-config.d

1 Like

Is it possible to restore config files selectively ? My proposed secondary “backup” server would have a different hostname and IP, and I wouldn’t want to overwrite this.

Am seeing like I would have to do a script with a cron job to restore some configs, e.g nethserver-directory.include (I believe it contains user accounts) at regular intervals.

The command restore-config would apparently restore the whole NS config, which is not what I want.