How to set a backup relay

Discussion in 'Mail Gateway: Installation and configuration' started by saphirblanc, Jul 4, 2018.

  1. saphirblanc

    saphirblanc New Member

    Joined:
    Jul 4, 2017
    Messages:
    2
    Likes Received:
    0
    Hi,

    I do have 2 nodes (Cluster) of Proxmox Mail Gateway and also two relays after them (mx1 and mx2) where the mails get finally dispatched.

    However, I see I can only set one relay for all mails (currently only mx1). I expected to have the ability to set another one as a backup ?

    Is there a way to do so for all domains (not some) ?

    By the way, thanks for your great software :)

    Yann
     
  2. dietmar

    dietmar Proxmox Staff Member
    Staff Member

    Joined:
    Apr 28, 2005
    Messages:
    16,055
    Likes Received:
    257
    You can define a DNS MX record ...
     
  3. heutger

    heutger Active Member

    Joined:
    Apr 25, 2018
    Messages:
    179
    Likes Received:
    54
    You can only set one relay, but you can use a hostname instead of an IP address. If you set a hostname, this hostname can also have MX records and if it has MX records, all MX records will be taken. If you don't want the MX records been taken, you need to enable Disable MX lookup, the A record is taken, if you don't have MX records or you have an IP address, it's the same, the A record is taken or just the given IP address directly.
     
  4. saphirblanc

    saphirblanc New Member

    Joined:
    Jul 4, 2017
    Messages:
    2
    Likes Received:
    0
    Thank you for your replies. At the end I just created two A records "mx.domain.tld" in the DNS zone with the two different MX IP addresses and therefore I guess it would help in case one of them is having issues.
     
  5. Sommer

    Sommer New Member

    Joined:
    Jun 7, 2018
    Messages:
    26
    Likes Received:
    3
    You can also use smtp_fallback_relay postfix parameter.
    For example, if 1 is down, it will send to 2; 2 down, send to 3.
    Code:
    relay_transport = smtp:[10.10.10.1]:25
    smtp_fallback_relay = [10.10.10.2]:25, [10.10.10.3]:25
     
    DerDanilo and saphirblanc like this.
  6. DerDanilo

    DerDanilo Member

    Joined:
    Jan 21, 2017
    Messages:
    189
    Likes Received:
    11
    Don't do that. This way you have two hosts sharing the same ip address. You will end up on block lists etc. since incoming connections don't connect via the correct hostname (DNS).
    One ip per host with a correct assigned reverse DNS name.

    Just use the relay backup setting from postfix. It works fine, running it like this on thousand off systems.
     
  7. heutger

    heutger Active Member

    Joined:
    Apr 25, 2018
    Messages:
    179
    Likes Received:
    54
    @DerDanilo is right, having two IP addresses for mx.domain.tld could result in having different reverse DNS entries and FCrDNS check (which is somehow the future in pregreet checks, I also disabled in my config, as customers have misconfigured systems and my decision is getting spam over rejecting ham/customers, but it will come on more and more systems like DMARC (SPF+DKIM) as well) and getting blocked. If you want to adjust main.cf.in from pmg/templates it's best to use the fallback setup or use two different MX (MX 10 and MX20) with well configured A and PTR records.
     
    DerDanilo likes this.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice