> Hi, > > thanks for your bug report. Superb research, well done.
Hi, thank you, it's my first bug report, glad to hear that is well done :-) > @ expands to primary_hostname. Are you manualy setting this in your > configuration? No, i never set this variable in my configuration. /var/lib/exim4/config.autogenerated contains .ifdef MAIN_HARDCODE_PRIMARY_HOSTNAME primary_hostname = MAIN_HARDCODE_PRIMARY_HOSTNAME .endif and MAIN_HARDCODE_PRIMARY_HOSTNAME is never set. About this, if during dpkg-reconfigure exim4-config I set "Keep number of DNS queries minimal (Dial-on-Demand)" to yes, MAIN_HARDCODE_PRIMARY_HOSTNAME becomes defined as myhost.mydomain.local, and exim4 delivers mail in the right way. > If uname() returns a single-component name, Exim calls gethostbyname() > (or getipnodebyname() where available) in an attempt to acquire a > fully qualified host name. > > Can you check what your gethostbyname/getipnodebyname returns? I wrote this code snippet (getipnodebyname() is not available in my system): #include <stdio.h> #include <netdb.h> #include <sys/utsname.h> int main() { struct utsname buf; uname(&buf); printf("hostname by uname(): %s\n", buf.nodename); struct hostent *hent = gethostbyname(buf.nodename); printf("hostname by gethostbyname(): %s\n", hent->h_name); return 0; } It returns: hostname by uname(): myhostname hostname by gethostbyname(): myhostname.mydomain.local > I guess that there is something not right with your /etc/hosts which > misguides gethostbyname. I have never fully understood what to do with > /etc/hosts if one does not have a static IP address, and since all my > hosts do have static IP addresses, I have neve had a problem like that. > > For starters, I'd try to add an entry with your full host name for > the IP address your network interface actually has. I tried with a /etc/hosts like this: 127.0.0.1 localhost 192.168.0.10 myhostname.mydomain.local myhostname but behavior is the same. (by the way: static IP address means manually-assigned IP address only or also DHCP-assigned IP address that is always the same because is based on a static map on DHCP server?) I also tried "exim -bt -d+all username" on various scenarios: - /etc/mailname set with FQDN, "Other destinations for which mail is accepted" during dpkg-reconfigure set with FQDN, hostname set as myhostname, it states: 08:53:19 3350 local_part=username domain=myhostname.mydomain.local 08:53:19 3350 checking domains 08:53:19 3350 myhostname.mydomain.local in "@:localhost:myhostname.mydomain.local"? yes (matched "myhostname.mydomain.local") so it does not match "@" - /etc/mailname set with FQDN, "Other destinations for which mail is accepted" during dpkg-reconfigure leaved blank, hostname set as myhostname.mydomain.local, it states: 08:56:56 3363 local_part=username domain=myhostname.mydomain.local 08:56:56 3363 checking domains 08:56:56 3363 myhostname.mydomain.local in "@:localhost"? yes (matched "@") so it right matches "@". Thank you again, greetings Mauro