smtp port forwarding?

Smtp port 25 has blocked by my ISP to prevent spam and they direct people to 587 port. That’s why I can’t send mails right now. I use port 25 for smtp on my mail server and need to forward it to 587 to send mail. I use postfix and webmin but I couldn’t figure forwarding out yet. I read some articles about iptables, tried that but no luck. How should I do this forwarding thing? :\

Won’t work. Your ISP has blocked port 25 outgoing. All the other mail servers in the world are expecting mail from port 25 incoming. So there is no way you can talk to them. Unless the particular mail server(s) you are interested in listen on other ports as well (unusual).

Actually here is the situation:

My mail server is in Germany and smtp port is fine there. For example I can send & receive mails via webmail. But here in my country, ISP is blocking port 25 for some clients. At my work, I use a different ISP and I can send e-mail with using Outlook, Thunderbird etc. But at my house, ISP is telling me that I need to use a different port to send e-mail via mailing softwares. They say that I need to use port 587 to send e-mail. So I need to do use port 587 to reach my server and then the same port 25 can send mails from the server I think. Could I express my situation?

So, what should I do here?

Your situation on the server and at work are not relevant except as instances of situations that allow port 25 outgoing.

While you can use a different source port to send out emails to bypass the block at your ISP’s routers, the problem as I have explained is that your recipients will be listening on port 25. So you will be trying to contact your recipients on port 587 which they are not listening on. Unless it is a specific server that you have control over.

Normally the solution is configure your sender which is either a mail server like postfix or a mail program to use your ISP’s SMTP server as a relay. You may have to make sure that the From address is a legal address, as ISPs also do this check to reduce the chance of relaying spam from virus-infected machines.

Sorry, can’t edit for some reason.

You can configure your Germany server as a relay, but then you have to make sure you are the only one who can use it or you become an open relay for spam. Normally this requires setting SMTP authentication.

Another way is to use VPN to your Germany server.

  • egibjk,

what mail application do you use on your server?


I use postfix on Suse 11.

  • egibjk wrote, On 10/06/2009 04:06 PM:
    > I use postfix on Suse 11.

If I fully understand what your ISP does, it should be possible to use their SMTP server as a relay host on port 587 for outbound mail. I don’t think they block port 25 inbound, right?


that’s right…

  • egibjk wrote, On 10/10/2009 12:56 AM:
    > that’s right…
    So just configure postfix to use their mailserver as a relay host on that port.


After a long research I found that submission port would solve the port problem. And that is right, I activated submission port(587) and I can send e-mails now.

Thanks for your helps.

  • egibjk,

thanks for reporting back, glad you got it solved!


the post a little old
but may be still someone searching for a direct solution

I have the same situation in the Philippines = Amart blocks port 25 nationwide

my own mail server out of country
simple solution on my Linux laptop = port-forwarding

ssh -L 44999:localhost:25

(replace with IP of your mail server)

on local mail client such as evolution
configure as sending server:


to send mail out - first open the port-forwarding ssh tunnel to your server
then just send mail as usual.
works since years - also on my Nokia N900