Roundcube Community Forum

Third Party Contributions => API Based Plugins => Topic started by: deltatech on April 26, 2011, 04:48:44 PM

Title: Problem with Accounts Plugin
Post by: deltatech on April 26, 2011, 04:48:44 PM
I am having trouble getting the accounts plugin to work with Gmail.   It is able to log in and read the folders and messages just fine.

The problem is sending.   I have this setting

$rcmail_config['accounts_smtp_default'] = false;

I was hoping that it would authenticate with Gmail's SMTP server and send thru it but it gives me "SMTP Error (-1): Authentication failed"  every time.  

I could send thru the default or local SMTP server however this won't work if sending to other gmail users because gmail will know it wasn't sent via gmail and will reject it as spam.  

Is there any way to get the authentication to work properly for sending via gmail?

Here is my configuration.

Code: [Select]
/*accounts plugin */

// navigation config (requires plugin settings @website http://myroundcube.googlecode.com)
$rcmail_config['settingsnav'][] = array('part' => '', 'locale' => 'settings.accounts', 'href' => './?_task=settings&_action=plugin.accounts&_framed=1', 'onclick' => '', 'descr' =

/* database table name */
$rcmail_config['db_table_accounts'] = 'accounts';

/* allowed hosts ::: array() = all */
$rcmail_config['accounts_hosts'] = array(
  "Delta" => "localhost",
  "Google Mail" => "ssl://imap.gmail.com:993"
);

/* always use default smtp server */
$rcmail_config['accounts_smtp_default'] = false;

/* imap_open flag (http://php.net/manual/en/function.imap-open.php) */
$rcmail_config['imap_open_flag'] = 'novalidate-cert';

Title: Problem with Accounts Plugin
Post by: rosali on April 27, 2011, 05:17:43 AM
It tries to send via your Roundcube defined SMTP-Server.

There is a patch Issue 55 - myroundcube - Accounts-Plugin, each account own smtp-server? - RoundCube Plugins - Google Project Hosting (http://code.google.com/p/myroundcube/issues/detail?id=55) to allow user defined SMTP hosts.

Feel free to apply this patch into the recent plugin version. Send me a copy an will update the plugin.
Title: Problem with Accounts Plugin
Post by: deltatech on April 27, 2011, 08:19:51 PM
Quote from: rosali;34441
It tries to send via your Roundcube defined SMTP-Server.

There is a patch Issue 55 - myroundcube - Accounts-Plugin, each account own smtp-server? - RoundCube Plugins - Google Project Hosting (http://code.google.com/p/myroundcube/issues/detail?id=55) to allow user defined SMTP hosts.

Feel free to apply this patch into the recent plugin version. Send me a copy an will update the plugin.

That worked great..   Only one problem left..

When I have an account selected that is other than the main account, and then go to the Settings->Special Folders they are all unassigned and i can make a real mess with that..  Special folders is confused as to which account we are editing when using any account except the main account.
Title: Problem with Accounts Plugin
Post by: deltatech on April 27, 2011, 09:55:13 PM
After further research I can now better define the folder problem when using the accounts problem.

I have 4 accounts setup.   The primary account,  gmail, and two more accounts that are on local host.

When switching from account to account the special folders remain intact until I switch to gmail and then back to the primary account.  The primary account forgets all the definitions of special folders.

Once this happens, the only way to fix it is to either log out and back in or, go to settings and reassign the folders.    

It seems that the problem is when switching accounts from a foriegn account back to the default server, it doesn't reload the prefs from the user table as it should.
Title: Also having problems with accounts plugin
Post by: billstif on May 02, 2011, 07:27:04 PM
I have been able to get the accounts plugin to work with all of my Roundcube accounts, but I cannot get it to work with Gmail or Yahoo.

In the config.inc.php file for the allowed hosts array, I have included

   "Google Mail" => "ssl://imap.gmail.com:993|ssl://smtp.gmail.com:465",
   "Yahoo Mail" => "ssl://imap.mail.yahoo.com:993"
);

I get an immediate cannot login to remote host for Google, and a long delay before the same message regarding Yahoo Mail.

I also changed
$rcmail_config['accounts_smtp_default'] = FALSE;

so I could use the Gmail smtp.

What am I missing?
Title: Patch
Post by: billstif on May 02, 2011, 07:29:15 PM
I've seen the reference to the Issue 55 patch dated 2007.  Is that still a fix, and if so, how do I apply the patch?
Title: Problem with Accounts Plugin
Post by: rosali on May 03, 2011, 12:47:11 AM
Don't mix up configs. Your config requires the patch.
Title: Problem with Accounts Plugin
Post by: billstif on May 03, 2011, 01:19:48 AM
I'm sorry.  You lost me.  Are you saying the patch applies to the accounts config.inc.php file?  And, if so, how do I apply the patch?

Quote from: rosali;34592
Don't mix up configs. Your config requires the patch.
Title: Problem with Accounts Plugin
Post by: rosali on May 03, 2011, 01:35:37 AM
I meant, you are using configuration settings which require the patch.

PM User Deltatech. He has applied the patch. Maybe he shares the code.
Title: Applied Patch
Post by: billstif on May 03, 2011, 03:07:58 AM
Once I saw how the patch worked (identifies file, indicates line to delete (-), indicates line to add (+), I loaded the patch myself, but somewhere I made a mistake because the localization file had me replace the label account_host with account_provider, but in Accounts Administration, the program is still calling for the missing label for [account_host].

Remote IMAP Accounts ::: bill@billstifler.org
Account Name:  
Login ID:  
Password:  
Confirm Password:  
[account_host]:

Apparently, I missed changing a line somewhere.  Whatever the problem is, it is not registering a log entry in the Roundcube error log.
Title: Update
Post by: billstif on May 04, 2011, 08:10:44 AM
I went back through the patch with a clean copy of the accounts plugin files and successfully made the changes.  I also fixed the problem I was having with the SQL.  Unfortunately, while the plugin works for Roundcube accounts, I still cannot get it to access either Gmail or Yahoo Mail.  Anyone else having a similar problem or have any other suggestions?
Title: Problem with Accounts Plugin
Post by: rosali on May 04, 2011, 10:07:28 AM
Does your PHP support SSL (Module OpenSSL)?
Title: Ssl
Post by: billstif on May 04, 2011, 09:58:31 PM
As best I can tell, yes.  I use Hostmonster as my web provider.
Title: Problem with Accounts Plugin
Post by: rosali on May 05, 2011, 12:46:15 AM
Any chance for Remote access (IMAP test account and FTP to Roundcube root folder)?

EDIT: Maybe your provider blocks Port 993. You could test it by setting up Roundcube to use Google servers instead of your own IMAP/SMTP server.
Title: Problem with Accounts Plugin
Post by: rosali on May 05, 2011, 12:55:22 AM
https://my.hostmonster.com/cgi/help/405?step=405
Title: RE: SSL Certificate
Post by: billstif on May 05, 2011, 09:25:33 AM
Thanks.  If I understand the Hostmonster link you sent me, I can only set things up to access Yahoo and Google if I purchase the dedicated SSL certificate?  

Thanks for your help with this.  I guess I will have to decide if the convenience is worth the added expense.  :)
Title: Problem with Accounts Plugin
Post by: SKaero on May 05, 2011, 09:35:57 AM
You'd need to get a dedicated IP according to there documentation. Alternatively you could switch to a host that don't block the ports you need.
Title: Accounts plugin with Roundcube default identities
Post by: billstif on May 10, 2011, 10:52:38 AM
In one of my accounts, I have set the default identity as different from the account identity.  The account is set up to handle submissions, and I have an auto-responder that thanks them for the submission.  I set up a separate account for correspondence, and in the submissions account made that separate account the default identity.

The problem I run into is that when I switch to the submissions account using the account plugin, it reverts to the submissions address as default instead of picking up the other account as the default sender.  Is there any way I can fix this?


BTW, again, thanks to all of you for your help regarding the SSL certificate issue.
Title: Problem with Accounts Plugin
Post by: rosali on May 11, 2011, 12:00:29 AM
No, that's intended. If you want to fix it, you have to modify the code.
Title: tls support !?
Post by: cybert on May 20, 2011, 01:35:41 PM
Had a problem with tls. 'tls' mode is not forwarded to rcube_imap.php.

My problem is solved after adding  "$imap_ssl=$prot" in accounts.php @version 2.0 - 05.05.2011 :
....
if($url['scheme'] == "tls" || $url['scheme'] == "ssl"){
        $prot = $url['scheme'];
        $imap_ssl = $prot;
}
...