Dovecot using LDAP userdb: broken conf file /etc/dovecot/conf.d/auth-system.conf.ext, "args" appears in wrong section

Reproducing: Change the Webmin -> Servers -> "Dovecot IMAP/POP3 Server" -> "User and Login Options" -> "Data source for users, homes and IDs". Check "LDAP, using config file", enter the pre-edited file name "/etc/dovecot/conf.d/auth-ldap.conf.ext". Save, then "Apply Configuration", or "Start Dovecot server", if it was stopped

Observed:

Error message on a virtualmin GYI: "Failed to apply configuration : doveconf: Fatal: Error in configuration file /etc/dovecot/conf.d/auth-system.conf.ext line 74: Unknown setting: args"

Expected:

Configuration applied, and LDAP userdb data applied.

Problem case:

Changing the dovecot userdb to LDAP, giving the file name: /etc/dovecot/conf.d/auth-ldap.conf.ext (previously created and configured), got broken file /etc/dovecot/conf.d/auth-system.conf.ext, when applying dovecot server configuration.

The line "args = /etc/dovecot/conf.d/auth-ldap.conf.ext" appears in the wrong userdb section, which is commented out:

# Static settings generated from template <doc/wiki/UserDatabase.Static.txt>
#userdb {
  #driver = static
  # Can return anything a userdb could normally return. For example:
  #
  #  args = uid=500 gid=500 home=/var/mail/%u
  #
  # LDA and LMTP needs to look up users only from the userdb. This of course
  # doesn't work with static userdb because there is no list of users.
  # Normally static userdb handles this by doing a passdb lookup. This works
  # with most passdbs, with PAM being the most notable exception. If you do
  # the user verification another way, you can add allow_all_users=yes to
  # the args in which case the passdb lookup is skipped.
  #
  #args =
  args = /etc/dovecot/conf.d/auth-ldap.conf.ext
#}

Workaround:

manually edit the /etc/dovecot/conf.d/auth-system.conf.ext, moving the args under the correct section of userdb, where driver = LDAP.

Environment:

Operating system Debian Linux 9
Webmin version 1.860
Virtualmin version 6.01
Perl version 5.024001
Path to Perl /usr/bin/perl
BIND version 9.10
Postfix version 3.1.6
Mail injection command /usr/lib/sendmail -t
Apache version 2.4.25
PHP versions 7.0.19
Webalizer version 2.23-08
Logrotate version 3.11.0
MySQL version 10.1.26-MariaDB-0+deb9u1
SpamAssassin version 3.4.1
ClamAV version 0.99.2
Status: 
Active

Comments

Title: Dovecot using LDAP userdb: brocken conf file /etc/dovecot/conf.d/auth-system.conf.ext, "args" appears in wrong section » Dovecot using LDAP userdb: broken conf file /etc/dovecot/conf.d/auth-system.conf.ext, "args" appears in wrong section
Body: View changes

Sounds like Virtualmin is updating the Dovecot config incorrectly, possibly because of a change in format. Which Dovecot version are you running there?

Dovecot v2.2.27