Community Forums
Connect with us on LinkedIn
Community Notice
+ Reply to Thread
Results 1 to 9 of 9
  1. #1
    Member
    Join Date
    Jul 2004
    Posts
    102

    Default Block port 25 outgoing but let Exim still connect ?

    Spammers are using my server's telnet (via hacked PHP scripts) to send spam to remote servers. This way I can not track them down since their emails do not appear in the Exim mainlog and in Apache's logs any PHP script could be it !! What an intelligent way to send spam, isn't it ?

    What I need to do is to block outgoing connections on port 25 but still let Exim use port 25. Is this possible. Block everything except for Exim from setting up outgoing connections on port 25 ? How would I do that ?

  2. #2
    Technical Product Specialist cPanelDavidG's Avatar
    Join Date
    Nov 2006
    Location
    Houston, TX
    Posts
    10,723
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by driverC View Post
    Spammers are using my server's telnet (via hacked PHP scripts) to send spam to remote servers. This way I can not track them down since their emails do not appear in the Exim mainlog and in Apache's logs any PHP script could be it !! What an intelligent way to send spam, isn't it ?

    What I need to do is to block outgoing connections on port 25 but still let Exim use port 25. Is this possible. Block everything except for Exim from setting up outgoing connections on port 25 ? How would I do that ?
    Try enabling the SMTP Tweak in WHM -> Security -> Security Center, it is designed for this type of situation.

  3. #3
    Member
    Join Date
    Jul 2004
    Posts
    102

    Default

    Ok I just found out something very interesting. The SMTP tweak thing works but I have APF installed and as soon as I restart APF the SMTP tweak no longer blocks connections ! What can I do to ensure that APF will not kill the SMTP tweak off ?
    Last edited by driverC; 02-20-2008 at 03:41 PM.

  4. #4
    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

    You'd have to write custom iptables rules for APF that does the same thing as the smtptweak since APF purges the existing rules when you start it. Or, you could try csf which has the same functionality as the smtptweak inbuilt.
    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

  5. #5
    Member
    Join Date
    Jul 2004
    Posts
    102

    Default

    I found there is a script in the /scripts directory that enables the smtp tweak so I just run this every minute using a cron job. The complaints have ceased.

  6. #6
    Member
    Join Date
    Dec 2004
    Posts
    69

    Default

    What's the script?

  7. #7
    Member
    Join Date
    May 2008
    Posts
    83

    Default

    I enable " SMTP Tweak" but exim can't send mail out too. beaware/


    This SMTP tweak will prevent users from bypassing the mail server to send mail (This is a common practice used by spammers). It will only allow the MTA (mail transport agent), mailman, and root to connect to remote SMTP servers.

  8. #8
    Technical Product Specialist cPanelDavidG's Avatar
    Join Date
    Nov 2006
    Location
    Houston, TX
    Posts
    10,723
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by natong View Post
    I enable " SMTP Tweak" but exim can't send mail out too. beaware/


    This SMTP tweak will prevent users from bypassing the mail server to send mail (This is a common practice used by spammers). It will only allow the MTA (mail transport agent), mailman, and root to connect to remote SMTP servers.
    Exim is the MTA. If Exim stops functioning completely when you enable SMTP Tweak, something is wrong and perhaps you should have a technical analyst take a look at that: http://tickets.cpanel.net/submit

  9. #9
    Registered User
    Join Date
    Dec 2008
    Posts
    1

    Default

    Quote Originally Posted by driverC View Post
    I found there is a script in the /scripts directory that enables the smtp tweak so I just run this every minute using a cron job. The complaints have ceased.
    You could also modify the apf init script to run the script after starting apf. To do that your start section would have to look like this:
    start)
    echo -n "Starting APF:"
    /usr/local/sbin/apf --start >> /dev/null 2>&1
    /scripts/smtpmailgidonly on
    echo_success
    echo
    ;;

    That way you dont need to wait for the cronjob to run
    Last edited by Michiel Pierik; 07-20-2009 at 06:09 AM.

Similar Threads & Tags
Similar threads

  1. I want to block a certain outgoing
    By bignose in forum E-mail Discussions
    Replies: 2
    Last Post: 09-15-2009, 08:06 AM
  2. Exim: unable to connect to port 25
    By reffone in forum E-mail Discussions
    Replies: 2
    Last Post: 07-20-2007, 10:34 AM
  3. Exim Block IP from connecting to port 25
    By gutizz in forum E-mail Discussions
    Replies: 7
    Last Post: 05-01-2007, 10:03 PM
  4. How do I block port 25 exim?
    By pingo in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 07-31-2003, 06:14 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube