The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

routing outbound smtp through another server

Discussion in 'E-mail Discussions' started by theBassTender, Mar 23, 2009.

  1. theBassTender

    theBassTender Active Member

    Joined:
    Jan 2, 2005
    Messages:
    26
    Likes Received:
    1
    Trophy Points:
    3
    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. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    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
     
  3. theBassTender

    theBassTender Active Member

    Joined:
    Jan 2, 2005
    Messages:
    26
    Likes Received:
    1
    Trophy Points:
    3
    Thanks!

    Thanks - option 3 worked wonders.

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

    jols Well-Known Member

    Joined:
    Mar 13, 2004
    Messages:
    1,111
    Likes Received:
    2
    Trophy Points:
    38
    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?
     
Loading...

Share This Page