Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Member
    Join Date
    Jan 2005
    Posts
    26

    Cool routing outbound smtp through another server

    I recently had a server which was infected with a spambot. The infection was cleaned and the IP was removed from all the RBLs. The problem is we are seeing several receiving servers not updating their RBLs and continuing to block legitimate mail.

    Changing the shared IP address of the server is not a feasible option. Is there a good way to change the IP for the outbound smtp or to route mail through another smtp server until this issue is resolved?

    Any other suggestions?

  2. #2
    Super Moderator This forum account has been confirmed by cPanel staff to represent a vendor. chirpy's Avatar
    Join Date
    Jun 2002
    Location
    Go on, have a guess
    Posts
    13,495

    Default

    SMTP will send out on the servers main IP address by default. You can change that behaviour in exim modifying the interface option. Unfortunately, that needs direct editing of exim.conf which will be overwritten when exim is next updated. You can also achieve the same thing by editing /etc/init.d/exim and setting the command line startup argument. Again this file will be overwritten.

    A third option would be to use iptables to reroute the SMTP request. This is probably simplest:

    iptables -t nat -A POSTROUTING -o eth0 -p tcp -j SNAT --dport 25 --to-source 11.22.33.44

    Where 11.22.33.44 is the IP address you want to send out on. Change eth0 if you need to for your servers configuration.

    If you want to flush the nat table, use:

    iptables -t nat -F
    Jonathan Michaelson

    Need your cPanel servers secured and tuned?
    cPanel Server Configuration, Security, Recovery and Antivirus/AntiSpam Services
    Developers of the most effective (and free) Firewall & Security Solution for cPanel Servers - csf
    http://www.configserver.com

  3. #3
    Member
    Join Date
    Jan 2005
    Posts
    26

    Default Thanks!

    Thanks - option 3 worked wonders.

    Question - this NAT should stay in place until reboot, correct?

  4. #4
    Member
    Join Date
    Mar 2004
    Posts
    859

    Default

    Regarding:

    Change eth0 if you need to for your servers configuration.

    Correct me if I'm wrong, but if you are not changing the main IP address of the server, eth0 should require no change if you are just setting up to re-route SMTP on another IP. True?

    Also, I take it that it would be best to set up an rDNS for the new SMTP IP address. True?

Similar Threads & Tags
Similar threads

  1. customized SMTP routing
    By mrcpu in forum E-mail Discussions
    Replies: 0
    Last Post: 02-22-2010, 07:35 PM
  2. Outbound SMTP on Multiple External IPs
    By u195819 in forum E-mail Discussions
    Replies: 0
    Last Post: 08-15-2009, 05:18 PM
  3. Monitoring Outbound SMTP Traffic Per-User
    By ee99ee in forum cPanel and WHM Discussions
    Replies: 7
    Last Post: 04-25-2006, 09:33 AM
  4. Limit Outbound SMTP to avoid Blacklisting?
    By ccondo in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 06-13-2005, 01:35 PM
  5. smtp routing
    By cyberspirit in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 09-26-2003, 04:52 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube