I have set up gmail google app accounts for our own domain, domain.com, 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. admin@domain.com.

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 domain.com -- work ok.

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

Any help is welcome. Cheers!

2 Answers 2


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 = domain.com
  transport = remote_smtp
  # ignore private rfc1918 and APIPA addresses
  ignore_target_hosts = : : :\
               : : :\

This forces a remote delivery (via standard dnslookup) even for *@domain.com 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".

  • oh man i love you, you saved a lot of my time
    – avasin
    Jul 15, 2014 at 10:12

The domain domain.com 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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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