Q:

Directadmin default php mail from (exim)

We use a server under NAT and it hosts a domain with unvalid tld as "MI" and when we try to send a mail with phpmail at most cases we got this error in /var/log/exim/mainlog
2014-11-02 04:00:06 1XkV74-0006Qj-6i == *@*.* R=lookuphost T=remote_smtp defer (-44): SMTP error from remote mail server after RCPT TO:<*@*.*>: host mail4.*.* [*.*.*.*]: 450 4.1.8 <*@*>: Sender address rejected: Domain not found

I create a file /etc/email-addresses with following content:
myusername: my@valid-email-address.com

And when I try to import it in exim.conf in REWRITE CONFIGURATION with following code:
*@myusername ${lookup{$1}lsearch{/etc/email-addresses}{$value}fail} bcfrF

I've got this error on "service exim restart":
Starting exim: 2014-11-04 19:10:37 Exim configuration error in line 505 of /etc/exim.conf:
  option setting expected: *@myusername ${lookup{$1}lsearch{/etc/email-addresses}{$value}fail} bcfrF

I also try to make this for all localdomains with this code:
*@+local_domains "${lookup{${local_part}}lsearch{/etc/email-addresses} {$value}fail}" Ffrs

But I also get the same error...
Is there any ideas for this? This server running CentOS 6.5 with DA 1.46.2. Exim version is 4.84.
Best regards!

A:

I strongly suspect the file you are editing is not generating the exim.conf the way you expect it to.  Take a look at the actual exim.conf to make sure that it's generating that rewrite section properly.  It should have a line that says begin rewrite, followed by the line you are adding.
I found I was able to replicate the same error as you if I put the line in my global config (near the beginning), in my routers, in my transports, or at the end of the file.  I got a different error if the line appeared in the ACLs.

