8

Is there a command that I can issue that will tell me if the current set of config files for dovecot are valid or if there's an issue?

I just made a change to my dovecot config files. Before attempting to restart the service, I just want to do a quick sanity check to confirm if I made a fat-finger mistake or not.

I'm looking for the dovecot equivalent of any of the following:

nginx -t
apachectl -t
postfix check

Please let me know if there is some way to check the validity of my dovecot configuration.

1 Answer 1

12

Use doveconf.

The below doveconf command will exit non-zero and output a message if there's an issue with your dovecot config

doveconf 1>/dev/null
echo $?

The above command will output only STDERR and the print the exit status of doveconf.

For example, the following output confirms that the dovecot config is OK.

root@host:~# doveconf 1>/dev/null
root@host:~# echo $?
0
root@host:~# 
1
  • alias doveconfchk='doveconf >/dev/null && echo OK' May 12, 2022 at 8:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .