Answer the question
In order to leave comments, you need to log in
Sending emails via exim4 to a domain equal to hostname if the mx record points to another host
There is a site on VDS, the domain example.ru points to it
$hostname example.ru $host example.ru example.ru has address 92.243.84.xx example.ru mail is handled by 10 mx1.example.ru. $ host mx1.example.ru mx1.example.ru has address 62.165.37.xx
$ php -r "var_dump(mail('[email protected]', 'text mail', 'test'));" bool(true) $ sudo grep [email protected] /var/log/exim4/mainlog 2010-09-16 13:23:42 1Ow8on-0005Sb-Cu ** [email protected]: Unrouteable address
$ sudo dpkg-reconfigure exim4-config Please enter a semicolon-separated list of recipient domains for which this machine should consider itself the final destination. These domains are commonly called 'local' domains'. The local hostname (example.ru) and 'localhost' are always added to the list given here.
Answer the question
In order to leave comments, you need to log in
open the exim config and look at the local domains parameter (this, by the way, is what the error text says). Letters to domains from this list will be considered served by this server. All the rest are aliens and will be sent further.
If /etc/exim4/update-exim4.conf.conf has the parameter dc_eximconfig_configtype='smarthost' or dc_eximconfig_configtype='satellite'
Then the /etc/exim4/exim4.conf.template file has the following setting:
smarthost:
debug_print = "R: smarthost for [email protected]$domain"
driver = manualroute
transport = remote_smtp_smarthost
route_list = * DCsmarthost byname
host_find_failed = ignore
same_domain_copy_routing = yes
no_more
This means that the server itself will accept mail for example.com. Also will not send for the domain on external. For example, if mail for a domain on yandex. For everything to come out, fix it to
domains = local_domains : !
If you work on examle.com, then just register it in local domains and mail will be delivered to your mailboxes.
Try to set up normal MX records.
In /etc/exim4/exim4.conf.template I found the following line:
domainlist local_domains = MAIN_LOCAL_DOMAINS
domainlist local_domains = localhost
Put down these things:
domainlist local_domains = localhost: example.com: example.org: example.xxx
It should turn out that mail is not sent via SMTP transport, but is put into mailboxes.
PS If everything is really bad, I'm ready to help with EXIM for a little money. There are recommendations and ready-to-prodaction mail servers.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question