Postfix as a smart host? Is this possible

We have 3 SMTP servers on 3 separate public static ip's. We have a secondary failover connection on a single static ip. I would like to put all 3 SMTP servers behind the router and off the public ip's, use postfix to accept mail on both main internet connection and failover and then route all email to the now internal SMTP servers . These are 3 different email domains. How do I set up the Postfix cnfg to achieve this? I have googled this and not found a solution that fits. I have an existing Ubuntu 16.04 box currently acting as a SSH gateway and would lkike to utilise this same machine for the smtp-gateway/ smarthost.

0
задан 12 April 2017 в 14:12
1 ответ

Маршрутизация входящей электронной почты через основное и резервное интернет-соединение так же просто, как установка правильных записей приоритета MX в DNS:

example.com.        86400   IN      MX      10 mx1.example.com.
example.com.        86400   IN      MX      20 mx2.example.com.
mx1.example.com.    86400   IN      A       <ip-on-primary-internet-connection>
mx1.example.com.    86400   IN      A       <ip-on-secondary-internet-connection>

И аналогично для других ваших доменов:

example.net.        86400   IN      MX      10 mx1.example.com.
example.net.        86400   IN      MX      20 mx2.example.com.

В Postfix вам нужна конфигурация, которая будет принимать входящую почту для example.com и example.net для ретрансляции, а не для локальной доставки, и которая будет направлять ее на правильный внутренний сервер. Примерно следующее:

добавьте example.com и example.net в параметр relay_domains :

[...]
relay_domains = $mydestination, example.com, example.net
[...]

Настройте транспортную карту, также в /etc/postfix/main.cf :

[...]
transport_maps = hash:/etc/postfix/transport
[...]

И карта / etc / postfix / transport направит почту для каждого домена на определенный SMTP-сервер:

example.com       smtp:[internalhost1.example.com]
example.net       smtp:[internalhost2.example.com]
1
ответ дан 4 December 2019 в 16:17

Теги

Похожие вопросы