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.

fsock problem

Discussion in 'General Discussion' started by Secret Agent, Mar 17, 2006.

  1. Secret Agent

    Secret Agent Guest

    Warning: fsockopen(): unable to connect to 147.202.69.2:25 in /home/client/public_html/test/socktest.php on line 2
    Connection refused (111)

    This is a very simple script, it just tries to connect to port 25 (SMTP) of the host:
    Code:
    <?php
    $fp = fsockopen("147.202.69.2", 25, $errno, $errstr, 30);
    if (!$fp) {
        echo "$errstr ($errno)<br />\n";
    } else {
        echo "Connected OK";
        fclose($fp);
    }
    ?>
    What could cause this?

    MY APF settings:

    # Common ingress (inbound) TCP ports -3000_3500 = passive port range for Pure FTPD
    IG_TCP_CPORTS="21,25,53,80,110,143,443,465,993,995,2083,2087,2096,3000_5000,6666,22305"
    #
    # Common ingress (inbound) UDP ports
    IG_UDP_CPORTS="21,53,465,873"

    # Common ICMP (inbound) types
    # 'internals/icmp.types' for type definition; 'all' is wildcard for any
    IG_ICMP_TYPES="3,5,11,0,30,8"

    # Common egress (outbound) TCP ports
    EG_TCP_CPORTS="21,25,26,37,43,53,80,113,465,873,2089,3306"
    #
    # Common egress (outbound) UDP ports
    EG_UDP_CPORTS="20,21,53,465,873"

    # Common ICMP (outbound) types
    # 'internals/icmp.types' for type definition; 'all' is wildcard for any
    EG_ICMP_TYPES="all"
     
  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
    Have you enabled the WHM > Tweak Security > SMTP Tweak? If so, disable it.
     
Loading...

Share This Page