Easy way for create backup MX

Discussion in 'Installation/Configuration' started by martinhe, Oct 11, 2021.

  1. martinhe

    martinhe Member

    Hi to all,

    What I have:

    I use the ISPConfig administration panel for the server on which we have mail.

    Problem solved:

    Now I'm working on how to create a backup MX server, which I would put in the DNS command of the main MX server, just with a different priority. As a result, if the primary MX server fails, mail should be routed to the backup MX, where the messages would be stored and waited until the primary MX server responded again.

    An idea of how this should be handled:

    Ideally, I would handle this without replicating a MySQL database with data on user mailboxes. Apparently this is done only so that the backup server immediately discards mail destined for a mailbox that does not exist on the primary MX server. I don't think it's necessary.

    I would most like to solve this by deploying a container with some SW that is used for that. That the container / other VPS would serve as an MX backup.

    Thank you so much for the tips and advice.
  2. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    something like this: How to Set up a Backup Email Server with Postfix on Ubuntu (Complete Guide) (linuxbabe.com) is probably the easiest way. completely avoids another ispconfig instance / mirroring.

    you'll either need to manually keep relay_domains in /etc/postfix/main.cf up-to-date, or create a login to the master or mailservers dbispconfig database from the backup mx server, and create a mysql-virtual_relaydomains.cf, editing the code to query for your current mail domains in the database, and set relay_domains in /etc/postfix/main.cf to proxy:mysql:/etc/postfix/mysql-virtual_relaydomains.cf
    you can copy the mysql-virtual_relaydomains.cf file for your backup mx server from the primary ispconfig mailserver and edit it.
  3. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    There's rarely a use case where a backup server makes sense to me; if you really wanted to create a backup MX server, you would duplicate not only the userbase, but also their spam scanning settings and implement scanning on the backup MX as well. It is much easier to just do nothing, and you end up with mail queued at the sending side, and you have better spam scanning results.

    What does have a place is a redundant mail server, where all services are available. Ie. mail can be delivered to either server, and users can access their mail from either server.
  4. atle

    atle Member HowtoForge Supporter

    pmg, proxmox mail gateway, is easy to setup as cluster and connect to your ispconfig mailserver. The spam management (SA) is replicated to all servers in the cluster. pmg will queue the messages that arrives if your ispconfig Mailserver goes down. pmg is free.
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    You can set up a mail cluster with ISPConfig as well, see mirror setup guides which describe such a setup, no need for proxmox mail gateway here, and mail filtering and spam scanning will not work well anymore if you would put pmg in front of an ISPConfig system. Plus ISPConfig clusters re proven to scale very well when your business grows, there are live systems with ten thousands of accounts spread on many mail nodes.
  6. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    Using an external mail filter may have other supporting use cases, but simply to have multiple MX hosts doesn't make sense (to me, at least). You would them have your mailbox management decoupled from your spam filtering settings, and possibly also duplicating one or both, so it is more complex, plus you have another set of servers (pmg) to maintain, so more costly in time and hardware. In the end, it seems the best you could hope for is that the external filter does a better job of scanning the mail, which is not the problem being addressed. (Though for that matter, I don't know that there even is a problem being addressed - in what way would having a backup MX be substantially better that mail queuing at the sender?)
  7. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    till and Jesse Norell like this.
  8. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    Last edited: Oct 12, 2021
    till and Th0m like this.

Share This Page