Gentoo Archives: gentoo-server

From: James Hiscock <boxroot@×××××.com>
To: gentoo-server@l.g.o
Subject: Re: [gentoo-server] (postfix) backup mx to host:port other then :25
Date: Sat, 16 Oct 2004 16:00:27
Message-Id: 5491fade04101609001e39157a@mail.gmail.com
In Reply to: Re: [gentoo-server] (postfix) backup mx to host:port other then :25 by Christian Parpart
1 > I could maybe achieve this using iptables on backupMX that
2 > detects tcp:backupMX:25 to connect to tcp:mainMX:25 and redirects this traffic
3 > to tcp:mainMX:1234.
4
5 Using IPTables would probably be overkill -- especially since postfix
6 handles this quite nicely. Take at a look at /etc/postfix/transport --
7 it should help (or 'man transport')...
8
9 Basically, what you'd want to do is have an entry in backupMX's
10 /etc/postfix/transport that would say something like:
11
12 * smtp:[mainMX]:1234
13
14 ...which would forward all mail coming into backupMX on port 25 to
15 mainMX on port 1234, using SMTP. The [] around mainMX suppresses MX
16 lookups, so you won't get stuck in a mail loop.
17
18 You'd also need to setup mainMX to listen on port 1234. To do so, edit
19 /etc/postfix/master.cf, and duplicate the "smtp" line, like so:
20
21 ...
22 # ==========================================================================
23 # service type private unpriv chroot wakeup maxproc command + args
24 # (yes) (yes) (yes) (never) (50)
25 # ==========================================================================
26 smtp inet n - n - - smtpd
27 1234 inet n - n - - smtpd
28 ...
29
30
31 Restart postfix on mainMX and backupMX and you should be good to go.

Replies

Subject Author
Re: [gentoo-server] (postfix) backup mx to host:port other then :25 Christian Parpart <trapni@g.o>