Roundcube Community Forum

Release Support => Pending Issues => Topic started by: KeyJockey on February 07, 2013, 11:54:55 PM

Title: RoundCube and CloudFlare ?
Post by: KeyJockey on February 07, 2013, 11:54:55 PM
Has anyone ever had a problem using a custom installation of RoundCube (as opposed to an install provided by web hosting company) on a site using the CloudFlare content delivery network?

Reason I ask is: we recently MOVED our site to a different web host, the old host had CloudFlare and it seemed to work fine with our custom RoundCube installation.  RoundCube on our NEW host site WAS -- at first -- working fine too, earlier today after the migration completed.  It seemed faster too...

BUT THEN I turned ON the CloudFlare service again in the new Hosting CPanel... and shortly afterwards our webmail via the custom RoundCube installation on our site stopped working.  Login attempt fails with a message, "Connection to storage server failed."

Webmail still works okay via the RoundCube accessed thru CPanel (i.e. host provided version of RC, not our own copy) however.

Not sure what's going on here, exactly, or how to fix it.  Any help/ideas?

Thanks,

-JohnC
Title: Re: RoundCube and CloudFlare ?
Post by: SKaero on February 08, 2013, 12:39:07 AM
I haven't tried it but the host provided RoundCube (ie in cPanel) wouldn't be using CloudFlare.
Title: Re: RoundCube and CloudFlare ?
Post by: KeyJockey on February 08, 2013, 07:53:53 AM
Yeah, I figured as much.  But -- weird thing is -- on the OLD hosting it worked fine, didn't seem any different either way with CloudFlare turned ON or OFF... didn't affect anything.  So why now would it be different on this new web host? 

Unfortunately we can't really just send users to the version of RC offered by the host because OUR install uses a customized skin to integrate e-mail access into our site, and the host version has no provision to install our special skin for it.  Also going thru the CPanel version is a couple steps whereas our custom version is one click...

-JC

P.S. {Edit} By the way, it definitely seems to be a CloudFlare issue, because just now I set the CloudFlare service on "pause" and then a few minutes later, our customized RoundCube page started working again: it logged me in on a refresh of the page and seems ok now...
Title: Re: RoundCube and CloudFlare ?
Post by: KeyJockey on February 12, 2013, 11:53:42 PM
Well it's been going on for a WEEK now, back and forth with CloudFlare tech support trying to pin this down, BUT apparently -- as of now -- it has to do with the WAY a website is signed up for the CloudFlare service in the first place.   ???

If you sign up thru your hosting account's Control Panel it ends up configured somehow different from if you sign up "direct" on the CloudFlare site... and in our case the former meant our RoundCube setup still worked okay (on our old hosting service) but doing it the latter way apparently is causing our RoundCube setup to not work any more (i.e. on our new hosting service).

Or, at least, that's what it looks like so far.
I'm still trying to understand what's going on.
Seems it has to do with DNS records and CNAME versus "A"... or something.
Dunno yet.

I'll post more here if/when anything is resolved with any certainty.
Title: Re: RoundCube and CloudFlare ?
Post by: KeyJockey on February 15, 2013, 12:07:02 PM
UPDATE: Someone finally figured this out and it's (apparently) fixed now... I hope.   :P

I received the following message from HostGator tech support this morning.  Everything appears working now in my first limited tests but I'll be checking it a bit more later to be sure.

Anyway for future reference in case other RoundCubers ever encounter a similar situation, here's the answer.

---------------

Hello,

I am sorry that this ticket has gone on so long and you have been bouncing from one place to the next to find the answer.

I have corrected the issue for you at this time and your webmail now works with Cloudflare.

The problem is with how Cloudflare works, and how it was working at HostMonster vs. with us at HostGator.

At HostMonster, you were not using Cloudflare directly, but through a proxy system that they have, this meant that your domains main IP, was still the main IP of your hosting account at HostMonster.

With HostGator, you are using Cloudflare directly, including Cloudflare's DNS servers. Basically this means that though we are hosting the files, all your traffic goes directly to Cloudflare before moving along to get the files from us!

Now, I understand most of that is confusing, so what really is important to know is the following:

RoundCube was configured to check your mail at your *.com domain name which was pointed at Cloudflare first, and NOT HostGator.

So RoundCube was trying to access the Cloudflare's servers to find mail, which there was no mailserver to connect to. Causing the error.

When you disabled Cloudflare, it pointed your domain back straight at HostGator, so suddenly the mail worked. RoundCube would connect to your domain, which was pointed straight at HostGator and connect.

Now to resolve the issue, I modified the RoundCube configurations to connect to "gatorXXX.hostgator.com" instead. This is the physical hostname of the server that you are on. (Note: actual server name redacted XXX above)

This way, when you use Cloudflare, your website can point to Cloudflare first, but when people check their mail, RoundCube internally connects straight to the HostGator server, and no where else.

If you need any further assistance, Please do not hesitate to let us know

Kind regards,

HostGator.com LLC
http://support.hostgator.com
Title: Re: RoundCube and CloudFlare ?
Post by: KeyJockey on February 15, 2013, 03:06:51 PM
Hmm... one other thought, though, maybe before this can be moved to "resolved"?

Does having the domain name in the config file NOT be the actual site that Roundcube is installed on, i.e. it being changed from:

"ourwebsite.com"

to

"gatorXXX.hostgator.com"

...have any possible implications or complications for other things that the program needs, or assumes?

I mean for things like the user just putting in their account name and assuming the "@domain" part of the login will be picked up from the site that the mail system's running on.... stuff like that?

-JC
Title: Re: RoundCube and CloudFlare ?
Post by: SKaero on February 16, 2013, 04:36:37 PM
Any domain should work as long as the mx is right. I tend to use localhost or the mail servers IP address to avoid any domain problems.
Title: Re: RoundCube and CloudFlare ?
Post by: KeyJockey on February 18, 2013, 08:56:04 AM
OK then this thread can probably go into "resolved"...

Thanks,

-JC