IIS – Set Up SMTP Server in Parallel with Google Apps

iissmtp

I am currently using free version of Google Apps for hosting my email.It works great for my official mails my email on Google is support@mydomain.com.

In addition I'm sending out high volume mails (registrations, forgotten passwords, newsletters etc) from the website (www.mydomain.com) using IIS SMTP installed on my windows machine.

These emails are sent from talk@mydomain.com

My problem is that when I send email from the website using IIS SMTP to a mail address support@mydomain.com I don’t receive the email to Google apps. (I only receive these emails if I install a pop service on the server with the support@mydomain.com email box). It seems that the IIS SMTP is ignoring the domain MX records and just delivers these emails to my local server.

Here are my DNS records for domain.com:

mydomain.com  A 82.80.200.20 3600s      
mydomain.com  TXT v=spf1 ip4: 82.80.200.20 a mx ptr include:aspmx.googlemail.com ~all  
mydomain.com  MX preference: 10 exchange: aspmx2.googlemail.com  3600s  
mydomain.com  MX preference: 10 exchange: aspmx3.googlemail.com  3600s  
mydomain.com  MX preference: 10 exchange: aspmx4.googlemail.com  3600s  
mydomain.com  MX preference: 10 exchange: aspmx5.googlemail.com  3600s  
mydomain.com  MX preference: 1 exchange: aspmx.l.google.com  3600s  
mydomain.com  MX preference: 5 exchange: alt1.aspmx.l.google.com  3600s  
mydomain.com  MX preference: 5 exchange: alt2.aspmx.l.google.com  3600s 

Please help!

Thanks.

Best Answer

This could be caused from 1 of 3 potential issues. Either A) Google mail is catching the email as spam, B) something on the local machine is hotwiring the emails or C) the SMTP server isn't setup correctly to allow relaying.

In the case of A), it's worth doing in any case. In your TXT record for your DNS zone, make sure to add all of the IP addresses used for outgoing email from your server. Maybe it's 82.80.200.20 and already there if your web server only has 1 IP address, but best to confirm. If you are sending from something not listed as an approved SPF sending server then your messages will be flagged as potential spam. Also, check for any unusual patterns in your emails that gmail may not like (blank subjects, spamming keywords, etc).

For B), confirm that your IIS SMTP settings don't define your domain name as an account. The IIS install should be very straight forward. Basically just set 127.0.0.1 as an allowed relay, everything else should be default for an outgoing smtp server.

For C), it's basically what I mentioned in the previous point, to make sure that you have the relay set to 127.0.0.1, or you're authenticating when sending.

Another test is to send to a non-gmail account and see if it arrives. That will confirm that the smtp server is working correctly.

Additionally, you can do a nslookup test to confirm that there isn't another DNS server hotwiring DNS. You can test it with the following from the command line:

nslookup
set type=mx
yourdomain.com