Author Topic: Problem with vacation plugin  (Read 17465 times)

Offline calvadoz

  • Newbie
  • *
  • Posts: 3
Problem with vacation plugin
« on: October 28, 2013, 10:24:35 PM »
I have many problems with my roundcube vacation plugin.

Before I install to my real server, I testing on VMware workstaion 9.
I installed Roundcube version 0.9.4 and PHP version 5.3.2

At First, I downloaded plugin package from Github (https://github.com/bhuisgen/rc-vacation/)
and already settings all to use via SQL server. Postfix, Cyrus-Imap are work to send an e-mail. Vacation plugin tab is appear too.
All of things seem to be good but when I enable vacation plugin by checked a enable box and type a message in message box.
It's successfully save and I try to test by sending an e-mail. It's normal received not have an auto reply mail like I setting.
So I try again by check enable box, type messages and save (It's successfully save) then click another tab one time.
After that I click vacation tab again, it's showed that I'm not enable. I go to saw a log file and got this error.

"  PHP Error : Failed to load config from /var/www/html/roundcubemail/plugins/vacation/config.inc.php in /var/www/html/roundcubemail/program/lib/Roundcube/rcube_plugin.php on line 121 "

Don't know what is a cause of problem and find out many issue to solve problem but it did not work.
So I snapshot this stage and try install vacation 1.9.9 and settings all again.
I downloaded vacation 1.9.9 from Sourceforge (http://sourceforge.net/projects/rcubevacation/files/)
I setting vacation 1.9.9 to use via Virtual(SQL) server, Postfixadmin.
All setting is works. Can send an e-mail. Vacation tab is appear too.
But when click on vacation tab, it showd this error

" Fatal error : Class 'rcube_mbd2' not found in /var/www/html/roundcubemail/plugins/vacation/lib/virtual.calss.php on line 26 "

I try to install pear-MBD2 and other dependencies package but it can not fix.
One topic in trac.roundcube.net said that this error means vacation 1.9.9 is not suitable with Roundcube version 0.9.x, Is it right?

I snapshot again and go back to stage one with old version of vacation that still have error.
I try again to search on google how to fix this problem and install Xdebug 2.2.3 from Roundcube advice and got log like this

" PHP Error in /var/www/html/roundcubemail/program/lib/Roundcube/rcube_plugin.php (121): Failed to load config from /var/www/html/roundcubemail/plugins/vacation/config.inc.php

Warning: Invalid argument supplied for foreach() in /var/www/html/roundcubemail/plugins/vacation/drivers/sql.php on line 194 Call Stack: 0.0009 760328
1. {main}() /var/www/html/roundcubemail/index.php: 0 0.0642 7582992
2. rcube_plugin_api->exec_action() /var/www/html/roundcubemail/index.php:277 0.0642 7583040
3. call_user_func() /var/www/html/roundcubemail/program/lib/Roundcube/roundcube_plugin_api.php:340 0.0642 7583040
4. vacation->vacation_save() /var/www/html/roundcubemail/program/lib/Roundcube/roundcube_plugin_api.php:340 0.0642 7583040
5. vacation->write_data() /var/www/html/roundcubemail/plugins/vacation/drivers/vacation.php:70 0.0653 7664088
6. vacation_write() /var/www/html/roundcubemail/plugins/vacation/drivers/vacation.php:443 "


Could you please help me to fix this problem. I don't know what to do.
Thank you.

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,881
    • SKaero - Custom Roundcube development
Re: Problem with vacation plugin
« Reply #1 on: October 29, 2013, 12:15:04 AM »
Read the INSTALL file in the plugin folder.

Offline calvadoz

  • Newbie
  • *
  • Posts: 3
Re: Problem with vacation plugin
« Reply #2 on: October 29, 2013, 05:31:17 AM »
Quote
INSTALL

Requirements :
- jQuery UI for vacation date support.
- PEAR Net/LDAP2 module for LDAP driver.

To install this plugin, copy his directory into the 'plugins' directory of your
Roundcube instance and activate it by adding his name 'vacation' to the option
array 'plugins' in config/main.inc.php :

   // List of active plugins (in plugins/ directory)
   $rcmail_config['plugins'] = array('vacation');

Edit the plugin configuration file 'config.inc.php'. You must choose the
driver for your backend storage and configure his options.

For more information, please take a look in the directory /doc.

Above is all text in INSTALL file.
I'm sure that I have read and already did following that instruction.
Have any suggestion?

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,881
    • SKaero - Custom Roundcube development
Re: Problem with vacation plugin
« Reply #3 on: October 29, 2013, 12:44:16 PM »
You need to do the following:
Code: [Select]
Edit the plugin configuration file 'config.inc.php'. You must choose the
driver for your backend storage and configure his options.

Offline calvadoz

  • Newbie
  • *
  • Posts: 3
Re: Problem with vacation plugin
« Reply #4 on: October 29, 2013, 11:22:30 PM »
Here is my 'config.inc.php' setting in vacation plugin.
Code: [Select]
?php

/*
 +-----------------------------------------------------------------------+
 | Configuration file for vacation module                              |
 |                                                                                          |
 | Copyright (C) 2009 Boris HUISGEN <bhuisgen@hbis.fr>  |
 | Licensed under the GNU GPL                                            |
 +-----------------------------------------------------------------------+
*/

$config = array();

// allow vacation start/end dates
$config['vacation_gui_vacationdate'] = TRUE;

// allow vacation subject
$config['vacation_gui_vacationsubject'] = TRUE;

// allow HTML for vacation message
$config['vacation_gui_vacationmessage_html'] = FALSE;

// allow sending message to be keep in inbox
$config['vacation_gui_vacationkeepcopyininbox'] = FALSE;

// allow vacation forwarder
$config['vacation_gui_vacationforwarder'] = FALSE;

// default vacation subject
$config['vacation_subject_default'] = 'Out of office';

// default vacation message
$config['vacation_message_default'] = 'I\'m currently out of office.';

// vacation start/end date format
$config['vacation_dateformat'] = 'm/d/Y';


// jquery calendar (jqueryui plugin must be enabled)
$config['vacation_jquery_calendar'] = TRUE;
$config['vacation_jquery_dateformat'] = 'mm/dd/yy';

// add MIME header before the message
$config['vacation_message_mime'] = '';

// allow multiple forwarders
$config['vacation_forwarder_multiple'] = TRUE;
$config['vacation_forwarder_separator'] = ';';

// driver used for backend storage
$config['vacation_driver'] = 'SQL';


/*
 * SQL driver
 */

// database DSN
$config['vacation_sql_dsn'] =
        'mysql://roundcubeuser:XXXXX@localhost/roundcubedb';

// read data queries
$config['vacation_sql_read'] =
        array("SELECT subject AS vacation_subject, body AS vacation_message, " .
                  "active AS vacation_enable FROM vacation " .
              "WHERE email=%username AND domain=%email_domain;"
             );

// write data queries
$config['vacation_sql_write'] =
        array("DELETE FROM vacation WHERE email=%email AND " .
                 "domain=%email_domain;",
          "DELETE from vacation_notification WHERE on_vacation=%email;",
          "DELETE FROM alias WHERE address=%email AND " .
                 "domain=%email_domain;",
              "INSERT INTO vacation (email,domain,subject,body,created," .
                 "active) VALUES (%email,%email_domain,%vacation_subject," .
                    "%vacation_message,NOW(),%vacation_enable);",
          "INSERT INTO alias (address,goto,domain,created,modified," .
                 "active) " .
             "SELECT %email,CONCAT(%email,',',%email_local,'#',%email_domain,'@'," .
                "'autoreply.my.domain'),%email_domain,NOW(),NOW(),1 " .
             "FROM mailbox WHERE username=%email AND " .
                "domain=%email_domain AND %vacation_enable=1;",
          "INSERT INTO alias (address,goto,domain,created,modified," .
                 "active) " .
             "SELECT %email,%email,%email_domain,NOW(),NOW(),1 " .
             "FROM mailbox WHERE username=%email AND " .
                "domain=%email_domain AND %vacation_enable=0;"
         );

// end vacation config file

And this is 'config.inc.php' setting in Roundcube.
Code: [Select]
<?php

/* Local configuration for Roundcube Webmail */

// PEAR database DSN for read/write operations
// format is db_provider://user:password@host/database 
// For examples see http://pear.php.net/manual/en/package.database.mdb2.intro-dsn.php
// currently supported db_providers: mysql, mysqli, pgsql, sqlite, mssql or sqlsrv
$config['db_dsnw'] = 'mysql://roundcubeuser:XXXXX@localhost/roundcubedb';

// ----------------------------------
// LOGGING/DEBUGGING
// ----------------------------------
// system error reporting, sum of: 1 = log; 4 = show, 8 = trace
$config['debug_level'] = 4;

// ----------------------------------
// IMAP
// ----------------------------------
// The mail host chosen to perform the log-in.
// Leave blank to show a textbox at login, give a list of hosts
// to display a pulldown menu or set one host as string.
// To use SSL/TLS connection, enter hostname with prefix ssl:// or tls://
// Supported replacement variables:
// %n - hostname ($_SERVER['SERVER_NAME'])
// %t - hostname without the first part
// %d - domain (http hostname $_SERVER['HTTP_HOST'] without the first part)
// %s - domain name after the '@' from e-mail address provided at login screen
// For example %n = mail.domain.tld, %t = domain.tld
// WARNING: After hostname change update of mail_host column in users table is
//          required to match old user data records with the new host.
$config['default_host'] = '127.0.0.1';

// ----------------------------------
// SMTP
// ----------------------------------
// SMTP server host (for sending mails).
// To use SSL/TLS connection, enter hostname with prefix ssl:// or tls://
// If left blank, the PHP mail() function is used
// Supported replacement variables:
// %h - user's IMAP hostname
// %n - hostname ($_SERVER['SERVER_NAME'])
// %t - hostname without the first part
// %d - domain (http hostname $_SERVER['HTTP_HOST'] without the first part)
// %z - IMAP domain (IMAP hostname without the first part)
// For example %n = mail.domain.tld, %t = domain.tld
$config['smtp_server'] = '127.0.0.1';

// provide an URL where a user can get support for this Roundcube installation
// PLEASE DO NOT LINK TO THE ROUNDCUBE.NET WEBSITE HERE!
$config['support_url'] = '';

// this key is used to encrypt the users imap password which is stored
// in the session record (and the client cookie if remember password is enabled)
.
// please provide a string of exactly 24 chars.
$config['des_key'] = '9ZSczqPIoh1J6dXm+EB%n=B0';

// ----------------------------------
// PLUGINS
// ----------------------------------
// List of active plugins (in plugins/ directory)
$config['plugins'] = array('vacation');

// ----------------------------------
// USER INTERFACE
// ----------------------------------
// default messages sort column. Use empty value for default server's sorting, 
// or 'arrival', 'date', 'subject', 'from', 'to', 'fromto', 'size', 'cc'
$config['message_sort_col'] = 'subject';

// the default locale setting (leave empty for auto-detection)
// RFC1766 formatted language name like en_US, de_DE, de_CH, fr_FR, pt_BR
$config['language'] = 'en_US';

// display remote inline images
// 0 - Never, always ask
// 1 - Ask if sender is not in address book
// 2 - Always show inline images
$config['show_images'] = 1;

// compose html formatted messages by default
// 0 - never, 1 - always, 2 - on reply to HTML message, 3 - on forward or reply 
to HTML message
$config
['htmleditor'] = 1;

// default setting if preview pane is enabled
$config['preview_pane'] = true;

// Set to true to never delete messages immediately
// Use 'Purge' to remove messages marked as deleted
$config['flag_for_deletion'] = true;

// lifetime of message cache
// possible units: s, m, h, d, w
$config['message_cache_lifetime'] = '10d';

PS. I update Roundcube so from main.inc.php, db.inc.php to default.inc.php,config.inc.php.
« Last Edit: October 29, 2013, 11:39:14 PM by calvadoz »