WebHostGear.com - the hosting resource for professionalshosting tutorials 
hosting howto webhost guide server managementJuly 04, 2009
server management, apache tutorials, hosting tutorials, cpanel, server security
Home / Hosting Tutorials / HOW TO: Allow SMTP through port 26

HOW TO: Allow SMTP through port 26



Printer Friendly Printer Friendly Send to a friend Send to a friend
By : ramprage Rating : Average Rating : 7.45 From 22 Voter(s)

With the ever growing popularity for Broad Band providers these days blocking SMTP connections on port 25 I have a quick and dirty way to allow your clients to still use your SMTP servers to send their mail without having to resort to using their broad band providers SMPT servers.

I know recently I have had many support calls and emails from clients telling me that they are able to receive mail with no problem but when they try to send mail their connection times out and they are left with an error message to the effect of "Connection can not be established with SMPT server".

This method of getting around this is not a end all to be all either. You will still have to tell your clients to connect to port 26 and not the default SMTP port which is 25.

I have tested this on RH Linux. You will need to be running some sort of firewall so you can do some port managing.

This is an IP Tables work-around for your mail server that opens up port 26 and routes all mail to port 25 so that users could set their mail client to port 26 and still use your servers. This allows the clients that don't want to use their ISP mail settings to still connect.

$IPTABLES -t nat -A PREROUTING -t nat -p tcp -d SERVER_IP_HERE --dport 26 -j DNAT --to SERVER_IP_HERE:25



Article provided by WebHostGear.com

Just copy the above text, paste it onto the command line, replace the two SERVER_IP_HERE's with the IP address of the mail server and press enter. Then enter "service iptables restart" into the command line and press enter and then after its done rebooting port 26 will be open and will route all connections to port 25 and the server will treat them as if the connection was to port 25.

I hope this helps some of you. I hate how the board band companies are blocking port 25 now. It is making things hard for us hosts.

Anyway... Enjoy!

Clint Jendyk
Mega Hosters Inc.
http://www.megahosters.com

New! - Need server help? Hire an Expert

Get professional help with your configuration, script installation or server issue.
Learn how we can help you with any server problem and make your server run like new. Professional staff will contact you, after submitting a quote request, by phone or email.

Rate this Article :

1

2

3

4

5

6

7

8

9

10
Poor Excellent

Related Articles


» Properly Reject Invalid Email
» Exim Extended Logging
» Use Exiscan to Scan For Viruses
» Customizing PHP Safe Mode
» Stop Spam At The Server with Exim RBL
» WebHostGear.com Reviewed in Ping Zine Magazine


Discuss this article with others in our new hosting forums

Comments / Feedback

Jack Noton
Great tip! Thank you very much!
Naji
does it applicable with (vbulletin 3 email system) Recieving email but not sending outgoing emails.

I have noticed some problem on email system at our server.

plz advice

Regards
Ken
I have entered the command and it says
bash: -t: command not found

what does it mean???
Tyler
You want to replace $IPTABLES with the path or command for the iptables program. In short, replace '$IPTABLES' with 'iptables' or 'sudo /whole/path/to/iptables', if you aren't root, replacing the obvious.
Joschi
not everyone uses iptables...

For Debian users (with qmail+vpopmail -> Tutorial http://www.shupp.org/toaster/)

it's also possible to create a new internet service which listens on the port 26.
simply add the following line to /etc/services
"smtp2 26/tcp mail"

after that add the following line to /etc/inetd.conf
"smtp2 stream tcp nowait root /var/qmail/bin/qmail-smtpd /home/vpopmail/bin/vchkpw /bin/true"

Afterwards you need to restart the inetd service with "killall -HUP inetd"

Then you can send emails via Port 26!
American
Somehow, both 25 & 26 are working as SMTP ports on one of my servers... Any idea why? I'd like for it to be the same on all of my servers...
guma
have being trying to send email through freenet.de sapo.pt using port25 please i need assistance on how i can send email though smtp without giving wrong reply
Max
Hello, I have tried this command and received this

iptables v1.3.5: can't initialize iptables table `nat': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.

What this means ?
Ashwar
After Typinmg the above sentence I got Error : - "$IPTABLES -t nat -A PREROUTING -t nat -p tcp -d SERVER_IP_HERE --dport 26 -j DNAT --to SERVER_IP_HERE:25"

How to make this Work On Windows
PM
This worked on centos. Just had to replace $IPTABLES by /sbin/iptables. Thanks!

 Add Comment
Name
Email
Image Code
Refresh Image

Comments / Feedback



Our site offers free hosting tutorials, cpanel tutorial, web hosting news, shell commands, running a web hosting business, dedicated guides, linux tutorial, apache install, home web server, web server guide, ssh commands, dedicated servers, DNS nameservers, chkrootkit, apf firewall, exim configuration, server compromised, cron backup solution, ftp backup script

Server Tutorials


WebHostGear Reviewed by Ping Zine - Click here

Links:
Lunarpages Coupon