I mean... yes and no? Sure "all settings are global" (in scope) per the syntax doc, but some just can't be applied/make no sense outside of named filters/namespaces (what I'd consider a "scope" as an administrator).
Far as I've dealt with it, those settings only ever apply within the scope of a namespace with mailboxes anyways, so it's certainly a better place for it. I personally put them there because if I didn't, things exploded when doing doveconf -n as config test, though my setup is quite a bit more complicated, so other factors may be at play (if anything, I'd suspect the quota plugins, as those seem very opinionated about where their params are set). I did think for a second that it might be something that the passdb was returning, as that's the other context I've encountered this error in, but the query seems to not include that key... Maybe the authdb also needs to get updated to return "maildir" AS `mail_location` too... hard to say without actually understanding what data is in that field however. More than likely if this `maildir` is in the "old" format from authdb, it'll need to be split out into 4 fields on the colon delimiter it used to have. -- Thomas "Andy" Baugh | Software Development Engineer IV [email protected] http://www.webpros.com/ ________________________________________ From: Aki Tuomi <[email protected]> Sent: Monday, September 29, 2025 10:15 AM To: Andy Baugh <[email protected]>; Andy Baugh via dovecot <[email protected]>; [email protected] <[email protected]> Subject: Re: Dovecot 2.3 to 2.4 invalid Maildir settings [You don't often get email from [email protected]. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ] Hi! Actually those settings are valid outside namespace too. Not sure why you think they should be inside namespace? Aki > On 29/09/2025 17:52 EEST Andy Baugh via dovecot <[email protected]> wrote: > > > So, this message is pointing to the problem, it's just not obvious on first > glance as to why. mail_driver is only a valid configuration parameter *in the > scope of a namespace*. Both the error messages and docs do hint towards this, > but it takes a bit of dedication to figure out. > > In this case it means you need those params within your "namespace inbox" > config scope/block instead of in the global configuration. EX. > > namespace inbox { > mail_driver = maildir > mail_path = %{home}/Maildir > ... > } > > This is a bit frustrating, as it does represent a bit of behavior change; on > 2.3, "defaults" could effectively be set for all namespaces you setup due to > being able to set them in the global scope. On 2.4, this is no longer the > case for many parameters, though there are exceptions to this, which is part > of why it is frustrating to deal with. > > Cheers, > -- > Thomas "Andy" Baugh | Software Development Engineer IV > [email protected] > http://www.webpros.com/ > > ________________________________________ > From: User via dovecot <[email protected]> > Sent: Saturday, September 27, 2025 4:42 PM > To: [email protected] <[email protected]> > Subject: Dovecot 2.3 to 2.4 invalid Maildir settings > > Greetings, > > I am unable to completely migrate my Dovecot 2.3 config to 2.4.1 as I'm > unable to get past the following error: > > Error: Namespace inbox: maildir: maildir settings: Failed to parse > configuration: Failed to override configuration from userdb: Invalid > maildir=${domain}/${user}/: Setting is a named filter, use 'maildir {' > > I found a similar encounter at > https://www.mail-archive.com/[email protected]/msg90843.html that > points to > https://doc.dovecot.org/2.4.0/core/config/mailbox/mail_location.html#per-user-mail-locations > yet I still can't get my config to work. I've attached my doveconf at > the end, including the ported 2.3 settings that used to work for me > (commented out). > > I would appreciate any advise. > > # /etc/dovecot/dovecot.conf > dovecot_config_version = 2.4.1 > dovecot_storage_version = 2.4.1 > > sql_driver = mysql > mysql /run/mysqld/mysqld.sock { > user = mail > password = mail > dbname = mail > } > passdb sql { > query = SELECT username AS user, \ > password FROM mailbox WHERE username = '%{user}' AND active='1' > default_password_scheme = ARGON2I > } > userdb sql { > query = SELECT maildir, \ > 600 AS uid, \ > 600 AS gid \ > FROM mailbox WHERE username = '%{user}' AND active='1' > iterate_query = SELECT username AS user FROM mailbox > } > # previously: > # passdb { > # driver = sql > # args = /etc/dovecot/dovecot-sql.conf.ext > # } > # userdb { > # driver = sql > # args = /etc/dovecot/dovecot-sql.conf.ext > # } > > # disable_plaintext_auth = yes > auth_username_format = %{user | lower} # previously: > "auth_username_format = %Lu" > auth_mechanisms = plain login > auth_default_domain = mail.com # previously: "auth_default_realm = > mail.com" > auth_debug = yes > auth_debug_passwords = yes > > mail_privileged_group = mail > # previously: "mail_location = maildir:~/Maildir" > mail_driver = maildir > mail_path = %{home}/Maildir > mail_home = /var/vmail/%{user | domain}/%{user | username} # previously: > "mail_home = /var/vmail/%d/%n/" > > service lmtp { > unix_listener /var/spool/postfix/private/dovecot-lmtp { > mode = 0600 > user = postfix > group = postfix > } > } > service auth { > unix_listener /var/spool/postfix/private/auth { > mode = 0660 > user = postfix > group = postfix > } > } > service stats { > unix_listener stats-reader { > user = nginx > group = nginx > mode = 0660 > } > unix_listener stats-writer { > user = nginx > group = nginx > mode = 0660 > } > } > > ssl = required > ssl_min_protocol = TLSv1.2 > ssl_server_prefer_ciphers = server # previously: > "ssl_prefer_server_ciphers = yes" > ssl_server { > dh_file = /etc/ssl/dovecot/dh.pem > cert_file = /etc/ssl/dovecot/tls.pem > key_file = /etc/ssl/dovecot/tls.key > } > # previously: > # ssl_dh = </etc/ssl/dovecot/dh.pem > # ssl_cert = </etc/ssl/dovecot/tls.pem > # ssl_key = </etc/ssl/dovecot/tls.key > > namespace inbox { > inbox = yes > mailbox Archive { > auto = subscribe > special_use = \Archive > } > mailbox Drafts { > auto = subscribe > special_use = \Drafts > } > mailbox Junk { > auto = subscribe > special_use = \Junk > } > mailbox Trash { > auto = subscribe > special_use = \Trash > } > mailbox Sent { > auto = subscribe > special_use = \Sent > } > mailbox "Sent Messages" { > special_use = \Sent > } > } > > protocols = imap lmtp > > # previously: /etc/dovecot/dovecot-sql.conf.ext > driver = mysql > connect = host=localhost dbname=mail user=mail password=mail > default_pass_scheme = ARGON2I > password_query = SELECT username AS user,password FROM mailbox WHERE > username = '%u' AND active='1' > user_query = SELECT maildir, 600 AS uid, 600 AS gid FROM mailbox WHERE > username = '%u' AND active='1' > iterate_query = SELECT username AS user FROM mailbox > _______________________________________________ > dovecot mailing list -- [email protected] > To unsubscribe send an email to [email protected] > _______________________________________________ > dovecot mailing list -- [email protected] > To unsubscribe send an email to [email protected] _______________________________________________ dovecot mailing list -- [email protected] To unsubscribe send an email to [email protected]
