Consider local_domains only if DNS matches

DirectAdmin Support

Staff member
Feb 27, 2003

This exim.conf option is based on this thread:

where the issue is relating to this feature, which we've already implemented:

The issue with the id=752 is that it's a static list... and there are far more domains than that which should be on the list, but because it's static, and not dynamic, it doesn't work to it's full potential.

The issue is when a domain is added that shouldn't be added.
The exim list mentions code similar to this, added to your router, after the lookuphost:
        driver = dnslookup
        domains = ! @mx_any/ignore=<;;::1
        transport = remote_smtp
        ignore_target_hosts = :
        [COLOR=#000000]self = pass[/COLOR]
        condition = ${if eq {$received_protocol}{local} {yes}{no}}
where the email is not considered local if the condition doesn't match (must be a local connection), and if the domain has an MX record that resolves to an external IP.

The condition was added to prevent open relays.... but has the added affect, where an email sent to this server.. if the MX are external would actually be saved locally (could be handy... but would be rare since the MX records don't actually point here).
Main benefit was just to prevent a relay where mail to that domain could be bounced through this server with no auth, because the domain is in local_domains.

I've done some basic testing, but I've never used the @mx_any option before, so I'd figure I'd throw it out to see what everyone thinks, or if anyone wants to try it.
Also looking for cases where it doesn't work... eg, if anyone is using a specialized setup..
Need to decide if this would be good or bad to add as a default exim.conf option.

One issue already noted, is that with this, you cannot use in your /etc/resolv.conf, else the MX record will always be local (assuming default settings)..
It only works with external dns servers in the resolv.conf.

This is the first opportunity I've had to look at this issue again, since our email exchange of a few days ago.

The reason that I don't like your suggestion is that it could keep you from setting up a site in advance of transferring it from another server to my hosting server.

What I've been thinking is that the ideal way I'd want to handle this might be to use a separate system for sending email than for receiving. Then when sending email through that system DNS and MX would always be used, so the email would always go to where it should, even if there was a URL set up on the shared hosting server for that domain.

The easy way to do this might be by using a smarthost setting and send the email through that smarthost.Then it'll only go back to the sending server based on MX.

I know lots of big providers use a smarthost, and this could be one of the reasons why.

What I'm wondering is how to do this for those of us who don't have and/or don't want to spend for the resources to have a separate smarthost.

Could we run a separate instance of exim, using it's own exim.conf file, perhaps it's own file, and certainly it's own cache, on the same server? It would have to have a different IP# or port to receive the email; doing it by it's own port would actually be very easy.

What do you think?