dovecot.index permissions/ownership change

mjm

Verified User
Joined
Mar 21, 2005
Messages
47
Location
San Diego
I've had this issue popup with a couple of users recently. I manually go in and fix the permissions but then a couple of hours/day/weeks later it reverts...

Here's some output from /var/log/maillog

Code:
Dec 21 09:38:51 server dovecot[21571]: IMAP([email protected]): open() failed with index file /home/domuser/imap/domain.dom/user/Maildir/.Azorie Blue/dovecot.index: Permission denied
Dec 21 09:38:51 server dovecot[21571]: IMAP([email protected]): open() failed with index file /home/domuser/imap/domain.dom/user/Maildir/.Duke Video/dovecot.index: Permission denied

Looking at those files, they're owned by another user.

Code:
 ls -la Maildir/
-rw-------  1 user2 mail   5184 Dec 21 08:14 dovecot.index
-rw-------  1 user2 mail 313344 Dec 21 07:23 dovecot.index.cache
-rw-------  1 user2 mail   2472 Dec 21 08:14 dovecot.index.log
-rw-rw----  1 domuser     mail     85 Oct 22 13:55 dovecot-keywords
-rw-------  1 user2 mail  20973 Dec 21 07:20 dovecot-uidlist

I've run the ./set_permissions.sh script and this is still happening.

Quite bizarre. Any help is appreciated.
 
after manually changing permissions a couple more times the issue seems to have gone away. i haven't updated software or changed any config. i'm stumped. :(
 
I fixed mine. It's related to effective uid/gid. For unknown reason, dovecot chose a wrong effective uid to read the user's home maildir and resulted in permission denied errors. I had to edit the /etc/virtual/<domain>/passwd file manually to change the gid to the correct one.

You should first turn on debug mode in /etc/dovecot.conf, restart dovecot for more information. Hope this helps you.:)
 
I know this is an old thread but I seem to be having this issue with one of my domains...

What would cause this? and how do I manually change the permissions or edit the passwd file?

I fixed mine. It's related to effective uid/gid. For unknown reason, dovecot chose a wrong effective uid to read the user's home maildir and resulted in permission denied errors. I had to edit the /etc/virtual/<domain>/passwd file manually to change the gid to the correct one.

How do I do this? what is the uid/gid, and how do i know what to change it to?

Sorry to be ignorant but thanks for any help.

-Mike
 
cd /usr/local/directadmin/scripts/
./set_permissions email
./set_permissions user_homes

Here is the usage:

Usage:
./set_permissions.sh all

./set_permissions.sh da_files
./set_permissions.sh user_homes
./set_permissions.sh mysql
./set_permissions.sh email
./set_permissions.sh logs
./set_permissions.sh etc_configs

internal:
./set_permissions.sh maildir <user> <path/Maildir>
 
scsi,

This worked to fix my email problem so thank you for that post.

However, Now MySQL is completely screwed up and I don't know what is going on. I ran the ./set_permissions.sh all script and I believe that was what caused the problem.

Now I can't create databases, and none of my previous databases are working properly. This is very urgent as I have a lot of clients using databases, myself included.

Any idea how to fix this problem or why this is happening?
 
When I click on MySQL management in the user level I am getting the following error...

Error connecting to MySQL: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13)

Thanks again,
Mike
 
I am sorry for posting so many times in a row....

I panicked because this would have been a huge issue if my clients noticed but I just restarted mysql and it fixed the problem.

Maybe directadmin should include the reboot of mysql in that script, or a warning after it is run?

Thanks again!
Mike
 
I've run the set_permissions script many times without getting that error.

Jeff
 
cd /usr/local/directadmin/scripts/
./set_permissions email
./set_permissions user_homes

Here is the usage:

Usage:
./set_permissions.sh all

./set_permissions.sh da_files
./set_permissions.sh user_homes
./set_permissions.sh mysql
./set_permissions.sh email
./set_permissions.sh logs
./set_permissions.sh etc_configs

internal:
./set_permissions.sh maildir <user> <path/Maildir>
I wonder if it's possible to use the script to set permissions for ONE SPECIFIC user... Is it?

After some searching found this:
./set_permissions.sh set_user_home <user>
Is this valid?
 
Last edited:
Back
Top