Mirror Setup

  1. Home
  2. Knowledge Base
  3. Installation
  4. Mirror Setup
  1. Home
  2. Knowledge Base
  3. Management
  4. Mirror Setup

Mirroring the server – What is mirroring.

The SurgeMail ‘Mirror’ system allows you to link two systems together and read or deliver Email to either system and both systems will continually ‘match’ each other.


  • A live backup of your system ready to use in the case of failure.
  • Geographic backup (the mirror can be in a different location)
  • Also perfect for ‘moving’ the server to another system with zero down time.

Mirroring will work over a LAN or WAN connection and can be encrypted. Unlike using shared NFS drives there is no single point of failure in a SurgeMail Mirrored system so you have genuine fail over capability.

Do not run a load balancer in front of your mirror, it’s better that users actually connect consistently to one system or the other.

How to enable it.

Install surgemail on the mirror system.

Turn on the mirror settings on both servers, set mode to “master” on the master, and ‘slave” on the second system. Make the mirror passwords match, and set each mirror_host to point to the other system.

Issue these commands on the master:

  • tellmail reload
  • tellmail resync_config
  • tellmail resync_nwauth
  • tellmail resync
  • tellmail resync_mkdir
  • tellmail resync_folder train
  • tellmail resync_folder lets
  • tellmail resync_folder dlist

Optional things to sync:

  • tellmail resync_folder (value of g_legal_archive_path)

How to check mirroring is complete

  • tellmail analyze (this works with recent versions only)
  • Alternatively,
    • check user counts match (tellmail find “*”) or search for users in the admin tool
    • check resync status by doing a second tellmail resync and checking it doesn’t resend a huge amount of messages, examine tellmail mirror_status
    • try logging into a couple of test accounts, and compare the number of messages in a mailbox.

Example settings you need to add

Server 1: ip (master)

g_mirror_nossl "TRUE"
g_mirror_mode "master"
g_mirror_host ""
g_mirror_secret "testing"
g_mirror_config "true" 
g_mirror_live "true" 
g_mirror_repair "true" (auto repair once a month)

Server 2: ip (slave)

g_mirror_nossl "TRUE"
g_mirror_mode "slave"
g_mirror_host ""
g_mirror_secret "testing"
g_mirror_config "true"
g_mirror_live "true"

Notes FAQ

  • When moving a server, mirror from the master to the new server, not from the current mirror if possible. If you are going from the current mirror first run the checks on it to be sure it’s complete as above.
  • Mirroring uses port 110 to communicate, make sure that is open in your firewall between master/slave in both directions.

Was this article helpful?

Related Articles