Roundcube OC Installation and usage

PICCORO Lenz McKAY edited this page Feb 17, 2017 · 8 revisions

The rouncube app enables a menu entry for visit email, a integration symtpom inside owncloud, throught automatic login (or customized, see below) of user credentials, one user login inside owncloud.

RoundCube Requeriments

  • An roundcube instalation in same web server (for different server setup see avanced installation below)
  • An owncloud instalation in same web server (for different cluster cloud must install in each cluster)
  • Set the xframe_restriction to false due some issues usage of frames for mail rendering
  • Same user and password for autologin feature, if username are differents use custom login
  • curl installed for app or if used very older releases fopen needs to be active.

allow_url_fopen is generally set to On. If it is not On, then you can try two things:

  1. Create an .htaccess file and keep it in root folder ( sometimes it may need to place it one step back folder of the root) and paste this code there. php_value allow_url_fopen On
  2. Create a php.ini file (for update server php5.ini) and keep it in root folder (sometimes it may need to place it one step back folder of the root) and paste the following code there: allow_url_fopen = On;

Roundcube app installation

normal procedure setup

  1. Enable it the app store in config.php and go to apps menu. If app are now show in list so then download the app from app.owncloud.com or from releases, and uncompres it into "/apps" directory of u'r installation, and thens go to "Applications" in menu (loged in as admin user).
  2. So firts enable the app "Bookmarks", and refresh the screen, one verified "bookmarks" are enable and working, go to app menu and then enable the "RoundCube Mail App" ( Apps > RoundCube Mail [3rd party] > Enable )
  3. Now go to administration and in roundcube section type your roundcubedir in the administrator-settings (e.g. /mail, relative to the webserver root directory), by default /roundcube are used in default roundcube installations. Note that if u'r installation are from a non exposed dir, u must setup and alias for u'r web server root, so the app can see the the roundcubedir. This dir are the root path of the roundcube installation that users visit. For example if you're using https://domain.net/owncloud and roundcube mail are https://domain.net/mail so then, as picture show just enter mail here Configuring the roundcube installation path If you're accessing owncloud via https://owncloud.domain.net and roundcube mail at https://domain.net/mail then enter https://domain.net/mail as full url. Take in consideration x-frame-politics of the browsers.
  4. Plugin has two mode of work, autologin and custo manual login, select dessired method, optional type encryptionstrings (your mailuser and password will be crypted)
  5. If u are using custom login, type your mail-username and mail-password in your personal settings Configuring your email account settings

IMPORTANT: you must logout and login from owncloud for take efect the autologin feature.

Custom different server setup tips

Subdomain troubles

If your setup is something like this:

You can set the path to /oc_testing/mysql/roundcube/ (step 2), http://roundcube.com (step 3) for the server hostname: Configuring your email account settings

IMPORTANT: Keep in mind that this only works if owncloud and roundcube are running on the same browser (Same-Origin Policy!)

Separate server for RC and OC: URL reverse proxy setup

If your using roundcube on another server not same as the used for owncloud installation you must redirect roundcube url to the used roundcubedir in the owncloud web server via a proxy redirect, due roundcube must see the root rounducbe directory in same webserver. For Lighttpd are easy like enable the modproxy and then see examles in last section of this page, where u find some more for others.

  1. follow the normal instalation and use a virtual (will be the proxy root dir) root directory ( was used /mail/ in the previously example.
  2. configure a proxy in the webserver that takes as source the real web url of different roundcube in the other webserver.
  3. Ensure, that the following config for roundcube (main.inc.php):
$rcmail_config['ip_check'] = false;
...
// X-Frame-Options HTTP header value sent to prevent from Clickjacking.
// Possible values: sameorigin|deny. Set to false in order to disable sending them
$rcmail_config['x_frame_options'] = false;

IMPORTANT: you must logout and login from owncloud for take efect the autologin feature.

Manual Removal, Updating tips

In some circunstances removal of app cn be do it, due some error when installing. If this happened follow that:

  • firts remove it from the apps-folder
  • then in owncloud and execute the following sql commands:
 DELETE FROM owncloud.oc_appconfig WHERE appid="roundcube"; 
 DELETE FROM owncloud.oc_preferences WHERE appid="roundcube"; 
 DROP TABLE owncloud.oc_roundcube;

After that you can simply reinstall the app

Usage and some tips for issues

You will see a menu entry named "Mail", visit.

The top toolbar (that now in roundcube 1.0X are autohidden) can be disabled, in admin setting, also the main toolbar that display the tabs of diffrerents roundcube apps (such Contacts or Configuration). Both can be disabled in admin on the roundcube avanced config, then save the options.

If some errors may happened, please enable debug loggin in administration in roundcube section, also enable the debug loggin in the owncloud configuration. Before made a report issue, this information are required

Some Configuration tips

Example of reverse proxy for lighttpd:

Firts enable the modproxy and then added a new conf file:

$HTTP["url"] =~ "(^/roundcube/)" {
   proxy.server  = ( "" => ("" => ( "host" => "<url of roundcube>", "port" => <port of webserver> )))
   }

where "" are the absolute ip or domain where the "roundcube" path resides, the port are the port of http or https , if use both please configure both.

Example of a proxy source for different rc in Nginx

server {
    listen 80;
    server_name cloud.cdfr.net;
    return 301 https://$server_name$request_uri;  # enforce https


server {
    listen 443 ssl;
    server_name cloud.cdfr.net;

    ssl_certificate /etc/ssl/_customs/cdfr.net.crt;
    ssl_certificate_key /etc/ssl/_customs/cdfr.net.key;

    # Path to the root of your installation
    root /var/www/cloud.cdfr.net/owncloud;
    index index.php;

    client_max_body_size 10G; # set max upload size
    fastcgi_buffers 64 4K;

    location = /robots.txt {
        allow all;
        log_not_found off;
        access_log off;
    }

    ##
    # Roundcube
    ##
    location ~ ^/roundcube(/.+?\.php) {
        root /var/www/cloud.cdfr.net;
        fastcgi_index index.php;
        fastcgi_param PATH_INFO $1;
        include fastcgi_params;
        fastcgi_pass unix:/var/run/php5-fpm.sock;
    }
    location ~ ^/roundcube {
        root /var/www/cloud.cdfr.net;
    }

    ##
    # Owncloud
    ##
    rewrite ^/caldav(.*)$ /remote.php/caldav$1 redirect;
    rewrite ^/carddav(.*)$ /remote.php/carddav$1 redirect;
    rewrite ^/webdav(.*)$ /remote.php/webdav$1 redirect;
    error_page 403 = /core/templates/403.php;
    error_page 404 = /core/templates/404.php;

    location ~ ^/(data|config|\.ht|db_structure\.xml|README) {
        deny all;
    }

    location / {
        rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
        rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last;
        rewrite ^/.well-known/carddav /remote.php/carddav/ redirect;
        rewrite ^/.well-known/caldav /remote.php/caldav/ redirect;
        rewrite ^(/core/doc/[^\/]+/)$ $1/index.html;
        try_files $uri $uri/ index.php;
    }

    location ~ ^(.+?\.php)(/.*)?$ {
        try_files $1 =404;
        include fastcgi_params;
        fastcgi_param PATH_INFO $2;
        fastcgi_param HTTPS on;
        fastcgi_pass unix:/var/run/php5-fpm.sock;
    }

    location ~* ^.+\.(jpg|jpeg|gif|bmp|ico|png|css|js|swf)$ {
        expires 30d;
        access_log off;
    }
}

Apache 2 tips for reverse proxy and oc

For apache see http://stuf.ro/internal-redirect-to-external-url-in-apache/ you need to setup a proxy for this, because due to security reasons, see http://javascript.about.com/od/reference/a/frame3.htm http://blog.chromium.org/2008/12/security-in-depth-local-web-pages.html https://groups.google.com/forum/#!msg/google-web-toolkit/MbVNus3h5QY/ftTgPdfM7r0J Here minimal instruction. See issue #33 for more details

Manual Database Configuration scripts

NOTE its not only create the tables, also must add the entry in the apps table.

MySQL

CREATE TABLE IF NOT EXISTS `*OC_DB_PREFIX*roundcube` (
  `id` Bigint(20) NOT NULL AUTO_INCREMENT,
  `oc_user` varchar(4096) NOT NULL DEFAULT ' ',
  `mail_user` varchar(4096) NOT NULL DEFAULT ' ',
  `mail_password` varchar(4096) NOT NULL DEFAULT ' ',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ;

Postgres

CREATE TABLE IF NOT EXISTS "*OC_DB_PREFIX*roundcube" ( 
  "id" Integer PRIMARY KEY, 
  "oc_user" varchar(4096) NOT NULL DEFAULT ' ',
  "mail_user" varchar(4096) NOT NULL DEFAULT ' ', 
  "mail_password" varchar(4096) NOT NULL DEFAULT ' ' 
 ); 

SQLite

CREATE TABLE IF NOT EXISTS `*OC_DB_PREFIX*roundcube` (
	`id` INTEGER PRIMARY KEY AUTOINCREMENT,
	`oc_user` varchar (4096) NOT NULL DEFAULT '',
	`mail_user` varchar (4096) NOT NULL DEFAULT '', 
	`mail_password` varchar (4096) NOT NULL DEFAULT''
);
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.