Hi Mauro, On Wed, Aug 03, 2016 at 09:11:58AM +0200, Mauro Salvini wrote: > > thanks for your bug report. Superb research, well done. > > thank you, it's my first bug report, glad to hear that is well done :-)
Keep up the good work! > > @ 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. Ok, that's the default behavior. > 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. Yes, that's also how it's intended to work. Maybe this setting is best for your setup. > > 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? > hostname by uname(): myhostname > hostname by gethostbyname(): myhostname.mydomain.local Hm. What does hostname --fqdn say? What does exim -bP | grep ^primary_hostname say? > > 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. and 192.168.0.10 is your local IP address on the network? I do have the trivial 127.0.1.1 myhostname.zugschlus.de myhostname line in my /etc/hosts and my exim does the right thing, like echo test | mail root getting correctly qualified to m...@myhostname.zugschlus.de and r...@myhostname.zugschlus.de. Is your "myhostname.mydomain.local" the literal host name? If so, are you actually using the .local TLD or is that just obfuscated? Please consider using a different TLD as .local may cause interference with avahi (the .local TLD is reserved for use with mDNS). > (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 used the wrong word. I just meant having the actual IP address in /etc/hosts instead of the 127.0.1.1 placeholder, but that's not the problem since things work fine on my local system. > - /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 "@" I do have the FQDN set in /etc/mailname. See https://wiki.debian.org/EtcMailName?highlight=%28mailname%29 for the current (sad) state of /etc/mailname and its documentation in Debian. Greetings Marc -- ----------------------------------------------------------------------------- Marc Haber | "I don't trust Computers. They | Mailadresse im Header Leimen, Germany | lose things." Winona Ryder | Fon: *49 6224 1600402 Nordisch by Nature | How to make an American Quilt | Fax: *49 6224 1600421