Author Topic: POP3 support for Roundcube  (Read 7255 times)

Offline GO3LIN

  • Newbie
  • *
  • Posts: 8
POP3 support for Roundcube
« 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

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,880
    • SKaero - Custom Roundcube development
Re: POP3 support for Roundcube
« Reply #1 on: March 26, 2015, 03:37:07 PM »
Code: [Select]
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

Offline alec

  • Hero Member
  • *****
  • Posts: 1,365
Re: POP3 support for Roundcube
« Reply #2 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.

Offline GO3LIN

  • Newbie
  • *
  • Posts: 8
Re: POP3 support for Roundcube
« Reply #3 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
Code: [Select]
        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:
Code: [Select]
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] => xxxxxx@hotmail.com
    [port] => 993
    [ssl] => ssl
    [password] => yyyyy
    [abort] =>
)

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