I finally got my new Dovecot 2.4 installation going to the point I can log in from Evolution, but for some reason it won't accept my password. Here are the pertinent sections from the dovecot.conf, 10-mail.conf, and dovecot-sql.conf.ext files:
dovecot.conf:
userdb sql { query = SELECT home, uid, gid FROM mailbox WHERE username = '%{user | username}' AND domain = '%{user | domain}' AND active= '1'
10-mail.conf:
mail_driver = maildir #mail_home = %{home} mail_home = /var/vmail/%{user | domain }/%{user | username } mail_path = ~/mail mail_inbox_path = /var/vmail/%{user | domain}/%{user | username } mailbox_list_utf8 = yes
namespace inbox { separator = / inbox = yes }
dovecot-sql.conf.ext:
driver = mysql connect = host=localhost dbname=postfixadmin user=postfixadmin password=hidden userdb_default_password_scheme = ARGON2I password_query = SELECT username AS username, password FROM mailbox WHERE username = '%{user | username }' AND active= '1' user_query = SELECT maildir, 2000 AS uid, 2000 AS gid FROM mailbox WHERE username = '%{user | username }' AND active= '1' iterate_query = SELECT username AS username FROM mailbox
I hope someone can explain my horrible mistake!
Ken
On 15. Feb 2025, at 0.06, Ken Wright via dovecot <dovecot@dovecot.org> wrote:
I finally got my new Dovecot 2.4 installation going to the point I can log in from Evolution, but for some reason it won't accept my password. Here are the pertinent sections from the dovecot.conf, 10-mail.conf, and dovecot-sql.conf.ext files:
dovecot.conf:
userdb sql { query = SELECT home, uid, gid FROM mailbox WHERE username = '%{user | username}' AND domain = '%{user | domain}' AND active= '1'
Here's where all your sql settings must go now.
dovecot-sql.conf.ext:
This file is not read at all.
driver = mysql connect = host=localhost dbname=postfixadmin user=postfixadmin password=hidden userdb_default_password_scheme = ARGON2I password_query = SELECT username AS username, password FROM mailbox WHERE username = '%{user | username }' AND active= '1' user_query = SELECT maildir, 2000 AS uid, 2000 AS gid FROM mailbox WHERE username = '%{user | username }' AND active= '1' iterate_query = SELECT username AS username FROM mailbox
These need to be converted to the new syntax.
On Sat, 2025-02-15 at 08:59 +0200, Timo Sirainen wrote:
On 15. Feb 2025, at 0.06, Ken Wright via dovecot <dovecot@dovecot.org> wrote:
driver = mysql connect = host=localhost dbname=postfixadmin user=postfixadmin password=hidden userdb_default_password_scheme = ARGON2I password_query = SELECT username AS username, password FROM mailbox WHERE username = '%{user | username }' AND active= '1' user_query = SELECT maildir, 2000 AS uid, 2000 AS gid FROM mailbox WHERE username = '%{user | username }' AND active= '1' iterate_query = SELECT username AS username FROM mailbox
These need to be converted to the new syntax.
Is this correct?
passdb sql { query = SELECT username AS username, domain, password FROM mailbox WHERE username = '%{user | username}' AND domain = '%{user | domain}' AND active= '1' } userdb sql { query = SELECT maildir, 2000 AS uid, 2000 AS gid FROM mailbox WHERE username = '%{user | username}' AND domain = '%{user | domain}' AND active= '1' # For using doveadm -A: iterate_query = SELECT username AS username, domain FROM mailbox
Ken
What "%{user | username}" means ? %user or %username ?
On 2025-02-15 23:39, Ken Wright via dovecot wrote:
On Sat, 2025-02-15 at 08:59 +0200, Timo Sirainen wrote: On 15. Feb 2025, at 0.06, Ken Wright via dovecot <dovecot@dovecot.org> wrote: driver = mysql connect = host=localhost dbname=postfixadmin user=postfixadmin password=hidden userdb_default_password_scheme = ARGON2I password_query = SELECT username AS username, password FROM mailbox WHERE username = '%{user | username }' AND active= '1' user_query = SELECT maildir, 2000 AS uid, 2000 AS gid FROM mailbox WHERE username = '%{user | username }' AND active= '1' iterate_query = SELECT username AS username FROM mailbox These need to be converted to the new syntax. Is this correct?
passdb sql { query = SELECT username AS username, domain, password FROM mailbox WHERE username = '%{user | username}' AND domain = '%{user | domain}' AND active= '1' } userdb sql { query = SELECT maildir, 2000 AS uid, 2000 AS gid FROM mailbox WHERE username = '%{user | username}' AND domain = '%{user | domain}' AND active= '1' # For using doveadm -A: iterate_query = SELECT username AS username, domain FROM mailbox
Ken
dovecot mailing list -- dovecot@dovecot.org To unsubscribe send an email to dovecot-leave@dovecot.org
On 15/02/2025 17:39 EET Ken Wright via dovecot <dovecot@dovecot.org> wrote:
On Sat, 2025-02-15 at 08:59 +0200, Timo Sirainen wrote:
On 15. Feb 2025, at 0.06, Ken Wright via dovecot <dovecot@dovecot.org> wrote:
driver = mysql connect = host=localhost dbname=postfixadmin user=postfixadmin password=hidden userdb_default_password_scheme = ARGON2I password_query = SELECT username AS username, password FROM mailbox WHERE username = '%{user | username }' AND active= '1' user_query = SELECT maildir, 2000 AS uid, 2000 AS gid FROM mailbox WHERE username = '%{user | username }' AND active= '1' iterate_query = SELECT username AS username FROM mailbox
These need to be converted to the new syntax.
Is this correct?
passdb sql { query = SELECT username AS username, domain, password FROM mailbox WHERE username = '%{user | username}' AND domain = '%{user | domain}' AND active= '1' } userdb sql { query = SELECT maildir, 2000 AS uid, 2000 AS gid FROM mailbox WHERE username = '%{user | username}' AND domain = '%{user | domain}' AND active= '1' # For using doveadm -A: iterate_query = SELECT username AS username, domain FROM mailbox
Like mentioned already on some thread, returning maildir is not right, check https://doc.dovecot.org/2.4.0/core/config/mailbox/mail_location.html and return mail_path instead.
Aki
On Sat, 2025-02-15 at 17:53 +0200, Aki Tuomi wrote:
On 15/02/2025 17:39 EET Ken Wright via dovecot <dovecot@dovecot.org> wrote:
On Sat, 2025-02-15 at 08:59 +0200, Timo Sirainen wrote:
On 15. Feb 2025, at 0.06, Ken Wright via dovecot <dovecot@dovecot.org> wrote:
These need to be converted to the new syntax.
Is this correct?
passdb sql { query = SELECT username AS username, domain, password FROM mailbox WHERE username = '%{user | username}' AND domain = '%{user | domain}' AND active= '1' } userdb sql { query = SELECT maildir, 2000 AS uid, 2000 AS gid FROM mailbox WHERE username = '%{user | username}' AND domain = '%{user | domain}' AND active= '1' # For using doveadm -A: iterate_query = SELECT username AS username, domain FROM mailbox
Like mentioned already on some thread, returning maildir is not right, check https://doc.dovecot.org/2.4.0/core/config/mailbox/mail_location.html and return mail_path instead.
Okay, I changed maildir to mail_path, but I still can't log in.
I'm sorry, but I think I need to see the fix spelled out. I'm an idiot.
Ken
On 15/02/2025 18:29 EET Ken Wright via dovecot <dovecot@dovecot.org> wrote: On Sat, 2025-02-15 at 17:53 +0200, Aki Tuomi wrote: On 15/02/2025 17:39 EET Ken Wright via dovecot <dovecot@dovecot.org> wrote: On Sat, 2025-02-15 at 08:59 +0200, Timo Sirainen wrote: On 15. Feb 2025, at 0.06, Ken Wright via dovecot <dovecot@dovecot.org> wrote: These need to be converted to the new syntax. Is this correct? passdb sql { query = SELECT username AS username, domain, password FROM mailbox WHERE username = '%{user | username}' AND domain = '%{user | domain}' AND active= '1' } userdb sql { query = SELECT maildir, 2000 AS uid, 2000 AS gid FROM mailbox WHERE username = '%{user | username}' AND domain = '% {user | domain}' AND active= '1' # For using doveadm -A: iterate_query = SELECT username AS username, domain FROM mailbox Like mentioned already on some thread, returning maildir is not right, check https://doc.dovecot.org/2.4.0/core/config/mailbox/ mail_location.html and return mail_path instead. Okay, I changed maildir to mail_path, but I still can't log in. I'm sorry, but I think I need to see the fix spelled out. I'm an idiot. Ken Did you check logs for details? If there is not much, try log_debug=category=auth mail_debug=yes Aki
On Sat, 2025-02-15 at 20:24 +0200, Aki Tuomi wrote:
On 15/02/2025 18:29 EET Ken Wright via dovecot <dovecot@dovecot.org> wrote:
On Sat, 2025-02-15 at 17:53 +0200, Aki Tuomi wrote:
On 15/02/2025 17:39 EET Ken Wright via dovecot
<dovecot@dovecot.org> wrote:
On Sat, 2025-02-15 at 08:59 +0200, Timo Sirainen wrote:
On 15. Feb 2025, at 0.06, Ken Wright via dovecot
<dovecot@dovecot.org> wrote:
These need to be converted to the new syntax.
Is this correct?
passdb sql {
query = SELECT username AS username, domain, password FROM
mailbox
WHERE username = '%{user | username}' AND domain = '%{user |
domain}'
AND active= '1'
}
userdb sql {
query = SELECT maildir, 2000 AS uid, 2000 AS gid FROM mailbox
WHERE
username = '%{user | username}' AND domain = '%{user | domain}' AND
active= '1'
# For using doveadm -A:
iterate_query = SELECT username AS username, domain FROM mailbox
Like mentioned already on some thread, returning maildir is not
right, check
https://doc.dovecot.org/2.4.0/core/config/mailbox/mail_location.html
and return mail_path instead.
Okay, I changed maildir to mail_path, but I still can't log in.
I'm sorry, but I think I need to see the fix spelled out. I'm an
idiot.
Ken
Did you check logs for details? If there is not much, try
log_debug=category=auth
mail_debug=yes
These two lines in /var/log/mail.log seem to be pertinent:
2025-02-15T16:33:29.976767-05:00 grace dovecot: auth: Error: mysql(localhost): Connect failed to database (): Access denied for user 'dovecot'@'localhost' (using password: NO) - waiting for 1 seconds before retry 2025-02-15T16:33:36.560826-05:00 grace dovecot: imap-login: Login aborted: Connection closed (auth failed, 1 attempts in 7 secs) (auth_failed): user=<wizard@koalatyworks.com>, method=PLAIN, rip=192.168.1.1, lip=192.168.1.10, TLS, session=<V2HRCjUu2ObAqAEB>
I don't understand why access is denied. I don't understand why it didn't use the password. Help!
Ken
" Access denied for user.. 'dovecot'@'localhost' "
Is a mysql error. mysql isn't allowing the user dovecot to open the database to run your SQL query. Until you can open the database, you aren't even retrieving the account password. That is where you should concentrate your efforts. I don't use mysql for authentication so I can't really tell you how to configure dovecot or mysql to make it work.
-----Original Message----- From: Ken Wright via dovecot <dovecot@dovecot.org> Sent: Saturday, February 15, 2025 4:41 PM To: Aki Tuomi <aki.tuomi@open-xchange.com>; Ken Wright via dovecot <dovecot@dovecot.org>; Timo Sirainen <timo@sirainen.com> Subject: Re: Userdb lookup problems
On Sat, 2025-02-15 at 20:24 +0200, Aki Tuomi wrote:
On 15/02/2025 18:29 EET Ken Wright via dovecot <dovecot@dovecot.org> wrote:
On Sat, 2025-02-15 at 17:53 +0200, Aki Tuomi wrote:
On 15/02/2025 17:39 EET Ken Wright via dovecot
<dovecot@dovecot.org> wrote:
On Sat, 2025-02-15 at 08:59 +0200, Timo Sirainen wrote:
On 15. Feb 2025, at 0.06, Ken Wright via dovecot
<dovecot@dovecot.org> wrote:
These need to be converted to the new syntax.
Is this correct?
passdb sql {
query = SELECT username AS username, domain, password FROM
mailbox
WHERE username = '%{user | username}' AND domain = '%{user |
domain}'
AND active= '1'
}
userdb sql {
query = SELECT maildir, 2000 AS uid, 2000 AS gid FROM mailbox
WHERE
username = '%{user | username}' AND domain = '%{user | domain}' AND
active= '1'
# For using doveadm -A:
iterate_query = SELECT username AS username, domain FROM mailbox
Like mentioned already on some thread, returning maildir is not
right, check
https://doc.dovecot.org/2.4.0/core/config/mailbox/mail_location.html
and return mail_path instead.
Okay, I changed maildir to mail_path, but I still can't log in.
I'm sorry, but I think I need to see the fix spelled out. I'm an
idiot.
Ken
Did you check logs for details? If there is not much, try
log_debug=category=auth
mail_debug=yes
These two lines in /var/log/mail.log seem to be pertinent:
2025-02-15T16:33:29.976767-05:00 grace dovecot: auth: Error: mysql(localhost): Connect failed to database (): Access denied for user 'dovecot'@'localhost' (using password: NO) - waiting for 1 seconds before retry 2025-02-15T16:33:36.560826-05:00 grace dovecot: imap-login: Login aborted: Connection closed (auth failed, 1 attempts in 7 secs) (auth_failed): user=<wizard@koalatyworks.com>, method=PLAIN, rip=192.168.1.1, lip=192.168.1.10, TLS, session=<V2HRCjUu2ObAqAEB>
I don't understand why access is denied. I don't understand why it didn't use the password. Help!
Ken
dovecot mailing list -- dovecot@dovecot.org To unsubscribe send an email to dovecot-leave@dovecot.org
Maybe a straightforward, spelled-out, concrete example of the full config (new mail_location, new sql syntax, new way to connect to the database server, etc..) would help all of us to navigate this extended complexity ?
Also, would be nice to clarify the ambiguity on the fields (user vs username, domain or user, etc..) with something much more specific
On 2025-02-16 07:31, Doug via dovecot wrote:
" Access denied for user.. 'dovecot'@'localhost' "
Is a mysql error. mysql isn't allowing the user dovecot to open the database to run your SQL query. Until you can open the database, you aren't even retrieving the account password. That is where you should concentrate your efforts. I don't use mysql for authentication so I can't really tell you how to configure dovecot or mysql to make it work.
-----Original Message----- From: Ken Wright via dovecot <dovecot@dovecot.org> Sent: Saturday, February 15, 2025 4:41 PM To: Aki Tuomi <aki.tuomi@open-xchange.com>; Ken Wright via dovecot <dovecot@dovecot.org>; Timo Sirainen <timo@sirainen.com> Subject: Re: Userdb lookup problems
On Sat, 2025-02-15 at 20:24 +0200, Aki Tuomi wrote:
On 15/02/2025 18:29 EET Ken Wright via dovecot <dovecot@dovecot.org> wrote:
On Sat, 2025-02-15 at 17:53 +0200, Aki Tuomi wrote:
On 15/02/2025 17:39 EET Ken Wright via dovecot
<dovecot@dovecot.org> wrote:
On Sat, 2025-02-15 at 08:59 +0200, Timo Sirainen wrote:
On 15. Feb 2025, at 0.06, Ken Wright via dovecot
<dovecot@dovecot.org> wrote:
These need to be converted to the new syntax.
Is this correct?
passdb sql {
query = SELECT username AS username, domain, password FROM
mailbox
WHERE username = '%{user | username}' AND domain = '%{user |
domain}'
AND active= '1'
}
userdb sql {
query = SELECT maildir, 2000 AS uid, 2000 AS gid FROM mailbox
WHERE
username = '%{user | username}' AND domain = '%{user | domain}' AND
active= '1'
# For using doveadm -A:
iterate_query = SELECT username AS username, domain FROM mailbox
Like mentioned already on some thread, returning maildir is not
right, check
https://doc.dovecot.org/2.4.0/core/config/mailbox/mail_location.html
and return mail_path instead.
Okay, I changed maildir to mail_path, but I still can't log in.
I'm sorry, but I think I need to see the fix spelled out. I'm an
idiot.
Ken
Did you check logs for details? If there is not much, try
log_debug=category=auth
mail_debug=yes These two lines in /var/log/mail.log seem to be pertinent:
2025-02-15T16:33:29.976767-05:00 grace dovecot: auth: Error: mysql(localhost): Connect failed to database (): Access denied for user 'dovecot'@'localhost' (using password: NO) - waiting for 1 seconds before retry 2025-02-15T16:33:36.560826-05:00 grace dovecot: imap-login: Login aborted: Connection closed (auth failed, 1 attempts in 7 secs) (auth_failed): user=<wizard@koalatyworks.com>, method=PLAIN, rip=192.168.1.1, lip=192.168.1.10, TLS, session=<V2HRCjUu2ObAqAEB>
I don't understand why access is denied. I don't understand why it didn't use the password. Help!
Ken
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
On Sat, 2025-02-15 at 18:31 -0500, Doug via dovecot wrote:
" Access denied for user.. 'dovecot'@'localhost' "
Is a mysql error. mysql isn't allowing the user dovecot to open the database to run your SQL query. Until you can open the database, you aren't even retrieving the account password. That is where you should concentrate your efforts. I don't use mysql for authentication so I can't really tell you how to configure dovecot or mysql to make it work.
This makes sense. What doesn't make sense (to me at least) is why Dovecot is trying to connect using the user 'dovecot' when I specified a different user in dovecot.conf. (Forgive me for not disclosing the actual user name.) Is there a setting for mysql user I need to correct? What is the correct syntax, anyway?
Ken
On 16. Feb 2025, at 6.33, Ken Wright via dovecot <dovecot@dovecot.org> wrote:
On Sat, 2025-02-15 at 18:31 -0500, Doug via dovecot wrote:
" Access denied for user.. 'dovecot'@'localhost' "
Is a mysql error. mysql isn't allowing the user dovecot to open the database to run your SQL query. Until you can open the database, you aren't even retrieving the account password. That is where you should concentrate your efforts. I don't use mysql for authentication so I can't really tell you how to configure dovecot or mysql to make it work.
This makes sense. What doesn't make sense (to me at least) is why Dovecot is trying to connect using the user 'dovecot' when I specified a different user in dovecot.conf. (Forgive me for not disclosing the actual user name.) Is there a setting for mysql user I need to correct? What is the correct syntax, anyway?
Maybe you're missing all the mysql settings?
mysql localhost { user = something password = something-else }
https://doc.dovecot.org/2.4.0/core/config/sql/mysql.html lists all the mysql settings.
Yeah, would be nice to have some examples in docs.
@Timo : You would just put a page with in 2 columns, left , the old default conf, right, the new default conf, that would be a million times helpful
On 2025-02-16 15:30, Timo Sirainen via dovecot wrote:
On 16. Feb 2025, at 6.33, Ken Wright via dovecot <dovecot@dovecot.org> wrote: On Sat, 2025-02-15 at 18:31 -0500, Doug via dovecot wrote: " Access denied for user.. 'dovecot'@'localhost' "
Is a mysql error. mysql isn't allowing the user dovecot to open the database to run your SQL query. Until you can open the database, you aren't even retrieving the account password. That is where you should concentrate your efforts. I don't use mysql for authentication so I can't really tell you how to configure dovecot or mysql to make it work. This makes sense. What doesn't make sense (to me at least) is why Dovecot is trying to connect using the user 'dovecot' when I specified a different user in dovecot.conf. (Forgive me for not disclosing the actual user name.) Is there a setting for mysql user I need to correct? What is the correct syntax, anyway?
Maybe you're missing all the mysql settings?
mysql localhost { user = something password = something-else }
https://doc.dovecot.org/2.4.0/core/config/sql/mysql.html lists all the mysql settings.
Yeah, would be nice to have some examples in docs.
dovecot mailing list -- dovecot@dovecot.org To unsubscribe send an email to dovecot-leave@dovecot.org
On 16. Feb 2025, at 10.37, Joan Moreau via dovecot <dovecot@dovecot.org> wrote:
@Timo : You would just put a page with in 2 columns, left , the old default conf, right, the new default conf, that would be a million times helpful
This is done for some settings, but for others there is no exact 1:1 mapping even possible because the configuration is entirely different. Docs could be of course improved a lot, and we're slowly improving improving them, but we've a lot of other work to do as well..
Anyway, Aki did a one-time conversion of the old example-config to v2.4: https://github.com/dovecot/tools/blob/main/dovecot-2.4.0-example-config.tar.... - I guess this could be also linked to in the upgrading docs.
Yes, that is helpful indeed.
Swimming in the pacific ocean here....
Related item : I have "iterate_query" to convert from the old setup to the new config as well. What to do with that ?
Thank you
On 2025-02-16 16:49, Timo Sirainen via dovecot wrote:
On 16. Feb 2025, at 10.37, Joan Moreau via dovecot <dovecot@dovecot.org> wrote:
@Timo : You would just put a page with in 2 columns, left , the old default conf, right, the new default conf, that would be a million times helpful
This is done for some settings, but for others there is no exact 1:1 mapping even possible because the configuration is entirely different. Docs could be of course improved a lot, and we're slowly improving improving them, but we've a lot of other work to do as well..
Anyway, Aki did a one-time conversion of the old example-config to v2.4: https://github.com/dovecot/tools/blob/main/dovecot-2.4.0-example-config.tar....
- I guess this could be also linked to in the upgrading docs.
dovecot mailing list -- dovecot@dovecot.org To unsubscribe send an email to dovecot-leave@dovecot.org
For the sake of simplicity and in the intent to be useful for others, here where I get with my config (using Sieve, FTS Xapian, LMTP, and mySQL user/passdb
Any corrections ?
dovecot_config_version = 2.4.0 dovecot_storage_version = 2.4.0
base_dir = /run/dovecot state_dir = /var/lib/dovecot default_login_user = dovecot
listen = * ::
verbose_proctitle = yes
mail_gid = mail mail_uid = mailusers mail_driver = mdbox mail_path = /data/mails/%{user | domain }/%{user | username }
mail_plugins = fts fts_xapian # mail_debug = yes # mail_cache_max_size = 128M
ssl_cert = </etc/letsencrypt/live/gjnet/fullchain.pem ssl_key = </etc/letsencrypt/live/gjnet/privkey.pem ssl_dh = </etc/mail/dovecot/dh.pem
mdbox_rotate_size = 64M
default_vsz_limit = 0
sendmail_path = /usr/sbin/sendmail
sql_driver = mysql
mysql localhost { user = services password = MYPASSWORD dbname = services }
plugin { plugin = fts_xapian managesieve sieve
fts = xapian
fts_xapian = verbose=0
fts_autoindex = yes
fts_enforced = yes
fts_autoindex_exclude = \Trash
fts_autoindex_exclude2 = \Drafts
# fts_decoder = decode2text
sieve = file:/data/mails/%{user | domain }/%{user | username
}/sieve/;active=/data/mails/%d/%n/sieve/default.sieve sieve_after = file:/data/mails/sieve/after.sieve sieve_default = file:/data/mails/sieve/before.sieve sieve_before = file:/data/mails/sieve/before.sieve sieve_global = file:/data/mails/sieve/ }
namespace inbox { inbox = yes
mailbox Trash {
auto = subscribe
special_use = \Trash
}
mailbox Drafts {
auto = subscribe
special_use = \Drafts
}
mailbox Sent {
auto = subscribe
special_use = \Sent
}
mailbox Spam {
auto = subscribe
special_use = \Junk
}
}
userdb sql { query = SELECT 1 from users where user like '%{user | username}' and domain like '%{user | domain}' and active=1 iterate_query = SELECT user AS username, domain FROM users where active=1 }
passdb sql { query = SELECT concat(user, '@', domain) AS user, password from users where user like '%{user | username}' and domain='%{user | domain}' and active=1 }
service auth { unix_listener auth-userdb { mode = 0600 user = mailusers } }
protocols = imap pop3 sieve lmtp
service imap-login { chroot = login service_count = 0 process_min_avail = 8 }
service indexer-worker { vsz_limit = 8G process_limit = 0 }
protocol imap { imap_client_workarounds = delay-newmail tb-extra-mailbox-sep imap_max_line_length = 655360 mail_max_userip_connections = 256 # mail_plugins = $mail_plugins imap_zlib }
service pop3-login { chroot = login service_count = 0 }
protocol pop3 { mail_max_userip_connections = 256 pop3_enable_last = yes pop3_lock_session = no pop3_logout_format = top=%t/%p, retr=%r/%b, del=%d/%m, size=%s pop3_reuse_xuidl = yes }
service lmtp {
inet_listener lmtp {
address = 127.0.0.1
port = 24
}
unix_listener lmtp {
mode = 0666
}
}
service managesieve-login { chroot = login
inet_listener sieve {
port = 4190
}
inet_listener sieveold {
port = 2000
}
service_count = 0
}
protocol sieve { managesieve_implementation_string = dovecot managesieve_logout_format = bytes ( in=%i : out=%o ) mail_max_userip_connections = 256 managesieve_max_line_length = 65536 }
protocol lmtp { mail_plugins = $mail_plugins sieve }
protocol lda { auth_socket_path = /run/dovecot/auth-userdb hostname = mx.grosjo.net mail_plugins = $mail_plugins sieve postmaster_address = admin@grosjo.net lda_mailbox_autocreate = yes lda_mailbox_autosubscribe = yes }
service stats {
unix_listener stats-writer {
mode = 0660
user = mailusers
}
}
#service decode2text { # executable = script /usr/libexec/dovecot/decode2text.sh # user = dovecot # unix_listener decode2text { # mode = 0666 # } #}
Thank you !
On 2025-02-16 17:02, Joan Moreau via dovecot wrote:
Yes, that is helpful indeed.
Swimming in the pacific ocean here....
Related item : I have "iterate_query" to convert from the old setup to the new config as well. What to do with that ?
Thank you
On 2025-02-16 16:49, Timo Sirainen via dovecot wrote:
On 16. Feb 2025, at 10.37, Joan Moreau via dovecot <dovecot@dovecot.org> wrote:
@Timo : You would just put a page with in 2 columns, left , the old default conf, right, the new default conf, that would be a million times helpful This is done for some settings, but for others there is no exact 1:1 mapping even possible because the configuration is entirely different. Docs could be of course improved a lot, and we're slowly improving improving them, but we've a lot of other work to do as well..
Anyway, Aki did a one-time conversion of the old example-config to v2.4: https://github.com/dovecot/tools/blob/main/dovecot-2.4.0-example-config.tar....
- I guess this could be also linked to in the upgrading docs.
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
Hi,
this part
ssl_cert = </etc/letsencrypt/live/gjnet/fullchain.pem ssl_key = </etc/letsencrypt/live/gjnet/privkey.pem ssl_dh = </etc/mail/dovecot/dh.pem
needs the < removed.
Regards Björn
On 16. Feb 2025, at 11.18, Joan Moreau via dovecot <dovecot@dovecot.org> wrote:
ssl_cert = </etc/letsencrypt/live/gjnet/fullchain.pem ssl_key = </etc/letsencrypt/live/gjnet/privkey.pem ssl_dh = </etc/mail/dovecot/dh.pem
ssl_server_* and no < here.
default_vsz_limit = 0
= unlimited
plugin {
There are no more plugin settings.
plugin = fts_xapian managesieve sieve fts = xapian fts_xapian = verbose=0
You need to convert this fts_xapian into individual settings. For example fts_xapian_verbose=0
fts_enforced = yes fts_autoindex_exclude = \Trash fts_autoindex_exclude2 = \Drafts
# fts_decoder = decode2text
Replacements for these are listed in the upgrading page.
sieve = file:/data/mails/%{user | domain }/%{user | username }/sieve/;active=/data/mails/%d/%n/sieve/default.sieve sieve_after = file:/data/mails/sieve/after.sieve sieve_default = file:/data/mails/sieve/before.sieve sieve_before = file:/data/mails/sieve/before.sieve sieve_global = file:/data/mails/sieve/
Looks like the sieve settings need to be added to the upgrading page. The configuration is very different anyway: https://doc.dovecot.org/2.4.0/core/plugins/sieve.html
userdb sql { query = SELECT 1 from users where user like '%{user | username}' and domain like '%{user | domain}' and active=1 iterate_query = SELECT user AS username, domain FROM users where active=1
Should be fine?
service imap-login { chroot = login service_count = 0
restart_request_count = unlimited
service indexer-worker { vsz_limit = 8G process_limit = 0
0 used to mean the same as default_process_limit. Now it's an error - just don't set it to keep the default.
protocol pop3 { mail_max_userip_connections = 256 pop3_enable_last = yes pop3_lock_session = no pop3_logout_format = top=%t/%p, retr=%r/%b, del=%d/%m, size=%s
The variables need updating.
protocol sieve { managesieve_implementation_string = dovecot managesieve_logout_format = bytes ( in=%i : out=%o )
Here too.
protocol lmtp { mail_plugins = $mail_plugins sieve
mail_plugins { sieve = yes }
Related item : I have "iterate_query" to convert from the old setup to the new config as well. What to do with that ?
Should be the same as before.
v2
dovecot_config_version = 2.4.0 dovecot_storage_version = 2.4.0
base_dir = /run/dovecot state_dir = /var/lib/dovecot default_login_user = dovecot
listen = * ::
verbose_proctitle = yes
mail_gid = mail mail_uid = mailusers mail_driver = mdbox mail_path = /data/mails/%{user | domain }/%{user | username }
mail_plugins { fts = yes fts_xapian = yes sieve = yes managesieve = yes }
# mail_debug = yes # mail_cache_max_size = 128M
ssl_server_cert = /etc/letsencrypt/live/gjnet/fullchain.pem ssl_server_key = /etc/letsencrypt/live/gjnet/privkey.pem ssl_server_dh = /etc/mail/dovecot/dh.pem
mdbox_rotate_size = 64M
default_vsz_limit = unlimited
sendmail_path = /usr/sbin/sendmail
sql_driver = mysql
mysql localhost { user = services password = MYPASSWORD dbname = services }
fts xapian { verbose = 0 }
fts_autoindex = yes fts_enforced = yes fts_decoder_driver = script fts_decoder_script_socket_path = decode2text
sieve_script default { path = /data/mails/sieve/default.sieve }
sieve_script before { path = /data/mails/sieve/after.sieve }
sieve_script after { path = /data/mails/sieve/after.sieve }
sieve_script personal { path = /data/mails/%{user | domain }/%{user | username }/sieve/default.sieve }
sieve_script global { path = /data/mails/sieve/ }
namespace inbox { inbox = yes
mailbox Trash {
auto = subscribe
special_use = \Trash
fts_autoindex = no
}
mailbox Drafts {
auto = subscribe
special_use = \Drafts
}
mailbox Sent {
auto = subscribe
special_use = \Sent
}
mailbox Spam {
auto = subscribe
special_use = \Junk
}
}
userdb sql { query = SELECT 1 from users where user like '%{user | username}' and domain like '%{user | domain}' and active=1 iterate_query = SELECT user AS username, domain FROM users where active=1 }
passdb sql { query = SELECT concat(user, '@', domain) AS user, password from users where user like '%{user | username}' and domain like '%{user | domain}' and active=1 }
service auth { unix_listener auth-userdb { mode = 0600 user = mailusers } }
protocols = imap pop3 sieve lmtp
service imap-login { chroot = login process_min_avail = 8 restart_request_count = unlimited }
service indexer-worker { vsz_limit = 8G process_limit = 4G }
protocol imap { imap_client_workarounds = delay-newmail tb-extra-mailbox-sep imap_max_line_length = 655360 mail_max_userip_connections = 256 # mail_plugins = $mail_plugins imap_zlib }
service pop3-login { chroot = login service_count = 0 }
protocol pop3 { mail_max_userip_connections = 256 pop3_enable_last = yes pop3_lock_session = no pop3_reuse_xuidl = yes }
service lmtp { mail_plugins { sieve = yes }
inet_listener lmtp {
address = 127.0.0.1
port = 24
}
unix_listener lmtp {
mode = 0666
}
}
service managesieve-login { chroot = login
inet_listener sieve {
port = 4190
}
inet_listener sieveold {
port = 2000
}
service_count = 0
}
protocol sieve { managesieve_implementation_string = dovecot mail_max_userip_connections = 256 managesieve_max_line_length = 65536 }
protocol lmtp { mail_plugins = $mail_plugins sieve }
protocol lda { auth_socket_path = /run/dovecot/auth-userdb hostname = mx.grosjo.net mail_plugins = $mail_plugins sieve postmaster_address = admin@grosjo.net lda_mailbox_autocreate = yes lda_mailbox_autosubscribe = yes
mail_plugins {
sieve = yes
}
}
service stats { unix_listener stats-writer { mode = 0660 user = mailusers } }
service decode2text { executable = script /usr/libexec/dovecot/decode2text.sh user = dovecot unix_listener decode2text { mode = 0666 } }
v3
dovecot_config_version = 2.4.0 dovecot_storage_version = 2.4.0
base_dir = /run/dovecot state_dir = /var/lib/dovecot default_login_user = dovecot
listen = * ::
verbose_proctitle = yes
mail_gid = mail mail_uid = mailusers mail_driver = mdbox mail_path = /data/mails/%{user | domain }/%{user | username }
mail_plugins { fts = yes fts_xapian = yes sieve = yes managesieve = yes }
# mail_debug = yes # mail_cache_max_size = 128M
ssl_server_cert = /etc/letsencrypt/live/gjnet/fullchain.pem ssl_server_key = /etc/letsencrypt/live/gjnet/privkey.pem ssl_server_dh = /etc/mail/dovecot/dh.pem
mdbox_rotate_size = 64M
default_vsz_limit = unlimited
sendmail_path = /usr/sbin/sendmail
sql_driver = mysql
mysql localhost { user = services password = MYPASSWORD dbname = services }
fts xapian { verbose = 0 }
fts_autoindex = yes fts_enforced = yes fts_decoder_driver = script fts_decoder_script_socket_path = decode2text
sieve_script default { path = /data/mails/sieve/default.sieve }
sieve_script before { path = /data/mails/sieve/after.sieve }
sieve_script after { path = /data/mails/sieve/after.sieve }
sieve_script personal { path = /data/mails/%{user | domain }/%{user | username }/sieve/default.sieve }
sieve_script global { path = /data/mails/sieve/ }
namespace inbox { inbox = yes
mailbox Trash {
auto = subscribe
special_use = \Trash
fts_autoindex = no
}
mailbox Drafts {
auto = subscribe
special_use = \Drafts
}
mailbox Sent {
auto = subscribe
special_use = \Sent
}
mailbox Spam {
auto = subscribe
special_use = \Junk
}
}
userdb sql { query = SELECT 1 from users where user like '%{user | username}' and domain like '%{user | domain}' and active=1 iterate_query = SELECT user AS username, domain FROM users where active=1 }
passdb sql { query = SELECT concat(user, '@', domain) AS user, password from users where user like '%{user | username}' and domain like '%{user | domain}' and active=1 }
service auth { unix_listener auth-userdb { mode = 0600 user = mailusers } }
protocols = imap pop3 sieve lmtp
service imap-login { chroot = login process_min_avail = 8 restart_request_count = unlimited }
service indexer-worker { vsz_limit = 4G }
protocol imap { imap_client_workarounds = delay-newmail tb-extra-mailbox-sep imap_max_line_length = 655360 mail_max_userip_connections = 256 }
service pop3-login { chroot = login service_count = 0 }
protocol pop3 { mail_max_userip_connections = 256 pop3_enable_last = yes pop3_lock_session = no pop3_reuse_xuidl = yes }
service lmtp { inet_listener lmtp { address = 127.0.0.1 port = 24 }
unix_listener lmtp {
mode = 0666
}
}
service managesieve-login { chroot = login
inet_listener sieve {
port = 4190
}
inet_listener sieveold {
port = 2000
}
service_count = 0
}
protocol sieve { managesieve_implementation_string = dovecot mail_max_userip_connections = 256 managesieve_max_line_length = 65536 }
protocol lmtp { mail_plugins { fts = yes fts_xapian = yes sieve = yes } }
protocol lda { auth_socket_path = /run/dovecot/auth-userdb hostname = mx.grosjo.net mail_plugins = $mail_plugins sieve postmaster_address = admin@grosjo.net lda_mailbox_autocreate = yes lda_mailbox_autosubscribe = yes
mail_plugins {
fts = yes
fts_xapian = yes
sieve = yes
}
}
service stats { unix_listener stats-writer { mode = 0660 user = mailusers } }
service decode2text { executable = script /usr/libexec/dovecot/decode2text.sh user = dovecot unix_listener decode2text { mode = 0666 } }
Dovecot now starts
I have a problem with the initial block
mail_plugins { fts = yes fts_xapian = yes sieve = yes managesieve = yes }
Basically, if I want to start dovecot, I need to remove that block, but then, managesieve is not working, fts neither, etc..
What is the correct setup ?
On 2025-02-16 18:17, Joan Moreau wrote:
v3
dovecot_config_version = 2.4.0 dovecot_storage_version = 2.4.0
base_dir = /run/dovecot state_dir = /var/lib/dovecot default_login_user = dovecot
listen = * ::
verbose_proctitle = yes
mail_gid = mail mail_uid = mailusers mail_driver = mdbox mail_path = /data/mails/%{user | domain }/%{user | username }
mail_plugins { fts = yes fts_xapian = yes sieve = yes managesieve = yes }
# mail_debug = yes # mail_cache_max_size = 128M
ssl_server_cert = /etc/letsencrypt/live/gjnet/fullchain.pem ssl_server_key = /etc/letsencrypt/live/gjnet/privkey.pem ssl_server_dh = /etc/mail/dovecot/dh.pem
mdbox_rotate_size = 64M
default_vsz_limit = unlimited
sendmail_path = /usr/sbin/sendmail
sql_driver = mysql
mysql localhost { user = services password = MYPASSWORD dbname = services }
fts xapian { verbose = 0 }
fts_autoindex = yes fts_enforced = yes fts_decoder_driver = script fts_decoder_script_socket_path = decode2text
sieve_script default { path = /data/mails/sieve/default.sieve }
sieve_script before { path = /data/mails/sieve/after.sieve }
sieve_script after { path = /data/mails/sieve/after.sieve }
sieve_script personal { path = /data/mails/%{user | domain }/%{user | username }/sieve/default.sieve }
sieve_script global { path = /data/mails/sieve/ }
namespace inbox { inbox = yes
mailbox Trash { auto = subscribe special_use = \Trash fts_autoindex = no }
mailbox Drafts { auto = subscribe special_use = \Drafts }
mailbox Sent { auto = subscribe special_use = \Sent }
mailbox Spam { auto = subscribe special_use = \Junk } }
userdb sql { query = SELECT 1 from users where user like '%{user | username}' and domain like '%{user | domain}' and active=1 iterate_query = SELECT user AS username, domain FROM users where active=1 }
passdb sql { query = SELECT concat(user, '@', domain) AS user, password from users where user like '%{user | username}' and domain like '%{user | domain}' and active=1 }
service auth { unix_listener auth-userdb { mode = 0600 user = mailusers } }
protocols = imap pop3 sieve lmtp
service imap-login { chroot = login process_min_avail = 8 restart_request_count = unlimited }
service indexer-worker { vsz_limit = 4G }
protocol imap { imap_client_workarounds = delay-newmail tb-extra-mailbox-sep imap_max_line_length = 655360 mail_max_userip_connections = 256 }
service pop3-login { chroot = login service_count = 0 }
protocol pop3 { mail_max_userip_connections = 256 pop3_enable_last = yes pop3_lock_session = no pop3_reuse_xuidl = yes }
service lmtp { inet_listener lmtp { address = 127.0.0.1 port = 24 }
unix_listener lmtp { mode = 0666 } }
service managesieve-login { chroot = login
inet_listener sieve { port = 4190 }
inet_listener sieveold { port = 2000 }
service_count = 0 }
protocol sieve { managesieve_implementation_string = dovecot mail_max_userip_connections = 256 managesieve_max_line_length = 65536 }
protocol lmtp { mail_plugins { fts = yes fts_xapian = yes sieve = yes } }
protocol lda { auth_socket_path = /run/dovecot/auth-userdb hostname = mx.grosjo.net mail_plugins = $mail_plugins sieve postmaster_address = admin@grosjo.net lda_mailbox_autocreate = yes lda_mailbox_autosubscribe = yes
mail_plugins { fts = yes fts_xapian = yes sieve = yes } }
service stats { unix_listener stats-writer { mode = 0660 user = mailusers } }
service decode2text { executable = script /usr/libexec/dovecot/decode2text.sh user = dovecot unix_listener decode2text { mode = 0666 } }
On 16. Feb 2025, at 13.20, Joan Moreau via dovecot <dovecot@dovecot.org> wrote:
Dovecot now starts
I have a problem with the initial block
mail_plugins { fts = yes fts_xapian = yes sieve = yes managesieve = yes }
You're doing more than just syntax changes here. There is no managesieve plugin. And sieve plugin shouldn't be globally enabled. Looking at your original config:
mail_plugins = fts fts_xapian protocol lmtp { mail_plugins = $mail_plugins sieve }
This translates into:
mail_plugins { fts = yes fts_xapian = yes } # although above could be just as well the same as before: mail_plugins = fts fts_xapian
protocol lmtp { mail_plugins { sieve = yes } }
Well,
I need xapian enable in LMTP (how to index incoming emails otherwise ?)
doing as below, I get : Feb 16 11:53:11 gjserver dovecot[2108456]: lmtp(jom@grosjo.net)<2108468><lGCQJqfRsWc0LCAA0thIag>: Error: duplicate db: User jom@grosjo.net doesn't have home dir set, disabling duplicate database
On 2025-02-16 19:52, Timo Sirainen wrote:
On 16. Feb 2025, at 13.20, Joan Moreau via dovecot <dovecot@dovecot.org> wrote:
Dovecot now starts
I have a problem with the initial block
mail_plugins { fts = yes fts_xapian = yes sieve = yes managesieve = yes }
You're doing more than just syntax changes here. There is no managesieve plugin. And sieve plugin shouldn't be globally enabled. Looking at your original config:
mail_plugins = fts fts_xapian protocol lmtp { mail_plugins = $mail_plugins sieve }
This translates into:
mail_plugins { fts = yes fts_xapian = yes } # although above could be just as well the same as before: mail_plugins = fts fts_xapian
protocol lmtp { mail_plugins { sieve = yes } }
On 16. Feb 2025, at 13.54, Joan Moreau <jom@grosjo.net> wrote:
Well,
- I need xapian enable in LMTP (how to index incoming emails otherwise ?)
It is enabled from the global mail_plugins. When using the mail_plugin { foo=yes } syntax it adds to the existing mail_plugins rather than replacing them.
- doing as below, I get : Feb 16 11:53:11 gjserver dovecot[2108456]: lmtp(jom@grosjo.net)<2108468><lGCQJqfRsWc0LCAA0thIag>: Error: duplicate db: User jom@grosjo.net doesn't have home dir set, disabling duplicate database
Where is your home directory supposed to be coming from? I don't see it in your config. Use either mail_home setting or return "home" extra field from userdb. This is the same as in v2.3, so I guess you dropped the home somehow when doing the conversion. Although this error isn't a fatal error, so maybe you had it before already?
Initially there is mail_location
Now, I have
mail_driver = mdbox mail_path = /data/mails/%{user | domain }/%{user | username }
I don't understand what is "mail_home" : What does it represent ?
On 2025-02-16 19:59, Timo Sirainen wrote:
On 16. Feb 2025, at 13.54, Joan Moreau <jom@grosjo.net> wrote:
Well,
- I need xapian enable in LMTP (how to index incoming emails otherwise ?)
It is enabled from the global mail_plugins. When using the mail_plugin { foo=yes } syntax it adds to the existing mail_plugins rather than replacing them.
- doing as below, I get : Feb 16 11:53:11 gjserver dovecot[2108456]: lmtp(jom@grosjo.net)<2108468><lGCQJqfRsWc0LCAA0thIag>: Error: duplicate db: User jom@grosjo.net doesn't have home dir set, disabling duplicate database
Where is your home directory supposed to be coming from? I don't see it in your config. Use either mail_home setting or return "home" extra field from userdb. This is the same as in v2.3, so I guess you dropped the home somehow when doing the conversion. Although this error isn't a fatal error, so maybe you had it before already?
On 16. Feb 2025, at 14.30, Joan Moreau via dovecot <dovecot@dovecot.org> wrote:
Initially there is mail_location
Now, I have
mail_driver = mdbox mail_path = /data/mails/%{user | domain }/%{user | username }
I don't understand what is "mail_home" : What does it represent ?
https://doc.dovecot.org/2.4.0/core/config/users/virtual.html#home-directorie...
This is the same as in v2.3.
I added
mail_home = /data/mails/%{user | domain }/%{user | username } (same as pail_path, really never used that, why 2 parameters for the same thing ???)
but still, sieve is not trigggered (everything arrives in INBOX, meaning my scripts are not executed
)
On 2025-02-16 20:44, Timo Sirainen wrote:
On 16. Feb 2025, at 14.30, Joan Moreau via dovecot <dovecot@dovecot.org> wrote:
Initially there is mail_location
Now, I have
mail_driver = mdbox mail_path = /data/mails/%{user | domain }/%{user | username }
I don't understand what is "mail_home" : What does it represent ?
https://doc.dovecot.org/2.4.0/core/config/users/virtual.html#home-directorie...
This is the same as in v2.3.
and anyway the full path of sieves script is specified
sieve_script personal { path = /data/mails/%{user | domain }/%{user | username }/sieve/default.sieve }
1 - Why "mail_home" is used by Sieve ? (as anyway, script are specified otherwise)
2 - why scripts are not run ?
On 2025-02-16 20:47, Joan Moreau wrote:
I added
mail_home = /data/mails/%{user | domain }/%{user | username } (same as pail_path, really never used that, why 2 parameters for the same thing ???)
but still, sieve is not trigggered (everything arrives in INBOX, meaning my scripts are not executed
)
On 2025-02-16 20:44, Timo Sirainen wrote: On 16. Feb 2025, at 14.30, Joan Moreau via dovecot <dovecot@dovecot.org> wrote:
Initially there is mail_location
Now, I have
mail_driver = mdbox mail_path = /data/mails/%{user | domain }/%{user | username }
I don't understand what is "mail_home" : What does it represent ?
https://doc.dovecot.org/2.4.0/core/config/users/virtual.html#home-directorie...
This is the same as in v2.3.
On 16. Feb 2025, at 14.52, Joan Moreau via dovecot <dovecot@dovecot.org> wrote:
and anyway the full path of sieves script is specified
sieve_script personal { path = /data/mails/%{user | domain }/%{user | username }/sieve/default.sieve }
This is different from what you used to have:
sieve = file:/data/mails/%{user | domain }/%{user | username }/sieve/;active=/data/mails/%d/%n/sieve/default.sieve sieve_after = file:/data/mails/sieve/after.sieve sieve_default = file:/data/mails/sieve/before.sieve sieve_before = file:/data/mails/sieve/before.sieve sieve_global = file:/data/mails/sieve/
This would translate to:
sieve_script personal { path = /data/mails/%{user | domain}/%{user | username}/sieve/ active_path = /data/mails/%{user | domain}/%{user | username }/sieve/default.sieve } sieve_script after { type = after path = /data/mails/sieve/after.sieve } sieve_script default { type = default path = /data/mails/sieve/before.sieve } sieve_script before { type = before path = /data/mails/sieve/before.sieve } sieve_script global { type = global path = /data/mails/sieve/ }
1 - Why "mail_home" is used by Sieve ? (as anyway, script are specified otherwise)
It's not. The error message was about duplicate database, which is outside Sieve. I guess you had it in v2.3 installation as well, if you didn't have a home directory.
2 - why scripts are not run ?
Try to enable debug logs (log_debug = category=debug) and see what debug logs say.
Thank you
For the mail_home, in what sense it is not the same as mail_path ? Can' t we just scrap one of them ?
On 2025-02-16 21:06, Timo Sirainen via dovecot wrote:
On 16. Feb 2025, at 14.52, Joan Moreau via dovecot <dovecot@dovecot.org> wrote:
and anyway the full path of sieves script is specified
sieve_script personal { path = /data/mails/%{user | domain }/%{user | username }/sieve/default.sieve }
This is different from what you used to have:
sieve = file:/data/mails/%{user | domain }/%{user | username }/sieve/;active=/data/mails/%d/%n/sieve/default.sieve sieve_after = file:/data/mails/sieve/after.sieve sieve_default = file:/data/mails/sieve/before.sieve sieve_before = file:/data/mails/sieve/before.sieve sieve_global = file:/data/mails/sieve/
This would translate to:
sieve_script personal { path = /data/mails/%{user | domain}/%{user | username}/sieve/ active_path = /data/mails/%{user | domain}/%{user | username }/sieve/default.sieve } sieve_script after { type = after path = /data/mails/sieve/after.sieve } sieve_script default { type = default path = /data/mails/sieve/before.sieve } sieve_script before { type = before path = /data/mails/sieve/before.sieve } sieve_script global { type = global path = /data/mails/sieve/ }
1 - Why "mail_home" is used by Sieve ? (as anyway, script are specified otherwise)
It's not. The error message was about duplicate database, which is outside Sieve. I guess you had it in v2.3 installation as well, if you didn't have a home directory.
2 - why scripts are not run ?
Try to enable debug logs (log_debug = category=debug) and see what debug logs say.
dovecot mailing list -- dovecot@dovecot.org To unsubscribe send an email to dovecot-leave@dovecot.org
If I remove the block and put sieve = yes in lmtp/lda, sieve rules are just not applied to incoming emails...
On 2025-02-16 19:20, Joan Moreau via dovecot wrote:
Dovecot now starts
I have a problem with the initial block
mail_plugins { fts = yes fts_xapian = yes sieve = yes managesieve = yes }
Basically, if I want to start dovecot, I need to remove that block, but then, managesieve is not working, fts neither, etc..
What is the correct setup ?
On 2025-02-16 18:17, Joan Moreau wrote:
v3
dovecot_config_version = 2.4.0 dovecot_storage_version = 2.4.0
base_dir = /run/dovecot state_dir = /var/lib/dovecot default_login_user = dovecot
listen = * ::
verbose_proctitle = yes
mail_gid = mail mail_uid = mailusers mail_driver = mdbox mail_path = /data/mails/%{user | domain }/%{user | username }
mail_plugins { fts = yes fts_xapian = yes sieve = yes managesieve = yes }
# mail_debug = yes # mail_cache_max_size = 128M
ssl_server_cert = /etc/letsencrypt/live/gjnet/fullchain.pem ssl_server_key = /etc/letsencrypt/live/gjnet/privkey.pem ssl_server_dh = /etc/mail/dovecot/dh.pem
mdbox_rotate_size = 64M
default_vsz_limit = unlimited
sendmail_path = /usr/sbin/sendmail
sql_driver = mysql
mysql localhost { user = services password = MYPASSWORD dbname = services }
fts xapian { verbose = 0 }
fts_autoindex = yes fts_enforced = yes fts_decoder_driver = script fts_decoder_script_socket_path = decode2text
sieve_script default { path = /data/mails/sieve/default.sieve }
sieve_script before { path = /data/mails/sieve/after.sieve }
sieve_script after { path = /data/mails/sieve/after.sieve }
sieve_script personal { path = /data/mails/%{user | domain }/%{user | username }/sieve/default.sieve }
sieve_script global { path = /data/mails/sieve/ }
namespace inbox { inbox = yes
mailbox Trash { auto = subscribe special_use = \Trash fts_autoindex = no }
mailbox Drafts { auto = subscribe special_use = \Drafts }
mailbox Sent { auto = subscribe special_use = \Sent }
mailbox Spam { auto = subscribe special_use = \Junk } }
userdb sql { query = SELECT 1 from users where user like '%{user | username}' and domain like '%{user | domain}' and active=1 iterate_query = SELECT user AS username, domain FROM users where active=1 }
passdb sql { query = SELECT concat(user, '@', domain) AS user, password from users where user like '%{user | username}' and domain like '%{user | domain}' and active=1 }
service auth { unix_listener auth-userdb { mode = 0600 user = mailusers } }
protocols = imap pop3 sieve lmtp
service imap-login { chroot = login process_min_avail = 8 restart_request_count = unlimited }
service indexer-worker { vsz_limit = 4G }
protocol imap { imap_client_workarounds = delay-newmail tb-extra-mailbox-sep imap_max_line_length = 655360 mail_max_userip_connections = 256 }
service pop3-login { chroot = login service_count = 0 }
protocol pop3 { mail_max_userip_connections = 256 pop3_enable_last = yes pop3_lock_session = no pop3_reuse_xuidl = yes }
service lmtp { inet_listener lmtp { address = 127.0.0.1 port = 24 }
unix_listener lmtp { mode = 0666 } }
service managesieve-login { chroot = login
inet_listener sieve { port = 4190 }
inet_listener sieveold { port = 2000 }
service_count = 0 }
protocol sieve { managesieve_implementation_string = dovecot mail_max_userip_connections = 256 managesieve_max_line_length = 65536 }
protocol lmtp { mail_plugins { fts = yes fts_xapian = yes sieve = yes } }
protocol lda { auth_socket_path = /run/dovecot/auth-userdb hostname = mx.grosjo.net mail_plugins = $mail_plugins sieve postmaster_address = admin@grosjo.net lda_mailbox_autocreate = yes lda_mailbox_autosubscribe = yes
mail_plugins { fts = yes fts_xapian = yes sieve = yes } }
service stats { unix_listener stats-writer { mode = 0660 user = mailusers } }
service decode2text { executable = script /usr/libexec/dovecot/decode2text.sh user = dovecot unix_listener decode2text { mode = 0666 } }
dovecot mailing list -- dovecot@dovecot.org To unsubscribe send an email to dovecot-leave@dovecot.org
On 16. Feb 2025, at 10.37, Joan Moreau via dovecot <dovecot@dovecot.org> wrote:
@Timo : You would just put a page with in 2 columns, left , the old default conf, right, the new default conf, that would be a million times helpful
I added some more settings and other upgrading help to: https://github.com/dovecot/documentation/pull/1175
I can add more improvements if people can give more details of what is missing. We've been doing the config rewrite for years already and left the documentation updates rather late, so there's no easy way now to find the list of all changed settings.
On Sun, 2025-02-16 at 09:30 +0200, Timo Sirainen wrote:
On 16. Feb 2025, at 6.33, Ken Wright via dovecot <dovecot@dovecot.org> wrote:
On Sat, 2025-02-15 at 18:31 -0500, Doug via dovecot wrote:
" Access denied for user.. 'dovecot'@'localhost' "
Is a mysql error. mysql isn't allowing the user dovecot to open the database to run your SQL query. Until you can open the database, you aren't even retrieving the account password. That is where you should concentrate your efforts. I don't use mysql for authentication so I can't really tell you how to configure dovecot or mysql to make it work.
This makes sense. What doesn't make sense (to me at least) is why Dovecot is trying to connect using the user 'dovecot' when I specified a different user in dovecot.conf. (Forgive me for not disclosing the actual user name.) Is there a setting for mysql user I need to correct? What is the correct syntax, anyway?
Maybe you're missing all the mysql settings?
mysql localhost { user = something password = something-else } Here are my sql settings: mysql localhost { user = something password = MYPASSWORD dbname = something } mail_uid = vmail mail_gid = vmail mail_driver = maildir mail_path = /var/vmail/%{user | domain }/%{user | username }/Maildir mail_inbox_path = /var/vmail/%{user | domain}/%{user | username } mailbox_list_utf8 = yes
passdb_default_password_scheme = ARGON2I
passdb sql { query = SELECT username AS username, domain, password FROM mailbox WHERE username = '%{user | username}' AND domain = '%{user | domain}' AND active= '1' } userdb sql { query = SELECT mail_path, uid, gid FROM mailbox WHERE username = '%{user | username}' AND domain = '%{user | domain}' AND active= '1' # For using doveadm -A: iterate_query = SELECT username AS username, domain FROM mailbox }
According to the logs, Dovecot isn't trying to connect using the user something, it's using the user dovecot. That's not the user for the database.
Ken
participants (6)
-
Aki Tuomi
-
Bjoern Franke
-
cdm567@yahoo.com
-
Joan Moreau
-
Ken Wright
-
Timo Sirainen