Roundcube Community Forum

Third Party Contributions => API Based Plugins => Topic started by: GO3LIN on March 26, 2015, 02:13:15 PM

Title: POP3 support for Roundcube
Post by: GO3LIN on March 26, 2015, 02:13:15 PM
Hello,

I want to add the pop3 support for roundcube, so I created a plugin where I call the storage_init hook this hook takes as parameter an array where the driver is defined, but when I changed its variable to pop3 nothing happens (even no errors).
Let me explain what I want to do:
First, I will create a class called rcube_pop which extends from rcube_storage : This class will handle all the operations from connection to editing messages. Secondly I will create a plugin that add a hook to the storage_init or storage_connect ? Where a verification in db for current user preferences if driver is pop3 then redirect to rcube_pop class. Also, I don't want to touch the core RC files, so all the files must be in the plugin folder. Can you help me to achieve this ?

Thanks for help
Title: Re: POP3 support for Roundcube
Post by: SKaero on March 26, 2015, 03:37:07 PM

storage_init hook this hook takes as parameter an array where the driver is defined

Where are you getting that info? To me it doesn't look like there is a driver return on the storage_init hook: http://trac.roundcube.net/wiki/Plugin_Hooks#storage_init
Title: Re: POP3 support for Roundcube
Post by: alec on March 27, 2015, 02:50:41 AM
You should just set storage_driver option in config, or using $RCMAIL->config->set('storage_driver', 'pop') in your plugin's init method.
Title: Re: POP3 support for Roundcube
Post by: GO3LIN on March 27, 2015, 07:39:17 AM
@alec : Thank you, this method works. Now I want to specify the path of the rcube_pop class so that all my files stay in the plugin folder. So I looked into the storage_init method in the rcube class and I found this
        if (is_object($this->storage)) {
            return;
        }


So now I can set my driver plugin properly by storing the driver object in the storage attribute :). But will this impact the other storage methods ?

@Skaero: When I print the parameter of storage_init hook here's what I get:
Array
(
    [auth_type] => check
    [auth_cid] =>
    [auth_pw] =>
    [debug] =>
    [force_caps] =>
    [disabled_caps] => Array
        (
        )

    [socket_options] =>
    [timeout] => 0
    [skip_deleted] =>
    [driver] => imap
    [host] => imap-mail.outlook.com
    [user] => [email protected]
    [port] => 993
    [ssl] => ssl
    [password] => yyyyy
    [abort] =>
)


It's not what's written in the doc by the way.