Solved

PHP Mail getting blocked from our Exchange Server

Posted on 2012-03-15
6
1,209 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 21

Accepted Solution

by:
Kim Walker earned 500 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 21

Expert Comment

by:Kim Walker
Comment Utility
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
Comment Utility
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
Comment Utility
Sorry for the late reply.  Was finally able to test that change on Monday and it worked.  

Thanks guys
0

Featured Post

Do email signature updates give you a headache?

Do you feel like you are constantly making changes to email signatures? Are the images not formatting how you want them to? Want high-quality HTML signatures on all devices, including on mobiles and Macs? Then, let Exclaimer solve all your email signature problems today.

Join & Write a Comment

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Following basic email etiquette rules will help you write a professional email and achieve a good, lasting impression with your contacts.
In this Micro Video tutorial you will learn the basics about Database Availability Groups and How to configure one using a live Exchange Server Environment. The video tutorial explains the basics of the Exchange server Database Availability grou…
The video tutorial explains the basics of the Exchange server Database Availability groups. The components of this video include: 1. Automatic Failover 2. Failover Clustering 3. Active Manager

763 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

9 Experts available now in Live!

Get 1:1 Help Now