On Wed, Feb 10, 2021 at 05:31:47PM +0100, Matus UHLAR - fantomas wrote: > > > Dnia 10.02.2021 o godz. 15:10:09 Chris Green pisze: > > > > > > > > These systems are all systemd'ed so I can't just run postfix as above. > > > > However will 'postconf "myhostname = $(dnsdomainname)"' actually > > > > change/set the myhostname value in main.cf? If so then simply putting > > > > the postconf command in /etc/rc.local will do all I need, especially > > > > after one reboot. > > > On Wed, Feb 10, 2021 at 04:40:13PM +0100, Jaroslaw Rafa wrote: > > > Are these machines moved from domain to domain? Ie. is it possible that > > > "dnsdomainname" will change, or is it the same all the time? If the > > > latter, > > > I don't see why do you need to set it at each reboot - it is enough to set > > > it once. So I would try to set it in a script that deploys/copies Postfix > > > configuration to the target machine. > > On 10.02.21 15:55, Chris Green wrote: > > I could just edit the value in each system, but then all the main.cf > > files would be different. > > setting "myhostname = $(dnsdomainname)" what Wietse recommended would not. > Yes, but since I'd have to add something to each rc.local (and they're mostly default, i.e. as installed) it's more stuff to keep maintained.
> Setting FQDN hostname or maybe setting own IP with FQDN in /etc/hosts would > not (I'm not sure whether te latter one would be enough, you can try) > Yes, I've tried these. I added the FQDN to /etc/hosts such that dnsdomainname returns the domain but postfix doesn't use that. I've also tried setting 'hostname <FQDN>' and that hasn't helped either. > I was in your situation some years ago, when I maintained the same configs > for multiple apps on multiple servers. I maintained /etc/hosts and > hostnames per-machine and most of the rest was the same. > So I have the FQDN everywhere:- chris@isbdGandi$ hostname isbdGandi.isbd.uk chris@isbdGandi$ more /etc/hosts # The following lines are desirable for IPv4 capable hosts 127.0.0.1 isbdGandi.isbd.uk isbdGandi isbd localhost ... ... chris@isbdGandi$ dnsdomainname isbd.uk chris@isbdGandi$ ... and now postfix sends cron mail *to* ch...@isbd.uk as well as from ch...@isbd.uk which doesn't help at all! I have an entry for chris in /etc/aliases:- chris:ch...@isbd.co.uk but this doesn't seem to have worked. What am I doing wrong now? (I have run 'newaliases'). -- Chris Green