Dovecot Folder and file permissions.

Alexander Dalloz ad+lists at uni-x.org
Wed Jan 6 00:45:10 EET 2021


Am 05.01.2021 um 21:18 schrieb Thomas Strike:
> While working with adding a website to apache on my server something 
> caused a blanket resetting of all file permissions on the server to 
> apache:apache. I have most of the server running again but my mail 
> services is another story. I have configured vmail on a Postfix with 
> Dovecot and mariadb install. What I need is help with reestablishing the 
> correct file and folder permissions that dovecot uses. The following is 
> my configuration;
> 
> # OS: Linux 4.18.0-147.3.1.el8_1.x86_64 x86_64 CentOS Linux release 
> 8.1.1911 (Core)  xfs


Keep your system updated! Current kernel is

4.18.0-240.1.1.el8_3.x86_64

and CentOS 8.3.2011 is the current OS minor release.

> # Dovecot version# 2.2.36 (1f10bfa63)

Why is that this ancient version of dovecot? CentOS 8 ships 
https://centos.pkgs.org/8/centos-appstream-x86_64/dovecot-2.3.8-4.el8.x86_64.rpm.html 
on the x86_64 platform.

> # Hostname: sleepyvalley
> auth_mechanisms = plain login
> mail_home = /var/vmail/%d/%n
> mail_location = maildir:/var/vmail/%d/%n
> mail_privileged_group = mail
> mail_uid = vmail
> mbox_write_locks = fcntl
> namespace inbox {
>    inbox = yes
>    location =
>    mailbox Drafts {
>      special_use = \Drafts
>    }
>    mailbox Junk {
>      special_use = \Junk
>    }
>    mailbox Sent {
>      special_use = \Sent
>    }
>    mailbox "Sent Messages" {
>      special_use = \Sent
>    }
>    mailbox Trash {
>      special_use = \Trash
>    }
>    prefix =
> }
> passdb {
>    args = /etc/dovecot/dovecot-sql.conf.ext
>    driver = sql
> }
> passdb {
>    args = scheme=CRAM-MD5 username_format=%u /etc/dovecot/users
>    driver = passwd-file
> }
> postmaster_address = postmaster at sleepyvalley.net
> service auth-worker {
>    user = vmail
> }
> service auth {
>    unix_listener /var/spool/postfix/private/auth {
>      mode = 0666
>    }
>    unix_listener auth-userdb {
>      mode = 0666
>      user = vmail
>    }
> }
> service lmtp {
>    unix_listener /var/spool/postfix/private/dovecot-lmtp {
>      group = postfix
>      mode = 0666
>      user = postfix
>    }
> }
> ssl_cert = </etc/letsencrypt/live/mail.sleepyvalley.net/fullchain.pem
> ssl_cipher_list = PROFILE=SYSTEM
> ssl_key =  # hidden, use -P to show it
> userdb {
>    args = /etc/dovecot/dovecot-sql.conf.ext
>    driver = sql
> }
> userdb {
>    args = uid=vmail gid=vmail home=/home/vmail/%d/%n
>    driver = static
> }
> 
> I really need help with this, thanks.


For dovecot and other packages installed through install / dnf use

rpm --setperms <packagename>
rpm --setugids <packagename>

For /var/vmail you have specified vmail:vmail. Same for /home/vmail.

Alexander




More information about the dovecot mailing list