Testing validity of Dovecot config in a script
m16+dovecot at monksofcool.net
Sat Nov 24 16:45:32 EET 2018
While trying to determine a given configuration is valid from within a
script, I found that the following works with Dovecot version 184.108.40.206:
doveconf -n >/dev/null || echo "Config is invalid"
However, the return code is not documented in the doveconf manual page,
and I wonder if the observed behaviour can be relied on? Is this the
recommended method to test configuration validity?
Personally, I'd like to have a dedicated call available. Something like
# Proposal: "-t" for "test config"
doveconf -t [-c config-file]
with documented return codes would be ideal.
More information about the dovecot