pantz.org banner
Backup mail server at an ISP that blocks SMTP out
Posted on 06-20-2010 03:52:13 UTC | Updated on 06-20-2010 04:07:38 UTC
Section: /software/postfix/ | Permanent Link

Here's the scenario. You host your primary mail server at an ISP that allows SMTP (port 25) into their network. You host your backup mail server at a different ISP that also allows SMTP into their network, but blocks SMTP from leaving their network (to stop spam zombies). Here's the problem with that. When the backup mail server relay's mail to the primary mail server (who's listening on port 25) it will be blocked.

To fix this we will need a way to get the backup mail server to send it's mail to the primary mail server on a higher unblocked port. This means we have to get the primary mail server to listen on it's regular SMTP port and a new higher port.

This example will use Postfix to do this. This test was done with Postfix version 2.5. I'll assume it will work with higher versions.

We will start with the primary mail server. All we need to do is get it to listen on a second port. To do this put the following line in the /etc/postfix/master.cf file. You can put this line under the line that starts with smtpd if you like. It will make Postfix listen on port 2525. Postfix will still listen on port 25 as usual.

2525 inet n - - - - smtpd

Then restart postfix

postfix restart

Now the primary mail server is listening on port 25 and port 2525. On to the backup mail server.

On the backup mail server edit the /etc/postfix/transport file. Put in the line below. Substitute pantz.org for the name of the domain you want to receive mail on. Change mail.pantz.org to the name of your primary mail server.

pantz.org       smtp:[mail.pantz.org]:2525

Now make the transport db.

postmap /etc/postfix/transport

That's it. No restarting postfix needed. Now when mail is delivered to the backup mail server for the pantz.org domain it will be sent to the primary mail server on port 2525 which the backup servers ISP allows out.

Don't forget to open any new ports on those firewalls since 2525 is an odd port. It's likely to be blocked.

Reddit!

Related stories


RSS Feed RSS feed logo

About


3com

3ware

alsa

alsactl

alsamixer

amd

android

apache

areca

arm

ati

auditd

awk

badblocks

bash

bind

bios

bonnie

cable

carp

cat5

cdrom

cellphone

centos

chart

chrome

chromebook

cifs

cisco

cloudera

comcast

commands

comodo

compiz-fusion

corsair

cpufreq

cpufrequtils

cpuspeed

cron

crontab

crossover

cu

cups

cvs

database

dbus

dd

dd_rescue

ddclient

debian

decimal

dhclient

dhcp

diagnostic

diskexplorer

disks

dkim

dns

dos

dovecot

drac

dsniff

dvdauthor

e-mail

echo

editor

emerald

encryption

ethernet

expect

ext3

ext4

fat32

fedora

fetchmail

fiber

filesystems

firefox

firewall

flac

flexlm

floppy

flowtools

fonts

format

freebsd

ftp

gdm

gmail

gnome

google

gpg

greasemonkey

greylisting

growisofs

grub

hacking

hadoop

harddrive

hba

hex

hfsc

html

html5

http

https

hulu

idl

ie

ilo

intel

ios

iperf

ipmi

iptables

ipv6

irix

javascript

kde

kernel

kickstart

kmail

kprinter

krecord

kubuntu

kvm

lame

ldap

linux

logfile

lp

lpq

lpr

maradns

matlab

memory

mencoder

mhdd

mkinitrd

mkisofs

moinmoin

motherboard

mouse

movemail

mplayer

multitail

mutt

myodbc

mysql

mythtv

nagios

nameserver

netflix

netflow

nginx

nic

ntfs

ntp

nvidia

odbc

openbsd

openntpd

openoffice

openssh

openssl

openvpn

opteron

parted

partimage

patch

perl

pf

pfflowd

pfsync

photorec

php

pop3

pop3s

ports

postfix

power

procmail

proftpd

proxy

pulseaudio

putty

pxe

python

qemu

r-studio

raid

recovery

redhat

router

rpc

rsync

ruby

saltstack

samba

schedule

screen

scsi

seagate

seatools

sed

sendmail

sgi

shell

siw

smtp

snort

solaris

soundcard

sox

spam

spamd

spf

spotify

sql

sqlite

squid

srs

ssh

ssh.com

ssl

su

subnet

subversion

sudo

sun

supermicro

switches

symbols

syslinux

syslog

systemd

systemrescuecd

t1

tcpip

tcpwrappers

telnet

terminal

testdisk

tftp

thttpd

thunderbird

timezone

ting

tls

tools

tr

trac

tuning

tunnel

ubuntu

unbound

vi

vpn

wget

wiki

windows

windowsxp

wireless

wpa_supplicant

x

xauth

xfree86

xfs

xinearama

xmms

youtube

zdump

zeromq

zic

zlib