Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have server with postfix installed. It is configured so that when system sends mail to root, it is forwarded to myaddress@gmail.com It is configured in /etc/aliases like this:

postmaster: root
root: myaddress@gmail.com

Now it stopped sending any emails to myaddress@gmail.com because my ISP blocked port 25. How to configure postfix to send this emails to port 587?

My system is ubuntu 9.10, if it matters.


share|improve this question

2 Answers 2

up vote 3 down vote accepted

You need to create an entry in the Postfix transport table - http://www.postfix.org/transport.5.html has full details, and even an example that almost does what you want:

In the case of delivery via SMTP, one  may  specify  host-
       name:service instead of just a host:

            example.com      smtp:bar.example:2025

       This directs mail for user@example.com to host bar.example
       port 2025. Instead of a numerical port a symbolic name may
       be used. Specify [] around the hostname if MX lookups must
       be disabled.

You'll have to configure your main.cf to use the transport map as well - see the DATABASE_README linkd at the bottom of that page for more.

share|improve this answer
Although, as Womble says, a better solution is to get a proper ISP, one that actually provides an Internet service, instead of just something closely resembling internet service. FWIW, marksanborn.net/linux/… has an apparently complete (although I've not tested it) guide to setting up the neccessary authentication. –  James Polley Dec 26 '09 at 22:59

In general, you can forward to a non-standard port on another mail server with a transport map (see transport(5) and the transport_maps option in postconf(5)). However, the submission port (587) isn't designed to be used without authentication, so you'll also want to look at the smtp_sasl_* options in postconf(5). However, that's a lot of hassle to go through when the best answer is to tell your ISP to remove the port 25 block on your connection. If they're too stupid or intransigent to permit that on a per-customer basis, find a new ISP.

share|improve this answer

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.