HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Installation/Configuration (http://www.howtoforge.com/forums/forumdisplay.php?f=27)
-   -   Error in Dovecot (http://www.howtoforge.com/forums/showthread.php?t=53645)

mentes 3rd August 2011 15:31

Error in Dovecot
 
I have an error.

Code:

dovecot: dovecot: Fatal: chdir(/var/vmail/domain.com/user/) failed: Permission denied (euid=5000() egid=5000() missing +x perm: /var/vmail/domain.com)
dovecot: dovecot: child 22766 (imap) returned error 89 (Fatal failure)

I do:

Code:

chmod +x /var/vmail/domain.com/user
chown -R vmail:vmail /var/vmail

And I still have the same error.

Code:

root@server:/var/vmail# ls -al
total 24
drwxr-xr-x  4 vmail vmail 4096 Aug  3 12:27 .
drwxr-xr-x 16 root  root  4096 Aug  3 00:30 ..
-rw-------  1 vmail vmail 1382 Aug  3 12:34 .mailfilter
-rw-r--r--  1 vmail vmail 1382 Aug  3 12:34 .mailfilter~
drwxr-xr-x  2 vmail vmail 4096 Aug  2 12:26 mailfilters
drwx------  3 vmail vmail 4096 Aug  3 12:27 domain.com

root@server:/var/vmail/domain.com# ls -al
total 12
drwx------ 3 vmail vmail 4096 Aug  3 12:27 .
drwxr-xr-x 4 vmail vmail 4096 Aug  3 12:27 ..
drwx--x--x 3 vmail vmail 4096 Aug  3 12:27 user

root@server:/var/vmail/domain.com/user# ls -al
total 16
drwx--x--x 3 vmail vmail 4096 Aug  3 12:27 .
drwx------ 3 vmail vmail 4096 Aug  3 12:27 ..
drwx--x--x 9 vmail vmail 4096 Aug  3 12:27 Maildir
-rw-r--r-- 1 vmail vmail  48 Aug  3 12:27 .sieve

Code:

root@server:~# dpkg -l | grep dovecot
ii  dovecot-common                      1:1.2.15-7                  secure mail server that supports mbox and maildir mailboxes
ii  dovecot-imapd                      1:1.2.15-7                  secure IMAP server that supports mbox and maildir mailboxes
ii  dovecot-pop3d                      1:1.2.15-7                  secure POP3 server that supports mbox and maildir mailboxes

ISPconfig 3.0.3.3
Debian 6.0.2

till 3rd August 2011 16:03

Which Linux distribution?

mentes 3rd August 2011 16:10

Debian 6.0.2

mentes 3rd August 2011 17:52

Another check:

Code:

root@server:~# telnet mail.domain.com 143
Trying xx.xx.xx.xx...
Connected to mail.domain.com.
Escape character is '^]'.
* OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE STARTTLS AUTH=PLAIN AUTH=LOGIN] my-domain.tld IMAP server ready...
a login test@domain.com 123456
Connection closed by foreign host.
root@server:~#


Mark_NL 3rd August 2011 21:25

Just wondering...

Log into your mysql database and run this query
Code:

select uid,gid from dbispconfig.mail_user where not uid=5000;
what is the result of the query?

also /var/vmail/domain.com has no +x group rights .. though i still think it's strange it doesn't work, try giving /var/vmail/domain.com +x on the group so:
Code:

chmod g+x /var/vmail/domain.com
If that solves your problem, then dovecot in some way must check the the gid rights as well.

mentes 3rd August 2011 21:48

Code:

mysql> select uid,gid from dbispconfig.mail_user where not uid=5000;
Empty set (0.00 sec)

I get it works with these permissions

drwxrwx--x 5 vmail vmail 4096 Aug 3 21:42 domain.com

Is right?

Mark_NL 3rd August 2011 21:52

Nice to hear it's working..

Though this tells us dovecot needs correct user AND group rights to function. (php safe_mode like thingy)

I'm not using dovecot at all, so I can't tell you if that's the case, this assumption is based on the response I get from you :)

Maybe Till can shed some more light on this?


edit: remember to manually set g+x on the newly created email domain! (or patch the php code that creates them ;-))

mentes 3rd August 2011 22:23

I get a new errors:

Code:

Aug  3 21:59:24 im dovecot: deliver(test@domain.com): Fatal: setgid(5000) failed with euid=1000(vmail), gid=1000(vmail), egid=1000(vmail): Operation not permitted (This binary should probably be called with process group set to 5000 instead of 1000(vmail))
In /etc/passwd

vmail:x:1000:1000::/home/vmail:/bin/sh

I think is wrong, what happens? I haven't changed uid or gid for vmail user.

mentes 3rd August 2011 22:36

I have restored uid and gid and seems works fine.

I do:

Code:

usermod -u 5000 vmail
groupmod -g 5000 vmail
usermod -g 5000 vmail

chown vmail:vmail -R vmail/

I think the permissions still wrong.

Mark_NL 3rd August 2011 23:00

Weird, for some reason the UID and GID of the "vmail" user has been changed to 1000

1000 is the first manually added user to the system, to that means it wasn't added by the ispconfig installation, nor any other package. So that must've been added by a user on the system.

what does ls -alR /var/vmail say this time?


All times are GMT +2. The time now is 14:11.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.