Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have set up gmail google app accounts for our own domain,, so that email is handled by gmail. I.e. MX records point to google servers, A records to our own server IP. This works fine.

Now I tried sending emails from our machine (via crontab, using Debian's exim4) to our own email address, e.g.

This doesn't work. Presumably exim is seeing the address as local and fails to forward it to the google servers. The delivery fails with:

Subject: Mail delivery failed: returning message to sender

This message was created automatically by mail delivery software.

A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es) failed:
    Unrouteable address

and is then unhelpfully delivered to /var/mail.

Emails to other addresses -- outside of -- work ok.

I looked at the configs under /etc/exim4/conf.d/ but couldn't make sense of it.

Any help is welcome. Cheers!

share|improve this question

2 Answers 2

up vote 2 down vote accepted

I solved the problem by creating a new router, inside the .ifdef DCconfig_internet block:

  debug_print = "R: dnslookup for $local_part@$domain"
  driver = dnslookup
  domains =
  transport = remote_smtp
  # ignore private rfc1918 and APIPA addresses
  ignore_target_hosts = : : :\
               : : :\

This forces a remote delivery (via standard dnslookup) even for * addresses, which is exactly what I wanted.

There may be an easier way to achieve this, by modifying the existing routers, but this "works for me".

share|improve this answer
oh man i love you, you saved a lot of my time – avasin Jul 15 '14 at 10:12

The domain is invalid or has a bad DNS setup. It could even resolve to an IP in private address space. As you redacted the real domain, there is no much more information we can provide.

share|improve this answer

Your Answer


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.