Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set UMask for metadata and doveauth systemd units to 0700 #453

Open
link2xt opened this issue Nov 7, 2024 · 0 comments
Open

Set UMask for metadata and doveauth systemd units to 0700 #453

link2xt opened this issue Nov 7, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@link2xt
Copy link
Contributor

link2xt commented Nov 7, 2024

It seems when metadata or doveauth get to mkdir user directory in vmail first, they create it with too broad permissions:

total 41M
drwx------ 5 vmail vmail 4.0K Sep 22 00:03 .
drwx------ 1 vmail vmail  40M Nov  7 20:39 ..
drwx------ 2 vmail vmail 4.0K Jul 13 18:22 cur
-rw------- 1 vmail vmail 2.3K Sep 21 08:09 dovecot.index.log
-rw------- 1 vmail vmail  452 Jul 13 18:22 dovecot.list.index.log
-rw------- 1 vmail vmail   51 Jul 13 18:22 dovecot-uidlist
-rw------- 1 vmail vmail    8 Jul 13 18:22 dovecot-uidvalidity
-r--r--r-- 1 vmail vmail    0 Jul 13 18:22 dovecot-uidvalidity.6692a9dc
-rw------- 1 vmail vmail    0 Jul 13 18:22 maildirfolder
-rw-r--r-- 1 vmail vmail  199 Sep 21 08:09 metadata.json
-rw-r--r-- 1 vmail vmail    0 Sep 21 08:09 metadata.json.lock
drwx------ 2 vmail vmail 4.0K Jul 13 18:22 new
-rw-r--r-- 1 vmail vmail  120 Sep 21 02:00 password
drwx------ 2 vmail vmail 4.0K Jul 13 18:22 tmp

In this case above the folder is 0700, but some folders are 755 because of this. We should make sure all created folders are 755.

It's not a security issue as long as /home/vmail/mail is 0700, but still not nice that different user folders have different permissions based on timing.

@link2xt link2xt added the bug Something isn't working label Nov 7, 2024
@link2xt link2xt changed the title Set UMask for metadata and doveauth to 0700 Set UMask for metadata and doveauth systemd units to 0700 Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant