Solved

I am having a difficult time getting SMTP on Windows 2008 Server to work properly. Need help?

Posted on 2008-10-04
21
1,646 Views
Last Modified: 2012-05-05
I need someones help to insure that I am setting up SMTP on a Windows 2008 Server correctly.

I have a few applications trying to send emails through a specific SMTP IP address.

I have my websites on one Windows 2008 server (with a unique IP) and I have another Windows 2008 server (with a unique IP) set up just for SMTP purposes.

I also have a very simply PHP script that allows me to set the SMTP IP and the username and password for validation.

When I fill the form out, it seems to work fine .. EXCEPT .. if the FROM field in the form is from a few of my domains (that are on a different server and IP).  But when I don't send it from the domains that seem to be giving me a problem .. it appears to work fine.

NOTE:  Previously I was sending emails through a different SMTP IP (that my web host has set up and uses for the sending of all regular email).  When I used this SMTP I didn't have any problems at all.

So, since I am now having these issues, I am figuring that something with my set up on the Windows 2008 server and the SMTP on the server is most likely the issue, but I don't know how to figure out what's wrong and how to fix it.

I need someone's help.

Please let me know if you can assist.

Thanks
Gary

0
Comment
Question by:garymgordon
  • 10
  • 10
21 Comments
 

Author Comment

by:garymgordon
ID: 22641364
Further testing and comments:

When I send an email (through my PHP form) .. using an email addres as the FROM FIELD .. (from a couple specific domains) the emails always go in the queue.  And, when I send an email (through the same PHP form) .. using an email address as the FROM FIELD .. (from a different domain) .. the emails always go through and don't get held up in the queue folder.

I am hoping this info helps.  Because it's not my "applications or scripts" that are sending the emails that appear to be a problem.  The problem seems to be related directly to the email address that is set to the FROM field.  So, some domains when used in the FROM field are causing a problem and other domains are not.

Let me know what other questions you might have to help me resolve this.
0
 
LVL 4

Expert Comment

by:placebo69a
ID: 22641798
Hi there!
In order to eliminate scripting issues as the source of the problem, can you use telnet to try and send the test emails instead of your php form?
To send an email using telnet enter each of these lines in turn:
telnet smtp_ip_address 25
helo world
send from:sender_email_address
rcpt to:target_email_address
data
.
The last line is simply a dot. Type quit to exit the telnet session.
Once we've made certain the PHP script is not at fault we can check why certain domains aren't being forwarded by your smtp server and how we can persuade it to forward them.
Let me know how it goes. :)


0
 
LVL 12

Expert Comment

by:Pugglewuggle
ID: 22641838
Hi garymgordon,
If you have your DNS for these websites hosted elsewhere, it's possible that the DNS host automatically added something called an SPF (sender policy framework) property to your DNS to prevent SPAM. I've seen this done a few times and it has cause problems, so if it is offsite, please contact your DNS host and see if they did this.
SPF is a technology that lets mail servers verify the identity of the IP address the mail came from. If the source IP address and the domain name in the SPF policy for the domain you're sending mail from don't match then the mail will get rejected.
Here's an article on SPF:
http://en.wikipedia.org/wiki/Sender_Policy_Framework

Please try this first to make sure this isn't the issue and we can work forward from there!
Cheers!
0
 

Author Comment

by:garymgordon
ID: 22641931
Pubblewuggle,

I set up Telnet.

I then entered ..

telnet smtp_ip_address 25

helo world

send from:sender_email_address

but after the last line of "send from:ggordon@garymgordon.com"  (without the quotes) it said 500 5.3.3 Unrecognized command.

Gary
0
 
LVL 12

Expert Comment

by:Pugglewuggle
ID: 22642165
The actual command to send is MAIL FROM: email@domain.tld
and the command for the recipient is RCPT TO: email@domain.tld
after entering the RCPT TO command if you get something like this:
550 Recipient refused. The sender's domain requires authentication or is not a valid user.

Then you've got an SMTP authentication error on hand.
I guess placebo just made a mistake.
Cheers! Try that!
0
 

Author Comment

by:garymgordon
ID: 22642226
Ok.

Here's what happened so far.

helo world
250 127.0.0.1 Hello {208.73.48.43]
MAIL FROM:ggordon@garymgordon.com
250 2.1.0 ggordon@garymgordon.com .... Sender OK
RCPT TO:ggordon@gordondesigns.com
550 5.7.1 Unable to relay for ggordon@gordondesigns.com

So I stopped there and figured I would show this to you.

Gary
0
 

Author Comment

by:garymgordon
ID: 22642236
NOTE: I tried sending to ggordon@garymgordon.com and got the same "Unable to relay to ggordon@garymgordon.com" message.

I also tried sending to (RCPT TO) garymgordon@gmail.com, but got the same "Unable .." message.
0
 
LVL 12

Expert Comment

by:Pugglewuggle
ID: 22642276
If you got unable to relay that means that you have relay turned off for either a) the domain gordondesigns.com, or b) for the whole mail server.
The trick is to allow AUTHENTICATED relay instead of open relay. With open relay spammers will bounce tens of thousands of SPAM messages from your server in a month and get you blacklisted.
You need to set this up and then make your PHP script authenticate to SMTP.
There's also a neat tool that will build scripts - if nothing else you can use a script built with it as an example of how to authenticate SMTP in PHP:
http://www.bebosoft.com/products/formstogo/
This tool does ASP, PHP, and PERL.
Cheers!
0
 
LVL 12

Expert Comment

by:Pugglewuggle
ID: 22642282
Whatever you do... NEVER set your server to open relay. Just thought I should reiterate that to be sure.
0
 

Author Comment

by:garymgordon
ID: 22642604
Can you please explain what my settings should be in IIS6 when configuring SMTP?

Thanks .. this way I won't make any mistakes.

Gary
0
Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

 
LVL 12

Expert Comment

by:Pugglewuggle
ID: 22642611
You shouldn't have to configure anything in IIS 6.0 to run SMTP - the script will handle everything and hand it off the mail server if you specify the server's host name (DNS name) or IP address.
0
 

Author Comment

by:garymgordon
ID: 22642618
NOTE:  Under the Access tab in SMTP .. I have "Only the list below" selected and the IP addresses from my server (with the php script) is included in this list.

When you say "If you got unable to relay that means that you have relay turned off for either a) the domain gordondesigns.com, or b) for the whole mail server."  

How can I make sure that I have relay turned ON properly for all of my domains.

Again, I have two servers.  One where I have my websites ... and the other .. which is basically just the SMTP server.

?
Gary
0
 
LVL 12

Expert Comment

by:Pugglewuggle
ID: 22642648
I suppose that would work then as far as access restriction... is that SMTP server on the same network as the web server or is it out over the internet? If it's inside just use the private IP of the web server. If it's outside, make sure you use the web server's public IP.
All the Windows Server SMTP is is a relay server... it just forwards it, providing a local SMTP gateway for local servers and the sends it off to a real mail server.
The relaying you'd be checking in this case would be on your main email server (especially if it's offsite).
When you say "One where I have my websites", do you mean a local SMTP server in IIS, or a full featured mail server? Same with the other one. Is that onsite or offsite, and is it just an SMTP forwarder or is it a full mail server?
Cheers!
0
 

Author Comment

by:garymgordon
ID: 22642675
Both servers are on the same network with the same hosting provider.

Would you mind IMing with me about this?

If so, my IM is garymgordon on both Yahoo and AIM.   And garymgordon@gmail.com on GoogleTalk.  And garymgordon@hotmail.com on MSN.

Thanks,
Gary
0
 
LVL 12

Accepted Solution

by:
Pugglewuggle earned 500 total points
ID: 22642831
Gary, it sounds like you've got some sort of SPF setup on your domains... I know I mentioned that earlier, but if it works for other domains and doesn't work when sending to yours, that's probably what's going on.
SPF will not allow an SMTP server to send mails if that SMTP server doesn't have an exception rule added to the SPF record OR if it isn't an MX for that domain.

Also, there could be a routing issue or some sort of restriction between the two servers in the datacenter...
Cheers!
0
 

Author Comment

by:garymgordon
ID: 22642869
I'll send this info to my hosting people and let you know what they say.

Thanks for your input.
:-)
Gary
0
 
LVL 12

Expert Comment

by:Pugglewuggle
ID: 22642877
No problem! Keep me informed on what happens.
Cheers!
0
 

Author Comment

by:garymgordon
ID: 22644614
Hi.

The hosting company replied back and said this:

"All of your domains are on the .25 server and the .25 mail server is set to allow mail from your .43 server so I doubt it has anything to do with SPF records since we are not checking for them on our servers."

NOTE:  The .25 server is their MAIN Email Server that I was connecting to before when everything was fine.  Due to spam reports (even though I don't send out spam), they set up a different server with the ending IP of .43 for me to use as my SMTP server.

When I change the php.ini file (on the server where my websites and web pages are on) back to using the .25 server for SMTP, everything works fine.  But when the php.ini file is set to using .43 .. this is when my issues with emails from and to certain domains of mine .. appears to pop up.

They asked me to ask you .. if you had any further thoughts as to what could be causing this?  What they might need to do?  What changes might need to be made?

Thanks,
Gary
0
 
LVL 12

Expert Comment

by:Pugglewuggle
ID: 22652565
Very interesting... If they are managing the email server something is clearly wrong with their setup as it was working before and nothing had changed in your code.
Unfortunately, I don't have any other ideas as to what's going on without being able to get my hands on the servers... the only thing I can suggest is to ask them to verify their configuration of the .43 server.
As far as the changes that need to be made, it really depends on what's going on... that will be up to them to determine.
Cheers!
0
 

Author Closing Comment

by:garymgordon
ID: 31503033
The problem never got resolved, but I appreciated your help with the matter.  I ended up moving my SMTP to another outside service. hahaha  So, again .. Thank you for your help.  I guess I'll never really know what the exact issue was.  Thanks again.
0
 
LVL 12

Expert Comment

by:Pugglewuggle
ID: 22695354
No problem!
Cheers!
0

Featured Post

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).

Join & Write a Comment

Workplace bullying has increased with the use of email and social media. Retain evidence of this with email archiving to protect your employees.
Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
This tutorial will show how to configure a single USB drive with a separate folder for each day of the week. This will allow each of the backups to be kept separate preventing the previous day’s backup from being overwritten. The USB drive must be s…

757 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

21 Experts available now in Live!

Get 1:1 Help Now