LinuxBabe Community

Questions about setting up a backup email server

Hello everyone,

Trying to set up a backup email server and am a bit confused…here’s some background:

Setup: SERVER A is a mail server using iredmail and serves 4 domains:

  1. MainDomain.com - main domain for iredmail (not sure what the official name for this account is but it’s the one I used to set up the server initially)
  2. Domain1.com - add-on domain
  3. Domain2.com - add-on domain
  4. Domain3.com - add-on domain

I have another server, SERVER B, that hosts the websites for the domains listed above using CyberPanel.

Here’s my goal: To set up a back-up email server on SERVER B.

I already have Postfix running on SERVER B (I think it was set up when CyberPanel was installed)

I read through the excellent tutorial by Linuxbabe but given that I have multiple domains am confused on how to set up the mx records and edit the main.cf file.

questions:

  1. Do I set all the mx records for each domain to point to mx2.MainDomain.com and then it will deliver to the subdomains? Or… do I set each DNS mx record to go to its respective mx2 domain (ie. mx2.Domain1.com)?
  2. How do I configure the main.cf file for myhostname and mydestination?
  3. I have an entry in the main.cf file for relay host = mail.MainDomain.com:587…do I need to change that?

Thanks for taking the time to read this long-winded email…thanks in advance for your assistance!

-Tommy

  1. both options are fine.
  2. Choose whatever hostname you like, as long as it has A record and the PTR record resolves back to the hostname. You don’t need to edit the mydestination paramter.
  3. That’s why I don’t recommend mixing up different roles on one server. Your server B is configured to relay emails to server A for the websites to send emails. It’s not a good practice to use it as a backup SMTP server. I never do so. It probably can work if you try to figure it out by yourself.