Page 1 of 1

problem, mail() send only to gmail T_T

Posted: Thu Jan 27, 2011 8:23 pm
by fishown
Hello every one , =]

General:
Im runing my own box, so if ther is some php.ini stuff I can change them.
running centos 5.5 dovecot squirrelmail.

So as the topic says, when i try to use the mail() function it returns TRUE every time ,
but I recive the mail only if im sending to an Gmail account.

NOTE: If im trying to send mail from Squirrelmail , I recive the mail perfectly in evey mail account.

Please, I cant find the answer =\

Re: problem, mail() send only to gmail T_T

Posted: Thu Jan 27, 2011 11:37 pm
by Jonah Bron
The only reason it would behave differently across email providers that I know of would be spam filtering. Check your local and remote spam boxes.

Re: problem, mail() send only to gmail T_T

Posted: Fri Jan 28, 2011 12:02 am
by josh
Post the raw email received at gmail and also a screenshot of a telnet session to your local mail server, also ask the server administrator to check the error logs for the MTA to see if a bounce is occurring, or if the remote servers are sending back an error.

Once I see your raw email & telnet session I can suggest some things possibly, like the EHLO value.

Also run reverse hostname lookup on the IP that this host pings to, make sure all values agree with each other. Make sure they're not in the SBL blocklist

Re: problem, mail() send only to gmail T_T

Posted: Fri Jan 28, 2011 7:03 am
by fishown
First of all thank you for your reply,
Checkd the spam folder, nothing ther.

and josh, what do you mean by "raw email" and how to i see the telnet session?
and im the server administrator
and asme whithe revers hostname look up , im kinda new =\ please explain.

thank you =].
josh wrote:Post the raw email received at gmail and also a screenshot of a telnet session to your local mail server, also ask the server administrator to check the error logs for the MTA to see if a bounce is occurring, or if the remote servers are sending back an error.

Once I see your raw email & telnet session I can suggest some things possibly, like the EHLO value.

Also run reverse hostname lookup on the IP that this host pings to, make sure all values agree with each other. Make sure they're not in the SBL blocklist

Re: problem, mail() send only to gmail T_T

Posted: Fri Jan 28, 2011 8:32 am
by Pazuzu156
I'm not much into squirlmail. I'd recommend Roundcube as it's so much easier to work with.

I made a simple e-mailer with the main() function, sort of like this:

Code: Select all

<?php

if(isset($_REQUEST['submit'])) {
	$email = $_REQUEST['email'];
	$recipient = $_REQUEST['recipient'];
	$subject = $_REQUEST['subject'];
	$message = $_REQUEST['message'];
	
	if($email&&$recipient&&$subject&&$message) {
		mail("$recipient","Subject: $subject", $message, "From: $email");
		echo "
		<div id='container'>
<form action='index.php=submit?".md5("submit")."' method='POST'>
<table id='webmail_table'>
	<tr>
		<td colspan='2' id='webmail_table_title'><span id='send'>Sending, please wait...</span><meta http-equiv='refresh' content='4;url=webmail_sent.php?webmail_id=".md5("sending_mail")."'></td>
	</tr>
	<tr>
		<td>E-Mail: </td>
		<td><input type='text' size='51' name='email' placeholder='Your E-Mail' /></td>
	</tr>
	<tr>
		<td>Recipient: </td>
		<td><input type='text' size='51' name='recipient' placeholder='Recipients E-Mail' /></td>
	</tr>
	<tr>
		<td>Subject: </td>
		<td><input type='text' size='51' name='subject' placeholder='Message Subject' /></td>
	</tr>
	<tr>
		<td>Message: </td>
		<td><textarea cols='40' rows='6' name='message' placeholder='Message'></textarea></td>
	</tr>
	<tr>
		<td><input type='submit' name='submit' value='Send' /></td>
		<td><input type='reset' value='Reset Form' /></td>
	</tr>
</table>
</form>
</div>
		";
	} else {
		echo "
		<div id='container'>
<form action='index.php' method='POST'>
<table id='webmail_table'>
	<tr>
		<td colspan='2' id='webmail_table_title'><span id='send'>Please fill out the entire form, thanks.</span><meta http-equiv='refresh' content='2;url=index.php'></td>
	</tr>
	<tr>
		<td>E-Mail: </td>
		<td><input type='text' size='51' name='email' placeholder='Your E-Mail' /></td>
	</tr>
	<tr>
		<td>Recipient: </td>
		<td><input type='text' size='51' name='recipient' placeholder='Recipients E-Mail' /></td>
	</tr>
	<tr>
		<td>Subject: </td>
		<td><input type='text' size='51' name='subject' placeholder='Message Subject' /></td>
	</tr>
	<tr>
		<td>Message: </td>
		<td><textarea cols='40' rows='6' name='message' placeholder='Message'></textarea></td>
	</tr>
	<tr>
		<td><input type='submit' name='submit' value='Send' /></td>
		<td><input type='reset' value='Reset Form' /></td>
	</tr>
</table>
</form>
</div>";
	}
} else {
	echo "<div id='container'>
<form action='index.php' method='POST'>
<table id='webmail_table'>
	<tr>
		<td colspan='2' id='webmail_table_title'>Form</td>
	</tr>
	<tr>
		<td>E-Mail: </td>
		<td><input type='text' size='51' name='email' placeholder='Your E-Mail' /></td>
	</tr>
	<tr>
		<td>Recipient: </td>
		<td><input type='text' size='51' name='recipient' placeholder='Recipients E-Mail' /></td>
	</tr>
	<tr>
		<td>Subject: </td>
		<td><input type='text' size='51' name='subject' placeholder='Message Subject' /></td>
	</tr>
	<tr>
		<td>Message: </td>
		<td><textarea cols='40' rows='6' name='message' placeholder='Message'></textarea></td>
	</tr>
	<tr>
		<td><input type='submit' name='submit' value='Send' /></td>
		<td><input type='reset' value='Reset Form' /></td>
	</tr>
</table>
</form>
</div>";
}

?>
Where mail(); is:

Code: Select all

mail("$recipient","Subject: $subject", $message, "From: $email");
Try that see if it helps.

Re: problem, mail() send only to gmail T_T

Posted: Fri Jan 28, 2011 11:04 am
by fishown
Hellow guys , found the answer my self T_T...

The problem was that when I installed the Dovecot (SMTP server for linux) my hostname what deffrend then now ...
So i edited the config file to mach the current host name, and it seems so slove the problem.

thank you very much =]

Re: problem, mail() send only to gmail T_T

Posted: Fri Jan 28, 2011 7:42 pm
by Pazuzu156
Glad you solved the problem.