Author Topic: Accounts plugin  (Read 15045 times)

Offline doctor madness

  • Jr. Member
  • **
  • Posts: 21
Accounts plugin
« on: December 09, 2009, 04:06:30 AM »
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 ?

Offline rosali

  • Hero Member
  • *****
  • Posts: 2,533
Accounts plugin
« Reply #1 on: December 09, 2009, 06:26:50 AM »
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("demo@mail4us.net","demo","mail4us.net",143,false))
     echo 
"mail4us.net ok
"
;
   else
     echo 
"mail4us.net failed
"
;

   
//EDIT USER AND PASSWORD
   
if(test_connection("mygoogleaccount@gmail.com","mygooglepassword","imap.gmail.com",993,"ssl"))
     echo 
"ssl google ok
"
;
   else
     echo 
"ssl google failed
"
;
?>
Regards,
Rosali
__________________
MyRoundcube Project (commercial)

Offline doctor madness

  • Jr. Member
  • **
  • Posts: 21
Accounts plugin
« Reply #2 on: December 09, 2009, 01:24:32 PM »
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 ?
« Last Edit: December 11, 2009, 06:16:51 AM by doctor madness »

Offline doctor madness

  • Jr. Member
  • **
  • Posts: 21
Accounts plugin
« Reply #3 on: December 11, 2009, 08:14:27 AM »
no one to help me with this little problem ?

Offline rosali

  • Hero Member
  • *****
  • Posts: 2,533
Accounts plugin
« Reply #4 on: December 11, 2009, 08:19:01 AM »
Does 'localhost' work for your own IMAP server? Gmail might fail due to missing ssl support of your PHP installation.
Regards,
Rosali
__________________
MyRoundcube Project (commercial)

Offline doctor madness

  • Jr. Member
  • **
  • Posts: 21
Accounts plugin
« Reply #5 on: December 11, 2009, 09:25:51 AM »
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
« Last Edit: December 11, 2009, 09:56:52 AM by doctor madness »

Offline rosali

  • Hero Member
  • *****
  • Posts: 2,533
Accounts plugin
« Reply #6 on: December 12, 2009, 01:11:01 AM »
Are you able to connect to gmail by configuring main.inc.php to use ssl://imap.gmail.com:993 ?
« Last Edit: December 15, 2009, 02:47:08 PM by rosali »
Regards,
Rosali
__________________
MyRoundcube Project (commercial)

Offline doctor madness

  • Jr. Member
  • **
  • Posts: 21
Accounts plugin
« Reply #7 on: December 15, 2009, 01:28:09 PM »
Hi,

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

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,876
    • SKaero - Custom Roundcube development
Accounts plugin
« Reply #8 on: December 15, 2009, 01:41:29 PM »
A lot of hosts block port 993 outbound, I say that's would be the first thing to check.

Offline doctor madness

  • Jr. Member
  • **
  • Posts: 21
Accounts plugin
« Reply #9 on: December 16, 2009, 02:44:35 AM »
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

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,876
    • SKaero - Custom Roundcube development
Accounts plugin
« Reply #10 on: December 16, 2009, 06:48:06 AM »
When to try to connect to gmail using RoundCube what shows up in the error log?

Offline doctor madness

  • Jr. Member
  • **
  • Posts: 21
Accounts plugin
« Reply #11 on: December 21, 2009, 04:35:47 AM »
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...

Offline rosali

  • Hero Member
  • *****
  • Posts: 2,533
Accounts plugin
« Reply #12 on: December 21, 2009, 04:50:28 AM »
Remove "@" sign in front of imap_open command. Perhaps you get some hints by the error message when connection fails.
Regards,
Rosali
__________________
MyRoundcube Project (commercial)

Offline doctor madness

  • Jr. Member
  • **
  • Posts: 21
Accounts plugin
« Reply #13 on: December 21, 2009, 02:32:40 PM »
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}

Offline doctor madness

  • Jr. Member
  • **
  • Posts: 21
Accounts plugin
« Reply #14 on: January 04, 2010, 02:36:53 AM »
No idea on this issue ?