> On Apr 19, 2017, at 10:54 AM, 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.
Email may persist in the queue across movements of a host (say a laptop) between networks which may result in changes in the host's FQDN as DHCP servers assign different domains. It is important that bounces for a local sender are delivered to that local sender when delivery fails some time later. Therefore Postfix systems need a *stable* hostname, that does not randomly change as the machine moves from place to place. If you system does not have a stable public domain suffix, go with "localdomain", it is far better than a time-varying suffix. Otherwise, explicitly configure a stable public FQDN. Do not depend on `hostname -f`. Postfix needs to work even when your system is off the network, and the sender addresses of local users need to be stable. -- Viktor.