Search code examples
emaildebianrootexim

exim4 cannot send email to root (all localhost users)


I have a problem with exim4 configuration. I try to send email to root, but email stay frozen in queue.

I tried this:

root@server2:~# echo TEST | mail -s "Hello this is testing email" root

and email is in queue (frozen), please see some outputs below.

In log (/var/log/exim4/mainlog) is this message:

2014-06-11 11:47:36 1Wuf84-0004o3-E4 <= [email protected] U=root P=local S=416
2014-06-11 11:47:36 1Wuf84-0004o3-E4 remote host address is the local host: server2.mydomain.cz
2014-06-11 11:47:36 1Wuf84-0004o3-E4 == [email protected] R=dnslookup defer (-1): **remote host address is the local host**
2014-06-11 11:47:36 1Wuf84-0004o3-E4 Frozen

Local host is routable (I hope):

root@server2:~# exim -bt localhost
LOG: MAIN
  remote host address is the local host: server2.danielblazek.cz (while routing <[email protected]>)
[email protected] cannot be resolved at this time: remote host address is the local host
root@server2:~# 

Configuration of hostname is right:

root@server2:~# hostname && hostname -f
server2
server2.mydomain.cz

Aliases seems to be OK:

root@server2:~# cat /etc/aliases 
# /etc/aliases
mailer-daemon: postmaster
postmaster: root
nobody: root
hostmaster: root
usenet: root
news: root
webmaster: root
www: root
ftp: root
abuse: root
noc: root
security: root
root: root
clamav: root

Do have any idea how can I fix it? With Postfix I never have problem like that. System emails always was delivered to /var/mail folder. But with exim4 I' m on the rocks. It's required for me receive system emails...

Please ask me if you need more information or outputs. Thank you for all replies!

Daniel


Solution

  • remote host address is the local host is an exim error message which indicates that the sender or recipient's domain has your machine's hostname/IP, but exim is not configured to accept mail for that domain.

    Exim has a standard domainlist named +local_domains that pretty much every different exim configuration system uses. See what domains are configured for your system by running:

    exim -bP '+local_domains'
    

    You will probably see a command that looks up a list of domains from a file. Put your hostname (in this case, it looks like it's an implicit hostname "localhost") in that file and exim should begin to work properly. Your test was slightly incorrect; you must pass the username you are delivering to, not the hostname:

    exim -bt root