On a Debian Lenny server 'example.net', we have some cron jobs that need to send mail to 'job-owner@example.net'. The MX for the domain is an offsite dedicated SMTP server. Exim is using the system-aliases router to find the local user, and not finding him:

$ exim -bt job-owner@example.net
R: system_aliases for job-owner@example.net
job-owner@example.net is undeliverable: Unrouteable address

In /etc/aliases we have the normal redirect for system users to root, which I'd like to keep.

What is the best way to have exim send mail for users that aren't found locally to the SMTP host specified through dnslookup?


So, after your localuser router, add a slightly modified copy of your dnslookup router:

  driver = dnslookup
  domains = example.net
  transport = remote_smtp
  ignore_target_hosts = :

Note that "domains =" has been changed as has the name of the router.

FWIW it's an odd configuration to have the server in question think that example.net is local if it's being handled as a local domain, with a different set of valid users, somewhere else. Not a wrong configuration necessarily, but odd enough to make my "you may have made a wrong choice before you got here" sense tingle.

| improve this answer | |
  • I agree it's non-kosher, but the choice was made to have GoDaddy (!) host the SMTP service for the domain, and the server was given only the domain name as it's hostname (as opposed to foo.example.net). – sbeam Dec 15 '10 at 19:16

The simplest solution for your problem is probably to put something like the following in your /etc/aliases:

job-owner : real-address@remote-host.com

A different and purer solution is for the local machine to route email only for itself (eg for server 'localserver', so that example.net is routed correctly over DNS via the dnslookup router as suggested by jj33.

Your local server should not be resolving example.net unless it is the main mail routing server for the example.net domain.

| improve this answer | |

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.