View Full Version : dovecot.index permissions/ownership change
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
Dec 21 09:38:51 server dovecot[21571]: IMAP(user@domain.dom): 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(user@domain.dom): 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.
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.
will-lo
12-30-2008, 09:30 PM
i've having the same problem as you after updating to dovecot 1.17, do you find the solution yet?
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. :(
will-lo
12-31-2008, 03:37 AM
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.:)
mikelato
12-23-2010, 08:49 PM
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>
mikelato
12-24-2010, 10:32 AM
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?
mikelato
12-24-2010, 10:33 AM
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
mikelato
12-24-2010, 10:38 AM
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
nobaloney
12-24-2010, 12:12 PM
I've run the set_permissions script many times without getting that error.
Jeff
Powered by vBulletin™ Version 4.0.4 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.