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/dovecot@dovecot.org/msg90843.html that points to https://doc.dovecot.org/2.4.0/core/config/mailbox/mail_location.html#per-use... 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
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 andy.baugh@webpros.com http://www.webpros.com/
From: User via dovecot <dovecot@dovecot.org> Sent: Saturday, September 27, 2025 4:42 PM To: dovecot@dovecot.org <dovecot@dovecot.org> 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/dovecot@dovecot.org/msg90843.html that points to https://doc.dovecot.org/2.4.0/core/config/mailbox/mail_location.html#per-use... 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 -- dovecot@dovecot.org To unsubscribe send an email to dovecot-leave@dovecot.org
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 <dovecot@dovecot.org> 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 andy.baugh@webpros.com http://www.webpros.com/
From: User via dovecot <dovecot@dovecot.org> Sent: Saturday, September 27, 2025 4:42 PM To: dovecot@dovecot.org <dovecot@dovecot.org> 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/dovecot@dovecot.org/msg90843.html that points to https://doc.dovecot.org/2.4.0/core/config/mailbox/mail_location.html#per-use... 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 -- dovecot@dovecot.org To unsubscribe send an email to dovecot-leave@dovecot.org
dovecot mailing list -- dovecot@dovecot.org To unsubscribe send an email to dovecot-leave@dovecot.org
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 andy.baugh@webpros.com http://www.webpros.com/
From: Aki Tuomi <aki.tuomi@open-xchange.com> Sent: Monday, September 29, 2025 10:15 AM To: Andy Baugh <andy.baugh@webpros.com>; Andy Baugh via dovecot <dovecot@dovecot.org>; user@wdas.io <user@wdas.io> Subject: Re: Dovecot 2.3 to 2.4 invalid Maildir settings
[You don't often get email from aki.tuomi@open-xchange.com. 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 <dovecot@dovecot.org> 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 andy.baugh@webpros.com http://www.webpros.com/
From: User via dovecot <dovecot@dovecot.org> Sent: Saturday, September 27, 2025 4:42 PM To: dovecot@dovecot.org <dovecot@dovecot.org> 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/dovecot@dovecot.org/msg90843.html that points to https://doc.dovecot.org/2.4.0/core/config/mailbox/mail_location.html#per-use... 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 -- dovecot@dovecot.org To unsubscribe send an email to dovecot-leave@dovecot.org
dovecot mailing list -- dovecot@dovecot.org To unsubscribe send an email to dovecot-leave@dovecot.org
Thanks for getting back to me.
@Andy I have indeed tried placing the params inside the inbox namespace as well to no avail. The error hadn't changed.
What did work was switching the userdb query from "maildir" to
"mail_path" as Aki alluded to in the previous thread I linked:
userdb sql {
query = SELECT '~/Maildir' AS mail_path,
...
}
However, what's odd is that I did try "mail_path" in a much earlier attempt and it didn't work then so I thought Aki was alluding to something else entirely and I wrote it off right away. It was almost through luck that I decided to give it another try, and for some reason it just worked this time around.
On 2025-09-29 15:58, Andy Baugh wrote:
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 thismaildir
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 andy.baugh@webpros.com http://www.webpros.com/
From: Aki Tuomi <aki.tuomi@open-xchange.com> Sent: Monday, September 29, 2025 10:15 AM To: Andy Baugh <andy.baugh@webpros.com>; Andy Baugh via dovecot <dovecot@dovecot.org>; user@wdas.io <user@wdas.io> Subject: Re: Dovecot 2.3 to 2.4 invalid Maildir settings
[You don't often get email from aki.tuomi@open-xchange.com. 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 <dovecot@dovecot.org> 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 andy.baugh@webpros.com http://www.webpros.com/
From: User via dovecot <dovecot@dovecot.org> Sent: Saturday, September 27, 2025 4:42 PM To: dovecot@dovecot.org <dovecot@dovecot.org> 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/dovecot@dovecot.org/msg90843.html that points to https://doc.dovecot.org/2.4.0/core/config/mailbox/mail_location.html#per-use... 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 -- dovecot@dovecot.org To unsubscribe send an email to dovecot-leave@dovecot.org
dovecot mailing list -- dovecot@dovecot.org To unsubscribe send an email to dovecot-leave@dovecot.org
User via dovecot said on Tue, 30 Sep 2025 21:54:15 +0000
However, what's odd is that I did try "mail_path" in a much earlier attempt and it didn't work then so I thought Aki was alluding to something else entirely and I wrote it off right away. It was almost through luck that I decided to give it another try, and for some reason it just worked this time around.
Has the new, working setup survived a reboot yet?
SteveT
Steve Litt
"User" == User via dovecot <dovecot@dovecot.org> writes:
Thanks for getting back to me. @Andy I have indeed tried placing the params inside the inbox namespace as well to no avail. The error hadn't changed.
What did work was switching the userdb query from "maildir" to "mail_path" as Aki alluded to in the previous thread I linked: userdb sql { query = SELECT '~/Maildir' AS mail_path,
... }
However, what's odd is that I did try "mail_path" in a much earlier attempt and it didn't work then so I thought Aki was alluding to something else entirely and I wrote it off right away. It was almost through luck that I decided to give it another try, and for some reason it just worked this time around.
Would it be possible for people who make these transitions to post their before and after configs? That might help others who have held off migrating until 2.4.2 for now. :-)
On 29/09/2025 18:58 EEST Andy Baugh via dovecot <dovecot@dovecot.org> wrote:
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).
This is true. But they can be set outside namespace context, and they'll still get applied there.
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).
This is of course personal preference, but not a strict requirement and does not need to be done for things to work.
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 thismaildir
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.
In 2.4 there is no "mail_location" setting in passdb or outside passdb, you can return mail_path instead.
-- Thomas "Andy" Baugh | Software Development Engineer IV andy.baugh@webpros.com http://www.webpros.com/
Aki
participants (5)
-
Aki Tuomi
-
Andy Baugh
-
John Stoffel
-
Steve Litt
-
User