Exim and Windows Live Domains

Usually, sending mail using Exim from your domain without a smart host is not a problem. But recently, I faced a peculiar problem.

I wanted to send mail using exim from a domain, to an account on the same domain handled by Windows Live Domains

Now, the MX records for the domain in question point to outlook.com's servers, and the account was only created on outlook.com. But, Exim was considering the account as local, and since there was no such local account, the message delivery was failing.

What I wanted to do was force a dns lookup for this particular address by exim.

I found possible solutions on the following links:

Note: The above solutions mention Google Apps, but work just as well for outlook.com (using Windows Live Domains).

There were some minor issues with both that I didn't like:

  • The first solution was forcing a dns lookup for all addresses on a domain, but I wanted to manually specify the address.
  • In the second solution, you have to provide a manual route, but I prefer a dns lookup.

So, I combined the two and came up with the following:

# specify addresses here (separated with a pipe '|')
WINDOWS_LIVE = email@domain.com

  debug_print = "R: dnslookup for $local_part@$domain"
  driver = dnslookup
  condition = ${if match {${local_part}@${domain}}{WINDOWS_LIVE}{yes}{no} }
  transport = remote_smtp
  # ignore private rfc1918 and APIPA addresses
  ignore_target_hosts = : : :\
               : :\

This way you can specify the email addresses and force a dns lookup for them, instead of manually specifying the route.

You need to put the above in your exim configuration file, and restart the exim daemon. On Debian squeeze, the file is at:


PS: If you intend to send mail from your server using exim, and also directly from outlook.com, you will probably have to add your server's IP address to the TXT (SPF) record, like shown below:

"v=spf1 ip4:x.x.x.x include:hotmail.com ~all"

Without this, I was getting an SPF SOFTFAIL.


Comments powered by Disqus