Author Topic: Setting up Roundcube and Mercury Mailserver  (Read 9695 times)

Offline vish213

  • Newbie
  • *
  • Posts: 7
Setting up Roundcube and Mercury Mailserver
« on: January 27, 2014, 02:05:13 PM »
Hi, I'm trying to set up Roundcube to work with our existing Mercury mailserver. For the past 10 years, we've had Mercury running with Icewarp Webmail on top of it, so that we can access mail on the go. Last night, we moved our mailserver to a new location. I think that Icewarp's registration is linked to the IP from the old office, and they don't actually support our version (its about a decade old). Sadly, our webmail interface no longer loads (ports are forwarded, IP was updated @ Network Solutions, etc.). Traffic is going through though, because our website, which is running on the same server, works.

I downloaded the WAMP Stack from Bitnami (Apache, MySQL and PHP) and installed it. I followed this with the Roundcube module from their website, and I'm not completely sure if its configured properly.

I set up Roundcube with the following information:

IMAP Server: mail.ourdomain.com
Port: 993

SMTP Server: mail.ourdomain.com
Port: 587

We're using mail.ourdomain.com for all of our previous POP3 and SMTP needs, and now our IMAP and SMTP needs. We don't have a separate server for IMAP and SMTP.

On Mercury's side, the ports are a little different, so I'm not sure if this is part of the problem:
IMAP Port: 993
SMTP Port: 25 (with 587 listed in the Alternate Port field)

All of the ports for POP3, SMTP and IMAP are forwarded to the private IP of the mail server. When I go to http://ourdomain.com:8080/roundcube, the login screen appears, but when I try to log in, I get a yellow hazard sign with "Login failed". I've tried with username/password and with username@ourdomain.com/password.

Does anyone have an idea of what I've done wrong? Thanks in advance!

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,600
    • http://SKaero.com/
Re: Setting up Roundcube and Mercury Mailserver
« Reply #1 on: January 27, 2014, 02:18:21 PM »
What in the RoundCube error log?

Offline vish213

  • Newbie
  • *
  • Posts: 7
Re: Setting up Roundcube and Mercury Mailserver
« Reply #2 on: January 27, 2014, 07:29:07 PM »
Its an authentication error. I'm using the password that I always use for the account. I use this one to send out client updates every Sunday - as I've been doing for years. The error occurs whether I use name/password or name@domain/password. The same errors just repeat, as I've tried a bunch of times.

[27-Jan-2014 10:14:28 -0800]: IMAP Error: Login failed for ccinfo from xx.xx.xxx.xxx. AUTHENTICATE Unknown user or incorrect password in C:\BitNami\wampstack-5.4.24-0\apps\roundcube\htdocs\program\lib\Roundcube\rcube_imap.php on line 184 (POST /roundcube/?_task=login&_action=login)

[27-Jan-2014 10:14:43 -0800]: IMAP Error: Login failed for ccinfo@xxxxxxxxx.com from xx.xx.xxx.xxx. AUTHENTICATE Unknown user or incorrect password in C:\BitNami\wampstack-5.4.24-0\apps\roundcube\htdocs\program\lib\Roundcube\rcube_imap.php on line 184 (POST /roundcube/?_task=login&_action=login)

When I used Icewarp, I could see the login attempts in the Mercury POP3 Server panel. With Roundcube, I don't see anything there (which is expected) but I also don't see any login attempts in the Mercury IMAP4 Server panel. I think the two programs are not communicating.

Offline vish213

  • Newbie
  • *
  • Posts: 7
Re: Setting up Roundcube and Mercury Mailserver
« Reply #3 on: January 28, 2014, 12:06:26 AM »
Progress! ;)

I've been going through the main.inc.php file in the C:\BitNami\wampstack-5.4.24-0\apps\roundcube\htdocs\config folder. I made some changes to the file, and to Mercury, testing each time. I was able to log in and got mail!

So far, it looks like some combination of the following helped:

In the IMPAP section
1. $rcmail_config['default_host'] =
I changed this to not start with "ssl://"

2. $rcmail_config['default_port'] = 993;
I changed this to 143.

3. I did the same thing in Mercury, in the IMAP4 panel. (Changing the port from 993 to 143.)

I know that this means that I'm going in unsecured, but for now, just to get things moving, its fine.

However - there's a new problem, of course. The mail loaded on initial login. After maybe 2-3 minutes, it vanished. There are no messages listed, and I got a red popup warning that said something about being unable to connect to the storage server. I'm going to try to reproduce that and see where it goes. As of right now, after logging out and back in twice, that storage server message has reappeared both times, and the mailbox isn't showing any messages. I'm just glad to even get to the interface though.

If anyone has an idea of what that storage server problem can be, please let me know. I might also need some advice on securing the connection, once we're able to reliably access it.


Offline vish213

  • Newbie
  • *
  • Posts: 7
Re: Setting up Roundcube and Mercury Mailserver
« Reply #4 on: January 28, 2014, 12:30:14 AM »
Here's that "Connection to storage server failed" popup.

http://www.flickr.com/photos/115736218@N06/12184682876/

Its intermittent though. The mailbox randomly loads, and then when refreshing, will load up empty with that message. Also - Roundcube seems a bit slower than Icewarp was. Of course, the internet speed at the new place is also slower, so I'll have to look into increasing that. And, it appears that it didn't load any folders - like the Trash. All I have is the Inbox. I'll have to check other accounts to see if this is true for everyone.

[edit] Here's an expanded version of that message. Its definitely happening across accounts. My IMAP timeout is set to unlimited as well.

http://www.flickr.com/photos/115736218@N06/12184540433/

// IMAP connection timeout, in seconds. Default: 0 (no limit)
$rcmail_config['imap_timeout'] = 0;
« Last Edit: January 28, 2014, 12:53:17 AM by vish213 »

Offline vish213

  • Newbie
  • *
  • Posts: 7
Re: Setting up Roundcube and Mercury Mailserver
« Reply #5 on: January 28, 2014, 01:27:00 PM »
The mailboxes are still suffering from sometimes loading email and sometimes not connecting to the storage server. I've been refreshing and keeping my fingers crossed. Eventually, I'm able to view and open mail.

I'm not able to send out messages though. I've been getting the following error:

SMTP Error (-1): Connection to server failed.

http://www.flickr.com/photos/115736218@N06/12192834493/

I looked around online and it appears that this might be caused by a firewall issue - however, we don't have a software firewall running on that machine, and I checked the hardware firewall. Its not blocking SMTP. Its actually forwarding them to the machine with that error (the mail server).

This is the info from my log file:

[28-Jan-2014 10:06:11 America/Los_Angeles] Failed to connect socket: php_network_getaddresses: getaddrinfo failed: No such host is known.  ():

[28-Jan-2014 10:06:11 -0800]: SMTP Error: SMTP error: Connection failed: Failed to connect socket: php_network_getaddresses: getaddrinfo failed: No such host is known.  in C:\BitNami\wampstack-5.4.24-0\apps\roundcube\htdocs\program\include\rcmail.php on line 1035 (POST /roundcube/?_unlock=loading1390932851592&_lang=en?_task=mail&_action=send)

Offline vish213

  • Newbie
  • *
  • Posts: 7
Re: Setting up Roundcube and Mercury Mailserver
« Reply #6 on: January 28, 2014, 01:55:09 PM »
Here's the SMTP section of my main.inc.php config file, in case its helpful I changed the port from 587 to 25, changed the username and password from blank to the session variables and left the rest as they were.

$rcmail_config['smtp_server'] = 'mail.xxxxxxxxx.com';

// SMTP port (default is 25; use 587 for STARTTLS or 465 for the
// deprecated SSL over SMTP (aka SMTPS))
$rcmail_config['smtp_port'] = 25;

// SMTP username (if required) if you use %u as the username Roundcube
// will use the current username for login
$rcmail_config['smtp_user'] = '%u';

// SMTP password (if required) if you use %p as the password Roundcube
// will use the current user's password for login
$rcmail_config['smtp_pass'] = '%p';

// SMTP AUTH type (DIGEST-MD5, CRAM-MD5, LOGIN, PLAIN or empty to use
// best server supported one)
$rcmail_config['smtp_auth_type'] = '';

// Optional SMTP authentication identifier to be used as authorization proxy
$rcmail_config['smtp_auth_cid'] = null;

// Optional SMTP authentication password to be used for smtp_auth_cid
$rcmail_config['smtp_auth_pw'] = null;

// SMTP HELO host
// Hostname to give to the remote server for SMTP 'HELO' or 'EHLO' messages
// Leave this blank and you will get the server variable 'server_name' or
// localhost if that isn't defined.
$rcmail_config['smtp_helo_host'] = '';

// SMTP connection timeout, in seconds. Default: 0 (no limit)
// Note: There's a known issue where using ssl connection with
// timeout > 0 causes connection errors (https://bugs.php.net/bug.php?id=54511)
$rcmail_config['smtp_timeout'] = 0;

Offline vish213

  • Newbie
  • *
  • Posts: 7
Re: Setting up Roundcube and Mercury Mailserver
« Reply #7 on: January 28, 2014, 04:48:32 PM »
I'm almost there. I can send and receive local mail. Roundcube is also able to send out mail to other domains (Yahoo/Gmail) but when it hits the Mercury SMTP client for transfer, the MX resolves but I get things like this:

Resolved MX for 'yahoo.com' to 66.196.118.37
Connecting to 98.136.216.25
Connection error.
Attempting connection to alternate, 98.138.112.32
Connection error on alternate.
Attempting connection to alternate, 66.196.118.37
Connection error on alternate.

And similar results for Gmail. The Yahoo one also tries other IPs that those above.