Sorry, Viktor,

I was not clear in my intent.

This is for a guide that uses a number of interactive environment variables to build lots of conf files that are needed, it seems, for a mail server.

So the variables are long gone when the server is up and running. Thus for main.cf, I want to hard code the value of those variables into mydomain and myhostname. The eval with echo command is run through the guide to execute these postconf commands to have the desired main.cf. Rather than what I have seen in many other guides, where they supply a main.cf to replace the shipped main.cf. I learned here 4 years ago why that is a 'bad thing'.

But thanks for the insight.

On 03/09/2017 10:13 AM, Viktor Dukhovni wrote:
On Mar 9, 2017, at 9:54 AM, Robert Moskowitz <r...@htt-consult.com> wrote:

I have modified my guide by setting interactive variables in the beginning and 
then using them throughout, so that it is not necessary (or much less) to 
modify stuff.  I came up with:

eval $(echo "postconf -e 'mydomain = "$your_domain_tld"'")
eval $(echo "postconf -e 'myhostname = "$your_host_tld"'")

The variables your_domain_tld and your_host_tld are used a lot in this guide to 
customize conf files and such.

Might be a slicker way, but this works...
That's rather convoluted, what's wrong with:

  postconf -e "mydomain = $your_domain_tld"
  postconf -e "myhostname = $your_host_tld"

Or when doing both:

  postconf -e \
        "mydomain = $your_domain_tld" \
        "myhostname = $your_host_tld"

which takes considerably less time, because Postfix likes to
avoid reading "hot" configuration files that have been modified
less than two seconds ago and may be in an intermediate state.

So the configuration reader sleeps for 300ms and retries, waiting
for the file to "cool down".  Therefore, modifying paramaters one
at a time takes around 1.5 seconds per parameter.


Reply via email to