enable csf issue with port 465

blog

Verified User
Joined
Jan 28, 2011
Messages
131
Hi

I have installed and enabled csf after it i can't send email by gmail smtp server when i disable csf it is correct

php mail function:
PHP:
    function smtpmailer($to, $from, $from_name, $subject, $body) {   
        global $error;  
        $mail = new PHPMailer();  // create a new object  
        $mail->IsSMTP(); // enable SMTP  
        $mail->SMTPDebug = 0;  // debugging: 1 = errors and messages, 2 = messages only  
        $mail->SMTPAuth = true;  // authentication enabled  
        $mail->SMTPSecure = 'ssl'; // secure transfer enabled REQUIRED for Gmail  
        $mail->Host = 'smtp.gmail.com';  
        $mail->Port = 465;   
        $mail->Username = GUSER;    
        $mail->Password = GPWD;             
        $mail->SetFrom($from, $from_name);  
        $mail->Subject = $subject;  
        $mail->Body = $body;  
        $mail->AddAddress($to);  
        if(!$mail->Send()) {  
            $error = 'Mail error: '.$mail->ErrorInfo;   
            return false;  
        } else {  
            $error = 'Message sent!';  
            return true;  
        }  
    }

open ports in csf config

# Allow incoming TCP ports
TCP_IN = "20,21,22,25,53,80,110,143,443,465,587,993,995,2222,57241"

# Allow outgoing TCP ports
TCP_OUT = "20,21,22,25,53,80,110,113,443,465,2222"


what is issue? how i can fix it?

Thank you,
best regards.
 
add 465 to UDP_OUT and restart csf but isn't fixed
 
Last edited:
Hello,

You should check

Code:
dmesg

to find what is blocking 465 outgoing TCP
 
And also of course try restarting CSF after making the changes.

Jeff
 
Solution:
if /etc/csf/csf.conf > SMTP_BLOCK = 1 >"Delete Port 465" from SMTP_PORTS =25,587
or
SMTP_BLOCK = 0
 
Back
Top