Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have taken out a hosting agreement with a well respected hosting provider for a couple of internet facing servers. We have deployed several applications to these servers which send various e-mails back to us for reporting purposes.

Context:

Each server runs Windows Server 2003 R2 with the IIS 6.0 SMTP service installed.

Each application is configured to use the local instance of IIS to send e-mails.

The external IP address of each server is mapped to a particular domain eg:

  • server1.mydomain.com
  • server2.mydomain.com

These e-mails are sent from a company domain name and not the domain name of the hosted servers (eg: reporting@mycompanydomain.com)

Symptoms:

A small number (<1%) of e-mails sent from these applications appear to be duplicated. These are exact duplicate in terms of both content and message headers.

The Fix:

I contacted my hosting provider and they told me this was a common problem & instructed me to:

  1. Change the HELO response of your mail server service to a FQDN (server1.mydomain.com && server2.mydomain.com)
  2. Create a DNS A record that resolves the FQDN of your mail server to the primary IP address of your sending mail server.
  3. Create a PTR record that resolves your primary IP address back to your mail server's FQDN
  4. In the sending domain's (mycompanydomain.com) DNS zone file, add the appropriate SPF record for your hosted servers. eg: v=spf1 a mx include:mydomain -all

The Problem Continues:

I made all of the changes as prescribed above, I was a little hesitant because these steps seemed to suggest they were more for stopping your messages getting blocked than they were for stopping them from being duplicated - but I am certainly no expert in these matters.

It has been 5 days since I applied this fix and the problem still persists.

I am certain that these problems are not a bug in the software because they are 4 different applications installed on 2 different servers, all of whom are exhibiting this strange behaviour. This behaviour has also not been seen in our UAT environment.

Were my hosts correct to suggest this fix? If not, does anyone know what could be the cause of this problem?

Many Thanks

share|improve this question

2 Answers 2

Okay, I'm playing devil's avocado here, but just on the off-chance, I'll mention it - are you using some sort of queuing technique for sending your emails in your app? I ask in case you are using a servicebus-style architecture, and maybe messages are being processed, thus sending emails, but for some reason there is then an exception that means the servicebus retries processing of the message.

Or something. I'm probably barking up the wrong acacia but it's worth a mention. :)

share|improve this answer
    
it's a nice suggestion but no - one of these pieces of software is SQL Server Integration Services - I'd like to think they wouldn't make mistakes like that. All custom code sends e-mail direct - no queueing required. –  Gavin Osborn Feb 8 '10 at 14:55

I'm running 20+ boxes like this - W2K3R2 w/ IIS SMTP and have never seen this behavior. As you suspected, all those steps in their "fix" were things to improve the likelihood that your messages would be received on the other end vs being blocked as spam.

Are you 100% sure that the duplication is occurring at the source? I've had issues in the past with duplicate emails being created on the recipient mail system. If that were happening, all attributes would be the same.

I guess the other thing I'd do is crank up the IIS SMTP logging on the hosted machines and review those logs. There might be some kind of clue in there. If IIS is sending 2 copies of a message, you'll see 2 entries in that log. If there are 2 entries there, the culprit is likely the mechanism you are using to submit the messages to IIS which you haven't discussed in detail. How exactly are you doing that?

share|improve this answer
    
There are various mechanisms - some of them custom applications that are coded by our team but also SQL Server Integration Services and ASP.Net Health Monitoring; both robust platforms that are not known for creating this problem. –  Gavin Osborn Feb 8 '10 at 16:49

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.