2008-05-09, 09:07 AM
(This post was last modified: 2008-05-09, 09:26 AM by thehappyappy.)
I have a strange problem. I have a script that sends out emails and it used to work fine to all email addresses, but I recently moved the site to a dedicated server and now it won't send out emails to any Hotmail accounts. None of the Hotmail accounts have got spam filters on and they all used to get email from the site. All of the script is the same as I say the only difference is the site is now on a dedicated server. Both the old and new servers are RedHat Linux using php5. I went into the php.ini file and all I found for SMTP is:
Quote:[mail function]; For Win32 only.
SMTP = localhost
smtp_port = 25
; For Win32 only.
;sendmail_from = me@example.com
; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
sendmail_path = /usr/sbin/sendmail -t -i
The send_mail() function is:
Code:
<?php
function send_mail($to, $from, $subject, $message)
{
global $g;
if (isset($g['options']['mail_html']) and $g['options']['mail_html'] == "Y") $ct = "text/html";
else $ct = "text/plain";
if (isset($g['options']['mail_utf8']) and $g['options']['mail_utf8'] == "Y") {
$headers = "From: " . $from . "\n";
$headers .= "Content-Type: " . $ct . "; charset=utf-8;\n";
$headers .= "Reply-To: " . $from . ";\n";
$headers .= "Return-Path: " . $from . ";\n";
} else {
$headers = "From: " . $from . "\n";
$headers .= "Content-Type: " . $ct . ";\n";
$headers .= "Reply-To: " . $from . ";\n";
$headers .= "Return-Path: " . $from . ";\n";
}
if (isset($g['options']['mail_utf8_subject']) and $g['options']['mail_utf8_subject'] == "Y") $subject = '=?UTF-8?B?'.base64_encode(trim(preg_replace('#[\n\r]+#s', '', $subject)))."?=\n";
mail($to, $subject, $message, $headers);
}
but that all works fine. It's just that the emails aren't being sent to Hotmail addresses.
I read something about port 25 being blocked and that's why Hotmail addresses aren't receiving the emails, but I've just checked and port 25 is definitely not blocked:
Quote:# Generated by iptables-save v1.3.5 on Tue May 6 15:45:00 2008*filter
:INPUT DROP [0:0]
:FORWARD DROP [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p tcp -m tcp --dport 22 -m state --state NEW -j ACCEPT
-A INPUT -p tcp -m tcp --dport 80 -m state --state NEW -j ACCEPT
-A INPUT -p tcp -m tcp --dport 443 -m state --state NEW -j ACCEPT
-A INPUT -p udp -m udp --dport 53 -m state --state NEW -j ACCEPT
-A INPUT -p tcp -m tcp --dport 53 -m state --state NEW -j ACCEPT
-A INPUT -p udp -m udp --dport 69 -m state --state NEW -j ACCEPT
-A INPUT -p tcp -m tcp --dport 69 -m state --state NEW -j ACCEPT
-A INPUT -p tcp -m tcp --dport 25 -m state --state NEW -j ACCEPT
-A INPUT -p tcp -m tcp --dport 110 -m state --state NEW -j ACCEPT
-A INPUT -p udp -m udp --dport 123 -m state --state NEW -j ACCEPT
-A INPUT -p tcp -m tcp --dport 20 -m state --state NEW -j ACCEPT
-A INPUT -p tcp -m tcp --dport 21 -m state --state NEW -j ACCEPT
-A INPUT -p tcp -m tcp --dport 3306 -m state --state NEW -j ACCEPT
-A INPUT -p udp -m udp --dport 3306 -m state --state NEW -j ACCEPT
-A INPUT -p tcp -m tcp --dport 5555 -m state --state NEW -j ACCEPT
-A INPUT -p tcp -m tcp --dport 8002 -m state --state NEW -j ACCEPT
-A INPUT -p tcp -m tcp --dport 9001 -m state --state NEW -j ACCEPT
-A INPUT -p tcp -m tcp --dport 999 -m state --state NEW -j ACCEPT
-A INPUT -p tcp -m tcp --dport 1982 -m state --state NEW -j ACCEPT
-A INPUT -p tcp -m tcp --dport 1983 -m state --state NEW -j ACCEPT
-A INPUT -j DROP
-A OUTPUT -o lo -j ACCEPT
-A OUTPUT -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT
COMMIT
# Completed on Tue May 6 15:45:00 2008