Change location where .dovecot.lda-dupes* file/dir are created
Hello,
I'm using Dovecot 2.3.19.1 and Pigeonhole 0.5.19 on Debian 12.1 and I'm trying to use sieve extensions vacation and redirect but I'm having issues because of the creation of file /home/USER/.dovecot.lda-dupes and dir /home/USER/.dovecot.lda-dupes.locks
The error in logs is pretty clear, lda doesn't have perms to create any of them because /home/USER/ is owned by root # namei -mo /home/user2/ f: /home/user2/ drwxr-xr-x root root / drwxr-xr-x root root home drwxr-xr-x root root user2
I'm using Hestia Control Panel and it chroot the users and that is the reason the user's home is owned by root. Mail users are virtual and the maildir home is /home/user2/mail/domain2.tld/postmaster (%h/mail/%d/%n) but the .dovecot.lda-dupes* file and dir are trying to use /home/user2/ instead of /home/user2/mail/domain2.tld/postmaster/ where they have perms and that should solve the issue.
So, the question, is there any way to create .dovecot.lda-dupes* file/dir in virtual user's home %h/mail/%d/%n instead of user's home %h? or, is there any other solution/workaround where I don't need to change /home/USER/ owner/perms?
If you want to check them, below are the logs and my dovecot conf.
Appreciate your support.
Best regards, sahsanu
This is the sieve log using vacation extension: sieve: info: started log at 2023-09-21 13:17:06 +0200. error: msgid=102288b1348f270d83363f71bb7bcc81@example.com: vacation action: failed to check for duplicate vacation response: internal error occurred: refer to server log for more information. [2023-09-21 13:17:06].
This is the dovecot log using sieve vacation extension: Sep 21 13:17:06 lda(postmaster@domain2.tld)<2711250><SHdgDzImDGXSXikAElSLcQ>: Error: duplicate db: transaction: file_dotlock_open(/home/user2/.dovecot.lda-dupes) failed: Permission denied Sep 21 13:17:06 lda(postmaster@domain2.tld)<2711250><SHdgDzImDGXSXikAElSLcQ>: Error: duplicate db: transaction: Failed to lock /home/user2/.dovecot.lda-dupes.locks/duplicate.lock.ea887f77f1f61464f902ada5e7bfb022: mkdir_parents(/home/user2/.dovecot.lda-dupes.locks) failed: Permission denied
This is the sieve log using redirect extension: sieve: info: started log at 2023-09-21 16:51:46 +0200. error: msgid=8f1cdb9c-0997-4e32-a28f-65e5f3f8dca6.maildroid@localhost: redirect action: failed to check for duplicate forward: internal error occurred: refer to server log for more information. [2023-09-21 16:51:46].
This is the dovecot log using sieve redirect extension: Sep 21 16:51:46 lda(postmaster@domain2.tld)<2785960><03j9DoJYDGWogioAElSLcQ>: Error: duplicate db: transaction: file_dotlock_open(/home/user2/.dovecot.lda-dupes) failed: Permission denied Sep 21 16:51:46 lda(postmaster@domain2.tld)<2785960><03j9DoJYDGWogioAElSLcQ>: Error: duplicate db: transaction: Failed to lock /home/user2/.dovecot.lda-dupes.locks/duplicate.lock.291440db1d5e4457ecf50cd02882634b: mkdir_parents(/home/user2/.dovecot.lda-dupes.locks) failed: Permission denied
Dovecot conf: # 2.3.19.1 (9b53102964): /etc/dovecot/dovecot.conf # Pigeonhole version 0.5.19 (4eae2f79) # OS: Linux 6.1.0-12-amd64 x86_64 Debian 12.1 # Hostname: server.domain1.tld auth_mechanisms = plain login auth_verbose = yes base_dir = /run/dovecot/ log_path = /var/log/dovecot.log login_greeting = Mail Delivery Agent mail_access_groups = mail mail_attribute_dict = file:%h/mail/%d/%n/dovecot-attributes mail_location = maildir:%h/mail/%d/%n mail_privileged_group = mail managesieve_notify_capability = mailto managesieve_sieve_capability = fileinto reject envelope encoded-character vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy include variables body enotify environment mailbox date index ihave duplicate mime foreverypart extracttext imapflags notify imapsieve vnd.dovecot.imapsieve namespace { inbox = yes list = yes location = mailbox Archive { auto = subscribe special_use = \Archive } mailbox "Deleted Messages" { auto = no special_use = \Trash } mailbox Drafts { auto = subscribe special_use = \Drafts } mailbox Junk { auto = no special_use = \Junk } mailbox Sent { auto = subscribe special_use = \Sent } mailbox "Sent Mail" { auto = no special_use = \Sent } mailbox "Sent Messages" { auto = no special_use = \Sent } mailbox Spam { auto = subscribe special_use = \Junk } mailbox Trash { auto = subscribe special_use = \Trash } prefix = separator = / type = private } passdb { args = scheme=MD5-CRYPT username_format=%n /etc/exim4/domains/%d/passwd driver = passwd-file } plugin { imapsieve_mailbox1_before = file:/var/mail/sieve/report_spam.sieve imapsieve_mailbox1_causes = COPY APPEND imapsieve_mailbox1_name = Spam imapsieve_mailbox2_before = file:/var/mail/sieve/report_ham.sieve imapsieve_mailbox2_causes = COPY imapsieve_mailbox2_from = Spam imapsieve_mailbox2_name = * imapsieve_url = sieve://127.0.0.1:4190 quota = maildir:User quota sieve = file:~/mail/%d/%n/sieve;active=~/mail/%d/%n/dovecot.sieve sieve_extensions = +notify +imapflags sieve_global_extensions = +vnd.dovecot.pipe +vnd.dovecot.environment sieve_pipe_bin_dir = /etc/dovecot/sieve sieve_plugins = sieve_imapsieve sieve_extprograms sieve_vacation_send_from_recipient = yes } protocols = imap sieve service auth { extra_groups = mail unix_listener auth-client { group = mail mode = 0660 user = dovecot } unix_listener auth-master { group = mail mode = 0660 user = dovecot } user = dovecot } service managesieve-login { inet_listener sieve { port = 4190 } } service stats { unix_listener stats-writer { group = mail mode = 0660 user = dovecot } } ssl_cert =
On 22/09/2023 12:27 EEST sahsanu via dovecot dovecot@dovecot.org wrote:
Hello,
I'm using Dovecot 2.3.19.1 and Pigeonhole 0.5.19 on Debian 12.1 and I'm trying to use sieve extensions vacation and redirect but I'm having issues because of the creation of file /home/USER/.dovecot.lda-dupes and dir /home/USER/.dovecot.lda-dupes.locks
The error in logs is pretty clear, lda doesn't have perms to create any of them because /home/USER/ is owned by root # namei -mo /home/user2/ f: /home/user2/ drwxr-xr-x root root / drwxr-xr-x root root home drwxr-xr-x root root user2
Dovecot expects mail user's home to be writable. If your home is not writable by the user, you need to set mail_home=~/mail/ or something and make that directory writable to dovecot, e.g. with chown.
Aki
Dovecot expects mail user's home to be writable. If your home is not writable by the user, you need to set mail_home=~/mail/ or something and make that directory writable to dovecot, e.g. with chown.
Aki
Hello Aki,
I tried to change mail_home to several options (I've restarted dovecot after each test):
mail_home = %h/mail/%d/%n mail_home = ~/mail/%d/%n
I've even created a new dir (/dupes/) with 777 perms
mail_home = /dupes/
But I'm still viewing in the logs that it is trying to use /home/USER/
Sep 22 12:25:47 lda(postmaster@domain2.tld)<48129><kwMQFqtrDWUBvAAAElSLcQ>: Error: duplicate db: transaction: file_dotlock_open(/home/user2/.dovecot.lda-dupes) failed: Permission denied
Sep 22 12:25:47 lda(postmaster@domain2.tld)<48129><kwMQFqtrDWUBvAAAElSLcQ>: Error: duplicate db: transaction: Failed to lock /home/user2/.dovecot.lda-dupes.locks/duplicate.lock.b0be0da6c6a062c630bb7aa8dd72846a: mkdir_parents(/home/user2/.dovecot.lda-dupes.locks) failed: Permission denied
Thank you. sahsanu
On 22/09/2023 13:30 EEST sahsanu via dovecot dovecot@dovecot.org wrote:
Dovecot expects mail user's home to be writable. If your home is not writable by the user, you need to set mail_home=~/mail/ or something and make that directory writable to dovecot, e.g. with chown.
Aki
Hello Aki,
I tried to change mail_home to several options (I've restarted dovecot after each test):
mail_home = %h/mail/%d/%n mail_home = ~/mail/%d/%n
I've even created a new dir (/dupes/) with 777 perms
mail_home = /dupes/
But I'm still viewing in the logs that it is trying to use /home/USER/
Sep 22 12:25:47 lda(postmaster@domain2.tld)<48129><kwMQFqtrDWUBvAAAElSLcQ>: Error: duplicate db: transaction: file_dotlock_open(/home/user2/.dovecot.lda-dupes) failed: Permission denied
Sep 22 12:25:47 lda(postmaster@domain2.tld)<48129><kwMQFqtrDWUBvAAAElSLcQ>: Error: duplicate db: transaction: Failed to lock /home/user2/.dovecot.lda-dupes.locks/duplicate.lock.b0be0da6c6a062c630bb7aa8dd72846a: mkdir_parents(/home/user2/.dovecot.lda-dupes.locks) failed: Permission denied
Thank you.
I'm guessing your userdb or passdb is returning home for user, so you need to fix that to point to correct place, or drop it.
Aki
I'm guessing your userdb or passdb is returning home for user, so you need to fix that to point to correct place, or drop it.
Aki
You are right, I found it in /etc/exim4/domains/%d/passwd
passdb { driver = passwd-file args = scheme=MD5-CRYPT username_format=%n /etc/exim4/domains/%d/passwd }
userdb { driver = passwd-file args = username_format=%n /etc/exim4/domains/%d/passwd }
Thank you very much for your help and time.
Best regards, sahsanu
participants (2)
-
Aki Tuomi
-
sahsanu