Consider local_domains only if DNS matches

DirectAdmin Support

Administrator
Staff member
Joined
Feb 27, 2003
Messages
9,158
Hello,

This exim.conf option is based on this thread:
https://lists.exim.org/lurker/message/20070514.011457.92a84c56.en.html

where the issue is relating to this feature, which we've already implemented:
http://www.directadmin.com/features.php?id=752

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:
Code:
not_yet_hosted:
        driver = dnslookup
        domains = ! @mx_any/ignore=<;127.0.0.1;::1
        transport = remote_smtp
        ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8
        pass_on_timeout
        [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 127.0.0.1 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.

John
 
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 exim.pl 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?

Jeff
 
Back
Top