On Wed, Feb 10, 2021 at 03:03:47PM +0100, ludic...@gmail.com wrote: > > Von: owner-postfix-us...@postfix.org <owner-postfix-us...@postfix.org> Im > > Auftrag von Chris Green > > Gesendet: Mittwoch, 10. Februar 2021 14:57 > > An: postfix-users@postfix.org > > Betreff: Can I get postfix to use what's returned by dnsdomainname for > > mydomain? > > > > It would be really handy if I could get postfix to use the value returned by > > the dnsdomainname command for its mydomain value as I could then use the > > same main.cf file in several headless 'send only' > > systems where postfix is used solely for sending error messages from cron > > and similar. > > > > There isn't an 'include' type directive in postfix configuration so I can't > > see any way of doing this by capturing the output of dnsdomainname at > > startup and then including this in main.cf. > > > > Has anyone else wanted to do anything like this and come up with a solution? > > Can't this be simply done by bash/cron? > > Execute dnsdomainname > Alter main.cf > postfix reload > > Not sure about startup / system boot. > > Just my first thoughts. > Yes, I *could* do something like this but it's quite a bit of added complexity for what is really quite a simple requirement. I'd have to add a bit of code to run from (say) /etc/rc.local which would have to run sed or something similar against the main.cf file.
-- Chris Green