On 2017-04-19 17:54:32 (+0300), Marat Khalili <m...@rqc.ru> wrote:
I'm having trouble creating Postfix config (main.cf) without explicitly writing domain name in it. I'd like both myhostname and mydomain automatically set to output of `hostname -f` or contents of /etc/mailname. However, whatever combinations of myorigin, mydomain and myhostname I define, I either receive errors or values like `hostname`.localdomain. Is it impossible, or am I missing some working combination?
If `gethostname()` returns a FQDN it will be used as `$myhostname`. If it only returns a hostname, Postfix will append `localdomain`.
I'm using Postfix 3.1.0-3 under Ubuntu 16.04.
Linux systems often only configure their shortname with `sethostname()` (for reasons I've never understood). If you set a FQDN though, it will be returned with `gethostname()`.
Try to figure out where your particular flavour of Linux sets its hostname and teach it to set a FQDN instead of a shortname.
Philip -- Philip Paeps Senior Reality Engineer Ministry of Information