Roundcube Community Forum

 

Accounts plugin

Started by doctor madness, December 09, 2009, 04:06:30 AM

Previous topic - Next topic

doctor madness

Hi,

I'd like to use an external IMAP account from roundcube. I enabled accounts (and settings) plugin, I added my server in the list, then I try to create account from "Account administration"
but when I click "Add" button, I get the following error :
"Failed to establish connexion to remote host"

I can connect on port 143 to this host from the server hosting roundcube.
I don't see any error log, what should I do ?

rosali

Use this test script to check if you are really able to connect from hosting server:


<?php

function test_connection($username,$password,$imap_host,$imap_port,$prot){ 
                 
     if(
function_exists("imap_open")){ 
      if(
$prot){ 
         
$imap_open "{" $imap_host ":" $imap_port "/imap/" $prot "/novalidate-cert}INBOX"
       } 
       else{ 
         
$imap_open "{" $imap_host ":" $imap_port "/novalidate-cert}INBOX"
       } 
      
       if(
$res = @imap_open($imap_open$username$password)){ 
         
$success true
         
imap_close($res); 
       } 
       else{ 
         
$success false
       } 
     } 
     else{ 
       
$success true
     } 
        
     return 
$success
    
   }

   
// DO NOT EDIT
   
if(test_connection("[email protected]","demo","mail4us.net",143,false))
     echo 
"mail4us.net ok
"
;
   else
     echo 
"mail4us.net failed
"
;

   
//EDIT USER AND PASSWORD
   
if(test_connection("[email protected]","mygooglepassword","imap.gmail.com",993,"ssl"))
     echo 
"ssl google ok
"
;
   else
     echo 
"ssl google failed
"
;
?>
Regards,
Rosali

doctor madness

#2
Hi,

i just tested :
$php5 test.php

the mail4us.net is ok
the gmail is failed

I added my server like this :
if(test_connection("login","password","my.imap.server",143,false))
     echo "my_own ok
";
   else
     echo "my_own failed
";
and my_own imap server is failed too.
It's an IMAP server. I can connect on it using :
telnet my.imap.server 143
Using thunderbird and other MUA is working too

It's php5 from debian stable.
any idea ?

doctor madness

no one to help me with this little problem ?

rosali

Does 'localhost' work for your own IMAP server? Gmail might fail due to missing ssl support of your PHP installation.
Regards,
Rosali

doctor madness

#5
the test on my locahost is working.
I think it may be related to the remote host. but this hosts is a corporate mail server. where hundreds or thousands people check their mails daily using IMAP (and/or POP)
so I think it should be a bad implementation of IMAP on server side, or php5 imap module

rosali

#6
Are you able to connect to gmail by configuring main.inc.php to use ssl://imap.gmail.com:993 ?
Regards,
Rosali

doctor madness

Hi,

I'm not able to connect to gmail. Maybe I need some php modules, to deal with SSL, no ?

SKaero

A lot of hosts block port 993 outbound, I say that's would be the first thing to check.

doctor madness

nc -vz imap.gmail.com 993
DNS fwd/rev mismatch: gmail-imap.l.google.com != ew-in-f109.1e100.net
gmail-imap.l.google.com [74.125.77.109] 993 (imaps) open


It seems to be OK. This computer is on a unfiltered network

SKaero

When to try to connect to gmail using RoundCube what shows up in the error log?

doctor madness

Hi,

In my errors log file, I don't have anything regarding problem with Gmail.
I really think the problem with Gmail is due to SSL. Maybe a PEAR module is needed, no ?

My original problem is the access to a non SSL IMAP server. I can connect to mail4us.net using code provided by Rosali. But I can't connect to one of  mine...

rosali

Remove "@" sign in front of imap_open command. Perhaps you get some hints by the error message when connection fails.
Regards,
Rosali

doctor madness

Here are the errors reported when I execute your code without the @ before imap_open :
Warning: imap_open(): Couldn't open stream {imap.gmail.com:993/imap/ssl/novalidate-cert}

doctor madness

No idea on this issue ?