I am migrating an old mail (postfix/dovecot) server to a new one. Everything works much as expected. I have a small obstacle though.
I use mbox format and the setup is pretty much simple.
Suppose a user's home directory is the following:
~$ ls -ld /home/foo
drwxr-xr-x 3 foo users 4096 Oct 4 13:28 foo
and the respective /var/mail:
~$ ls -ld /var/mail/foo
-rw------- 1 foo mail 0 Oct 4 23:45 /var/mail/foo
In the old server when the user tried to create a new test imap folder (from an imap client), then the newly created file would be:
~$ ls -l /home/foo/
-rw------- 1 foo users 0 Oct 2 02:08 test
This is the desired behavior.
In the new dovecot 2.1 server the following file permissions will apply:
~$ ls -l /home/foo/
-rw-r--r-- 1 foo users 0 Oct 2 02:08 test
I finally noticed that if I chmod the /home/foo to 711, then the new file will have the desired (600) permissions. So, I can make a umask for the new users (login.defs), but that doesn't sound a pretty solution, because users have ssh access to their homes and they can change the permissions back to 755.
Do you have anything else to suggest in order to have the desired permissions for a newly created imap folder? If you need any .conf file, let me know.
Thanks in advance!
umask
for the dovecot process? This is the usually way to control default permissions on created files.