# IMAP Error: Login failed



## c00kie (Sep 21, 2013)

Hi,

It's a Roundcube related question although we go lower to the IMAP layer. OK, if I browse to http://mydomain.net/roundcube and try to log in with one of my mbox user accounts, admin I receive:


```
Connection to storage server failed
```

Googling that string and a few folks are running into similar problems.  

Checking /usr/local/www/roundcube/logs/errors and

```
[21-Sep-2013 17:19:02 +0100]: IMAP Error: Login failed for admin from ip.ip.ip.ip. Could not connect to ip.ip.ip.ip:143: 
Connection refused in /usr/local/www/roundcube/program/lib/Roundcube/rcube_imap.php on line 184 
(POST /roundcube/?_task=login&_action=login)
```

So that'll be from the method below specifically in rcube_imap.php.


```
* Connect to an IMAP server
     *
     * @param  string   $host    Host to connect
     * @param  string   $user    Username for IMAP account
     * @param  string   $pass    Password for IMAP account
     * @param  integer  $port    Port to connect to
     * @param  string   $use_ssl SSL schema (either ssl or tls) or null if plain connection
     *
     * @return boolean  TRUE on success, FALSE on failure
     */
    public function connect($host, $user, $pass, $port=143, $use_ssl=null) {}
```

I try to create the relative logs by editing main.inc.php:


```
// Log IMAP conversation to <log_dir>/imap or to syslog
$rcmail_config['imap_debug'] = /var/log/imap;
```

and


```
-rw-r--r--  1 root  wheel  0 Sep 21 14:13 /var/log/imap
```

Back at my browser though and with an unsuccessful login, the file doesn't get written to, leaving me no clues.

My DNS is configured correctly with appropriate MX records - proof of this is established with emails to/from my server using the shell and mutt.

It's strange, but I have had this working in the past but alas it's playing up at the moment. What could be the problem?

(Image attached)


----------



## c00kie (Sep 22, 2013)

I needed an entry in /etc/rc.conf

```
dovecot_enable="YES"
```

Now works. Schoolboy error.


----------

