Configuring the SMTP port in Linux

Linux® does not allow root users to bind port traffic to ports 1024 and below. However, the simple mail transfer protocol (SMTP) port property of the TRIRIGAWEB.properties file has a default value of port 25. If you are running Linux, you must configure the reserve SMTP agent to listen to a custom port instead of the default port 25.

Before you begin

You must be an IBM® TRIRIGA® administrator. Run the commands in the following procedure as a root user.

Procedure

  1. Update your firewall to open the port above port 1024 by adding the following lines to your /.../sysconfig/iptables file:
    -A OUTPUT -p tcp -s serverIP -d 0/0 --dport Port_Above_1024 
       -m state --state ESTABLISHED -j ACCEPT
    -A INPUT -s 0/0 -d serverIP -m state --state NEW,ESTABLISHED 
       -p tcp --dport Port_Above_1024 -i eth0 -j ACCEPT
  2. Restart your firewall:
    /.../init.d/iptables restart
  3. Open port 25 for forwarding:
    /sbin/iptables -A FORWARD -p tcp --destination-port 25 -j ACCEPT;
  4. Forward port 25 to your custom port above 1024:
    /sbin/iptables -t nat -A PREROUTING -j REDIRECT 
       -p tcp --destination-port 25 --to-port Port_Above_1024
  5. To verify that port 25 is forwarding, start the IBM TRIRIGA application server so that it binds to your custom port, and run a telnet command:
    telnet yourServer 25
  6. If you do not receive a successful response, forward port 25 to a different custom port (step 4).

What to do next

This task does not permanently configure the port. If the Linux server is restarted or the IP tables service is reset from a firewall modification, then the configuration is dropped. To reconfigure the port, you must forward port 25 to your custom port (step 4) again.