Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My ISP blocks outgoing connections to port 25 (well, with one exception for their SMTP server).

The remote host for one particular email address is also configured to listen on port 26. Is there any way of configuring Postfix to connect to port 26 on the remote host?

share|improve this question
Shame no one ever posted something explaining on how to actually do it. – Bruno Pereira Jan 3 '12 at 14:48
@BrunoPereira: I did. – tumbleweed Jan 6 '12 at 13:11
up vote 8 down vote accepted

You can handle this with a transport map. First tell postfix to use a map, with the following in

transport_maps = hash:/etc/postfix/transport

Then in /etc/postfix/transport add the custom route:

Then build the map database:

sudo postmap /etc/postfix/transport
share|improve this answer

As a temporary measure you can try to redirect all traffic going out of your computer from port 25 to port 26 with iptables just for testing:

sudo iptables -t nat -I OUTPUT --src 0/0 -p tcp --dport 25 -j REDIRECT --to-ports 26
share|improve this answer
Great, I'll try that. – Nathan Osman Nov 26 '11 at 1:51
That worked perfectly! Thanks! – Nathan Osman Nov 26 '11 at 1:52
:D I love it when a plan comes together! – Bruno Pereira Nov 26 '11 at 1:56

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.