The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Sending an email with more than one files thambi Shell Programming and Scripting 7 05-25-2007 06:52 PM
Sending email w/ ftp log as attachment idesaj UNIX for Dummies Questions & Answers 2 07-19-2005 08:48 AM
sending email vasikaran UNIX for Dummies Questions & Answers 1 07-05-2005 02:50 AM
sending email in unix. need help! tads98 Shell Programming and Scripting 2 05-16-2005 05:33 AM
Sending email bcheaib UNIX for Dummies Questions & Answers 7 02-22-2005 05:03 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-09-2008
Registered User
 

Join Date: Apr 2008
Posts: 28
Email not sending to Hotmail

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.
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 05-09-2008
Registered User
 

Join Date: Nov 2006
Posts: 252
maybe your new server dunno how to forward the email, maybe you need to specify a mailhost or maybe some config missing.

Go to the "/" root filesystem and check if there is any file called dead.letter.

type mailq to check if your mails are stuck in the queue.

on solaris servers there is a syslog log file whenever you send email out it will log to that file, check your syslog for more clues. Maybe syslog will say mails are dererred or error or remote server terminated you.

Lastly you can try few things which can reveal more details on what's going on in the email sending process

banner test > /tmp/xxx
/usr/lib/sendmail -v youremail@hotmail.com < /tmp/xxx

or

(assuming from your above code your localhost is your mailhost)

First open 2 sessions.
1st session do a tail -f /var/log/syslog

2nd session do
telnet localhost 25
mail from: darthvader@yourdomain.com
rcpt to: youremail@hotmail.com
data
test
test
test
. <---- once you type the termination "." it will immed attempt to send the email. Then at the same time switch to first session(tail -f) to check syslog and see what it says.
Reply With Quote
  #3 (permalink)  
Old 05-09-2008
Registered User
 

Join Date: Nov 2006
Posts: 252
but if you just want a quick and dirty way out of your problem. This may or may not work (usually it does work for me)

On the new server stop sendmail then backup sendmail binary and sendmail.cf
cp -p sendmail sendmail.ORG
cp -p sendmail.cf sendmailcf.ORG

from your old server copy over the sendmail binary and cf file into the appropriate directory, change the appropriate ownership and permissions then start sendmail. Check syslog (tail -f) to see if mails are going out.

good luck
Reply With Quote
  #4 (permalink)  
Old 05-12-2008
Registered User
 

Join Date: Apr 2008
Posts: 28
Thanks, the server itself is sending out email, it was just Hotmail that wasn't getting through, but it turned out that Spam Cannibal had wrong blacklisted it. I've now had it removed from the list and it's all working fine.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 03:50 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0