Solved

PHP Mail getting blocked from our Exchange Server

Posted on 2012-03-15
6
1,218 Views
Last Modified: 2012-04-12
Hopefully this will be a easy one someone can help me with.

System:
MS Windows Server 2003 R2
Enterprise x64 Edition SP2
Exchange 2007 Standard Edition.


Awhile back, the company I work for, hired a third party vendor to complely redesign our website.  They set up a contact page, and on this contact page is a form to fill out to ask whatever questions the customer may want to submit.  When the customer hits submit, it sends all the information to Sales@domain.com.  I set up a distribution address on our Exchange server called Sales@domain.com and added a few users who would be answering those emails.

For testing purposes I added my name to the distribution list (sales@domain.com). The problem is, when I send a message using the contact form on the website, the information never makes it to sales@domain.com.  I've searched through the message tracking logs on exchange and I do not see anywhere in there that it made it to the exchange server. I also checked our GFI Mail Security Suite and there is no trace of it ever getting caught up there either.  I know that sales@domain.com works because I can send a email from a personal gmail account and everyone on the distribution list receives it.  I also know that the contact form works as well.  I had the website developer add my personal gmail account, and yahoo account and I received it at both accounts.  So the problem lies on my side of the network.  

I emailed the website guys to ask them how the webserver was sending the mail and this is the response I received back.

We're using PHP Mail() function http://php.net/manual/en/function.mail.php

$response = mail(implode(',',$to_address), $email_subject, $email_message, $headers);


Since it seems to work at any account outside of our exchange accounts, here is what I get to my gmail account when I go to "show original" inside the message.

Delivered-To: user@gmail.com
Received: by 10.220.39.138 with SMTP id g10csp161106vce;
        Thu, 15 Mar 2012 05:11:32 -0700 (PDT)
Received: by 10.50.153.165 with SMTP id vh5mr16567807igb.4.1331813492137;
        Thu, 15 Mar 2012 05:11:32 -0700 (PDT)
Return-Path: <root@u12345678.webserver.com>
Received: from u12345678.webserver.com (u12345678.webserver.com. [12.123.123.101])
        by mx.google.com with ESMTPS id d20si1730483igv.73.2012.03.15.05.11.31
        (version=TLSv1/SSLv3 cipher=OTHER);
        Thu, 15 Mar 2012 05:11:32 -0700 (PDT)
Received-SPF: pass (google.com: best guess record for domain of root@u12345678.webserver.com designates 12.123.123.101 as permitted sender) client-ip=12.123.123.101;
Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of root@u12345678.webserver.com designates 12.123.123.101 as permitted sender) smtp.mail=root@u12345678.webserver.com
Received: (qmail 30110 invoked by uid 48); 15 Mar 2012 08:21:41 -0400
Date: 15 Mar 2012 08:21:41 -0400
Message-ID: <20120315122141.30108.qmail@u12345678.webserver.com>
To: sales@domain.com, user@gmail.com
Subject: Domain.com Contact Us Submission
From: Company Website <company_website@domain.com>
Content-Type: text/html;charset="iso-8859-1"

name: blah<br>
email: user@gmail.com<br>
telephone: 5555555555<br>
comment: testing the form<br>

Anyone have any ideas on things I can look at to see why this is never hitting our exchange server?

Thanks!!

-Zachary
0
Comment
Question by:Jeffery Byers
  • 3
  • 2
6 Comments
 
LVL 22

Accepted Solution

by:
Kim Walker earned 500 total points
ID: 37724977
Is the sender's address (root@u12345678.webserver.com) a valid email address? Gmail is a little less stringent about accepting emails. Has the website guy checked his smtp logs to confirm that the message is being sent to your exchange server? His server could be selective about sending to certain IP addresses or domain names. (I'm assuming that the domain name in your exchange server email address isn't really "domain.com" but you haven't specifically stated that.)
0
 
LVL 4

Expert Comment

by:ScannyR
ID: 37725639
Is the domain name of the website the same as your email accounts? I've seen problems before with incorrect DNS settings causing emails sent from websites not to reach external mail accounts and this would explain why it works for external email accounts.

Rich
0
 

Author Comment

by:Jeffery Byers
ID: 37726242
Is the sender's address (root@u12345678.webserver.com) a valid email address? Gmail is a little less stringent about accepting emails. Has the website guy checked his smtp logs to confirm that the message is being sent to your exchange server? His server could be selective about sending to certain IP addresses or domain names. (I'm assuming that the domain name in your exchange server email address isn't really "domain.com" but you haven't specifically stated that.)

The webserver, from what I know about it, is a dedicated linux server through 1and1 hosting.  The host name of the server is u12345678.webserver.com but root@u12345678.webserver.com is not a valid email as far as I know.  The only thing I know for certain is that he added 3 different email addresses that this contact form would send to.  It successfully sends to all email address he has tested it with, except for any email address on our exchange server.  And you are correct.  The "Sales@domain.com" was just an example, not the actual domain of our exchange server.  

Is the domain name of the website the same as your email accounts? I've seen problems before with incorrect DNS settings causing emails sent from websites not to reach external mail accounts and this would explain why it works for external email accounts.

Rich

Not really. By that I mean, the dedicated linux server host 5 different websites for 5 different products that my company offers.  All 5 websites have the exact same layout just different colors and graphics, so the contact form on each website all points to the same email address (sales@domain.com). I just read this earlier while searching google and wonder if this could be the reason why.  I'll quote it

I change the email headers within PHP to say they're from me@mysite.com however in /var/log/maillog I see they're sent from root@mysite.com. I feel like this is responsible for our email getting blocked on other mail systems.

After reading that I was thinking, Is it possible that because the Return-Path is set to root@u12345678.webserver.com and that address isnt a valid address on my exchange server, thats why its getting blocked/denied on getting delivered to sales@domain.com or any other email on our exchange??
0
Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
LVL 22

Expert Comment

by:Kim Walker
ID: 37726632
Yes. That's what I was eluding to when I asked if it was a valid email address. Have them try using a valid email address for the sender's address.
0
 

Author Comment

by:Jeffery Byers
ID: 37730644
xmediaman-

Will shoot them an email and see if they can change that so it shows as a valid email address that is on our exchange server.
0
 

Author Comment

by:Jeffery Byers
ID: 37837532
Sorry for the late reply.  Was finally able to test that change on Monday and it worked.  

Thanks guys
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

We are happy to announce a brand new addition to our line of acclaimed email signature management products – CodeTwo Email Signatures for Office 365.
Read this checklist to learn more about the 15 things you should never include in an email signature.
To show how to create a transport rule in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Mail Flow >> Rules tab.:  To cr…
The basic steps you have just learned will be implemented in this video. The basic steps are shown to configure an Exchange DAG in a live working Exchange Server Environment and manage the same (Exchange Server 2010 Software is used in a Windows Ser…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now