Score:2

How to check if dovecot's configuration is valid? (config file syntax)

cn flag

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.

Score:7
cn flag

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:~# 
cn flag
`alias doveconfchk='doveconf >/dev/null && echo OK'`
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.