Proxying Port 25

WARNING: Following this procedure will turn port 9925 into an open relay for your server and so is NOT recommended

Some ISPs block access to port 25 so that you have to send email using their SMTP server. This can be a real pain, so what do we do? The simple answer is to set up a proxy on your web server so that you access a different port. Your web server will forward the conversation to port 25. All we need is a piece of software to do this relaying. One is available from Gavin Stewart. Here is how to implement it so that you access your SMTP server via port 9925 instead of port 25.

  • Login to site using PuTTY
  • Create a directory to install to. I chose mkdir /var/www/myapps
  • Change to required directory (cd /var/www/myapps)
  • Download Gavin’s code (wget
  • Unzip the contents (gunzip -c ip_relay-0.71.tgz | tar -xv)
  • Edit the start up file (pico /etc/rc.d/inet.d/ip_relay)
  • Add line /usr/bin/perl /var/www/myapps/ip_relay-0.71/ -d 9925:<>:25
  • Exit editor (Control-X)
  • Create symlink (ln -s /etc/rc.d/init.d/ip_relay /etc/rc.d/rc2.d/S90ip_relay)
  • Change access rights for ip_relay (chmod 755 /etc/rc.d/init.d/ip_relay)
  • Restart rc daemon (restart). You should see something like

Killing mysqld with pid nnnnn
Stopping httpd: [ OK ]
Starting httpd: [ OK ]
Resolving address (…..
…. determined as:
Useing command line parameters:
local_port 9925
remote_port 25
bandwidth 0
forwarder 99 set. Version: 0.71
Copyright (C) 1999,2000 Gavin Stewart

ip_relay 0.71 runs as a daemon and therefore allows restarting through the site manager.

All you now need to do is edit your Email client (Outlook, Thunderbird or whatever you use) to use port 9925 instead of 25. This is probably under advanced settings. If you want to check that this is working, just type telnet 9925, in a command window on your pc. If you get connect failed, then you have made a mistake.