1 (edited by AshcorTech 2013-08-03 03:09:40)

Topic: [SOLVED] Dovecot Errors on brand new installation

==== Required information ====
- iRedMail version: 0.8.5
- Store mail accounts in which backend: MySQL
- Linux/BSD distribution name and version: OpenSuse 12.3
- Related log if you're reporting an issue: dovecot.log
====

when trying to log in to roundcube webmail for the first time it comes up with an error:

Connection to storage server failed.

the dovecot log has the following (real email address replaced)

Aug 01 21:41:23 imap-login: Info: Login: user=<user@fakemaildomain.net>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, mpid=3529, secured, session=<Vv9sDu3iygB/AAAB>
Aug 01 21:41:23 imap(user@fakemaildomain.net): Error: user user@fakemaildomain.net: Initialization failed: Namespace '': mkdir(//data/vmail/vmail1/fakemaildomain.net/u/s/e/user-2013.08.01.21.34.56//Maildir) failed: Permission denied (euid=303(vmail) egid=303(vmail) missing +w perm: /, dir owned by 0:0 mode=0755)
Aug 01 21:41:23 imap(user@fakemaildomain.net): Error: Invalid user settings. Refer to server log for more information.

the warn log has the following:

013-08-01T22:01:53.059848-04:00 linux01 roundcube: IMAP Error: Login failed for user@fakemaildomain.net from 127.0.0.1. LOGIN: Internal error occurred. Refer to server log for more information. in /srv/www/roundcubemail-0.9.2/program/lib/Roundcube/rcube_imap.php on line 184 (POST /mail/?_task=login&_action=login)
when I installed iRedmail I changed the storage location from /var/vmail to /DATA/vmail

anybody ever run into this or know what the issue may be?

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: [SOLVED] Dovecot Errors on brand new installation

what is the permissions of /DATA and /DATA/vmail?
I also changed my data path when i installed round cube. Instead of /var/vmail/ I installed it in /var/vmail/mailbox because the vmail/ is a different drive which i mounted manually.
permissions in vmail is 777 root:root and in mailbox folder is 700 vmail:vmail

3

Re: [SOLVED] Dovecot Errors on brand new installation

Default permission of /var/vmail (default folder used in iRedMail) is:

- Owned by user 'vmail' and group 'vmail'
- File permission is 0700. (e.g. chmod -R 0700 /var/vmail).

4

Re: [SOLVED] Dovecot Errors on brand new installation

ZhangHuangbin wrote:

Default permission of /var/vmail (default folder used in iRedMail) is:

- Owned by user 'vmail' and group 'vmail'
- File permission is 0700. (e.g. chmod -R 0700 /var/vmail).

Looks like that is what's set....

linux01:/DATA # ls -lah
total 28K
drwxr-xr-x  4 root  root  4.0K Aug  1 20:58 .
drwxr-xr-x 25 root  root  4.0K Aug  1 22:05 ..
drwx------  2 root  root   16K Aug  1 10:56 lost+found
drwx------  5 vmail vmail 4.0K Aug  1 21:00 vmail

5 (edited by AshcorTech 2013-08-02 21:56:20)

Re: [SOLVED] Dovecot Errors on brand new installation

played with the /DATA directory permissions, set it to 777, no good. changed ownership to vmail with 777, no good.

the problem seems to be that the mail directory doesn't exist and dovecot is trying to create it but has insufficient privileges to do so.  This should only happen on the initial login for a new user (which this is). 

question is, what user needs +W permissions?

6

Re: [SOLVED] Dovecot Errors on brand new installation

ok... Could it be the extra "/" in the mkdir command?

mkdir(//data/vmail/vmail1/fakemaildomain.net/u/s/e/user-2013.08.01.21.34.56//Maildir) failed: Permission denied (euid=303(vmail) egid=303(vmail) missing +w perm: /, dir owned by 0:0 mode=0755)

//data and at //Maildir

it states in the error "/, dir owned by 0:0"

also, in the mysql database under the databse vmail table "mailbox" the "storagebasedirectory" field has a setting of "/DATA/vmail"

yet the directory trying to be created starts with "//data" in lower case.

something isn't right here...

7

Re: [SOLVED] Dovecot Errors on brand new installation

figured it out...

my base director is /DATA

in the dovecot.conf the "mail_location" setting used the variable %Lh for the path.  the %L converts the path to all lowercase so /DATA was converted to /data

i removed the L and just left it %h and I was able to log in with both new users.

8

Re: [SOLVED] Dovecot Errors on brand new installation

Be careful, iRedMail uses '%L' by default. So if you're going to migrate this server in the future, don't forget to remove '%L' on new server. Or, simply use '/data' (in lower cases) instead.

9

Re: [SOLVED] Dovecot Errors on brand new installation

Ok, so I changed my fstab to mount /data instead of /DATA

changed the dovecot.conf file back to using %L%H

created a new domain and everything worked fine.

Now I have two domains on the server mydomain.net and mydomain.com

mydomain.com is a real domain with real mailtraffic and it's working just fine.

mydomain.net is the initial local domain created that has the postmaster@mydomain.net for administering iRedmail.

I can no longer log into postmaster@mydomain.net with an error message of "Connection to storage server failed"

any suggestions on this?

10

Re: [SOLVED] Dovecot Errors on brand new installation

ok, seeing this in the dovecot log:

missing +w perm: //DATA, dir owned by 0:0 moe=0755 every time I try to login with postmaster@mydomain.net so somewhere dovecot is still getting the /DATA instead of the /data

after changing the /etc/dovecot/dovecot.conf I issued a /etc/init.d/dovcot restart but it's almost as if the changes weren't read.

anywhere else this may be?

11

Re: [SOLVED] Dovecot Errors on brand new installation

SOLVED AGAIN:

vmail.mailbox had storagebasedirectory column set for /DATA/vmail still for that original domain..  a quick update query and I'm back in business.