From what I gather, your web server's sendmail is intercepting the the
email instead of routing it to the correct mail server because it has
the same domain name as the recipient address? You need to manually
create a rule in the sendmail to override that so it routes all email
addressed to "@yourdomain.com" over to the correct external mail server.
See the sendmail section of
http://www.mail-abuse.com/an_rteoutgoing.html for an idea. It's been a
long time since I hacked sendmail.
~Rolan
Mark Armendariz wrote:
Happy 2007, everyone.
I know this isn't directly a php, issue, but I was hoping someone here
might have some experience with such a thing.
My client has their site on one server and their their email server at
another hosting company. I'm trying to send mail from a php script
(using the mail function) on the site.
I know sendmail is working correctly, as I can send email to my own
domain as well as to any other I've tried. This only applies to
sending email internally.
Sendmail has a recipient check. Basically, it talks to the
recipient's server and checks that the user exists before trying to
send the message. Unfortunately, since the hosting server has the
same domain name as the mail server.
** Here's the php:
$aHeaders = array();
$aHeaders[] = 'From: ' . EMAIL_DONATIONS;
$aHeaders[] = 'X-Mailer: PHP v' . phpversion();
$sSubject = 'New Donation Submitted';
$sMessage = 'A new donation has been submitted through the site.';
mail(EMAIL_DONATIONS, $sSubject, $sMessage, implode("\n", $aHeaders),
'-v');
** Here's the verbose output of sendmail (with my domain in place of
the client's)
[EMAIL PROTECTED] Connecting to localhost.localdomain. via relay...
220 ss07.shared.server-system.net <http://ss07.shared.server-system.net> ESMTP
Sendmail 8.12.11.20060308/8.12.11; Thu, 4 Jan 2007 11:09:10 -0800
>>> EHLO laco.org <http://laco.org>
250-ss07.shared.server-system.net <http://250-ss07.shared.server-system.net> Hello
localhost.localdomain [127.0.0.1 <http://127.0.0.1>
], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE 15000000
250-DSN
250-ETRN
250-AUTH LOGIN PLAIN
250-STARTTLS
250-DELIVERBY
250 HELP
>>> STARTTLS
220 2.0.0 Ready to start TLS
>>> EHLO enobrev.com <http://enobrev.com>
250-ss07.shared.server-system.net <http://250-ss07.shared.server-system.net>
Hello localhost.localdomain [
127.0.0.1 <http://127.0.0.1>], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE 15000000
250-DSN
250-ETRN
250-AUTH LOGIN PLAIN
250-DELIVERBY
250 HELP
>>> MAIL From:<
[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> SIZE=300 [EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>
250 2.1.0 <
[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>... Sender ok
>>> RCPT To:<[EMAIL PROTECTED] <http://enobrev.com>>
>>> DATA
550 5.1.1 <[EMAIL PROTECTED] <http://enobrev.com>>... User unknown
503 5.0.0 Need RCPT (recipient)
>>> RSET
250 2.0.0 Reset state
dead.letter..
. Saved message in dead.letter
Closing connection to localhost.localdomain.
>>> QUIT
221 2.0.0 ss07.shared.server-system.net <http://ss07.shared.server-system.net>
closing connection
Now, I know for a fact the recipient's email exists on my client's
mail server (which is an exchange server). The only thing I can
figure is that it's checking the local host for the recipient and not
finding it, and hence never sending the email.
Anybody ever run into this before? Is there a switch i can use with
php's mail function or sendmail to get around this?
Thanks!!
Mark Armendariz
------------------------------------------------------------------------
_______________________________________________
New York PHP Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk
NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com
Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php
_______________________________________________
New York PHP Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk
NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com
Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php