views:

357

answers:

1

So, the setup is this, 2 separate servers...

Web server, has IIS7, MS SMTP

Mail server has MailEnable

On the web server, I'm sending an email from an ASP.Net app, via the mail server, and it is getting marked as spam

If I send an email through the mail server, just from a normal mail client, it doesn't get marked as spam.

I'm sure this is a setup issue, but what am I likely to have done wrong?

web.config:

<smtp from="[email protected]">
  <network host="mail.mymailserver.co.uk" userName="[email protected]" password="password" />
</smtp>

asp.net, just a normal SmtpClient send:

SmtpClient client = new SmtpClient();
client.Send(mailMessage);

a random gut feeling reckons it's probably sending through the local SMTP server, then on to MailEnable, and that's giving it weird headers...just a thought though

The headers contain this line: Received-SPF: softfail (google.com: best guess record for domain of transitioning [email protected] does not designate unknown as permitted sender)

I've no idea what it means though (the part looks suspicious)

+2  A: 

The Received-SPF error is related to Sender Policy Framework. What you need to do is change the DNS records on your domain to include your web server (usually its IP address) as a valid sender.

The SPF website has details on how to setup this configuration.

Edit: It's up to the mail client how to interpret: Received-SPF: softfail. So when you allow any domain to send emails, you might still run into this error. From http://www.openspf.org/SPF_Received_Header:

When an SPF query returns any other result, the MTA should add an advisory header to the message of the form "Received-SPF: neutral" or "Received-SPF: pass". That way, a spam filter further down the road can take that header into account as part of a more balanced decision.

Keltex
The domain has an SPF record though - just a really generic one that says anything is allowed to send for it (don't normally do that, but to try and diagnose this issue I tried to rule it out).
Paul
I've just noticed that the word unknown was hidden from my question, I have put this back in
Paul