1

Topic: Roundcube failure to connect to imap server

==== Required information ====
- iRedMail version: 0.8.4
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): mysql
- Linux/BSD distribution name and version: Ubuntu 12.10
- Related log if you're reporting an issue:
====

Hi I set up iredmail today, and am having a roundcube/dovecot/imap related problem.

I suspect it is more dovecot related than roundcube, but the behaviour is displayed when you try and log into roundcube when you get the error message: Connection to IMAP server failed.

The message in the logs are as follows:

Apr 18 10:34:02 auth-worker(2679): Info: mysql(127.0.0.1): Connected to database vmail
Apr 18 10:34:02 imap-login: Info: Login: user=<postmaster@XXXXXXX.TLD>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, mpid=2681, secured, session=<SU//dp7alwB/AAAB>
Apr 18 10:34:02 imap(postmaster@XXXXXXX.TLD): Error: chdir(/var/vmail/vmail1/XXXXXXX.TLD/p/o/s/postmaster-2013.04.18.09.07.53//) failed: Permission denied (euid=2000(<unknown>) egid=2000(<unknown>) missing +x perm: /var/vmail, dir owned by 5000:5000 mode=0700)
Apr 18 10:34:02 imap(postmaster@XXXXXXX.TLD): Error: chdir(/var/vmail/vmail1/XXXXXXX.TLD/p/o/s/postmaster-2013.04.18.09.07.53/) failed: Permission denied
Apr 18 10:34:02 imap(postmaster@XXXXXXX.TLD): Error: user postmaster@quintin.co.za: Initialization failed: Namespace '': stat(//var/vmail/vmail1/XXXXXXX.TLD/p/o/s/postmaster-2013.04.18.09.07.53//Maildir) failed: Permission denied (euid=2000(<unknown>) egid=2000(<unknown>) missing +x perm: //var/vmail, dir owned by 5000:5000 mode=0700)

==> mail.log <==
Apr 18 10:34:02 yomo-prod-db1 roundcube: IMAP Error: Login failed for postmaster@XXXXXXX.TLD from 127.0.0.1. LOGIN: Internal error occurred. Refer to server log for more information. in /usr/share/apache2/roundcubemail-0.8.6/program/include/rcube_imap.php on line 191 (POST /mail/?_task=login&_action=login)

==> mail.err <==
Apr 18 10:34:02 yomo-prod-db1 roundcube: IMAP Error: Login failed for postmaster@XXXXXXX.TLD from 127.0.0.1. LOGIN: Internal error occurred. Refer to server log for more information. in /usr/share/apache2/roundcubemail-0.8.6/program/include/rcube_imap.php on line 191 (POST /mail/?_task=login&_action=login)

==> dovecot.log <==
Apr 18 10:34:02 imap(postmaster@XXXXXXX.TLD): Error: Invalid user settings. Refer to server log for more information.

I have chowned the directory to vmail and chmod u+w the directories recursively. I have created the directories that are mentioned in the error message.

2

Re: Roundcube failure to connect to imap server

quintinza wrote:

Apr 18 10:34:02 imap(postmaster@XXXXXXX.TLD): Error: user postmaster@quintin.co.za: Initialization failed: Namespace '': stat(//var/vmail/vmail1/XXXXXXX.TLD/p/o/s/postmaster-2013.04.18.09.07.53//Maildir) failed: Permission denied (euid=2000(<unknown>) egid=2000(<unknown>) missing +x perm: //var/vmail, dir owned by 5000:5000 mode=0700)

Directory /var/vmail should be owned by user/group: vmail:vmail. But yours is owned by different user (uid/gid: 5000:5000). You can fix it with below command:

# chown -R vmail:vmail /var/vmail

3 (edited by quintinza 2013-04-18 19:51:15)

Re: Roundcube failure to connect to imap server

Hi ZhangHuangbin.

I did do that and that did not resolve the problem unfortunately.

4

Re: Roundcube failure to connect to imap server

quintinza wrote:

I did do that and that did not resolve the problem unfortunately.

Could you please show me output of below commands:

# id vmail
# ls -dl /var/vmail
# ls -dl /var/vmail/vmail1
# dovecot -n

5

Re: Roundcube failure to connect to imap server

Hey.

I somehow borked my whole install while troubleshooting iredmail, and rolled back to this morning before I installed to restore at least web service.

I'll play around a bit and let you know after I installed from scratch.

Regards

6

Re: Roundcube failure to connect to imap server

Hey Zhang,

Just want to say thank you -- I was having a similar issue after restoring vmail from a backup.  Your post helped me to get it cleared up.