Plugin

---------

TAR File

#  cd /usr/share/roundcubemail/config/

cp /usr/share/roundcubemail/config/config.inc.php.dist /usr/share/roundcubemail/config/config.inc.php

#  cp defaults.inc.php config.inc.php

#   vi config.inc.php

RPM

# vi /etc/roundcubemail/config.inc.php

$config['plugins'] = array(   'archive',   'zipdownload',   'managesieve',   'password',   );

managesieve

cp /usr/share/roundcubemail/plugins/managesieve/config.inc.php.dist /usr/share/roundcubemail/plugins/managesieve/config.inc.php

#  cd /usr/share/roundcubemail/plugins/managesieve/config.inc.php      [ config.inc.php.dist TO config.inc.php]

 #  vi /var/www/html/webmail/plugins/managesieve/config.inc.php

$config['managesieve_vacation'] = 1;

zipdownload plugin

The plugin is already shipped with the Roundcube packages but not enabled by default because it adds some requirements to the webserver Roundcube is installed on.

cp /usr/share/roundcubemail/plugins/zipdownload/config.inc.php.dist /usr/share/roundcubemail/plugins/zipdownload/config.inc.php

postfixadmin & rouncube vacation plugins

Member "roundcubemail-1.4.3/plugins/managesieve/skins/elastic/templates/vacation.html" (19 Feb 2020, 972 Bytes) of package /linux/www/roundcubemail-1.4.3.tar.gz:

Installation

# cd /var/www/roundcubemail/

# cd plugins

# tar xzf ~/rc-vacation.tar.gz

# cd vacation

# cp config.inc.php.dist config.inc.php

# vi config.inc.php

 cd /usr/share/roundcubemail/plugins/

roundube/pluging/vacation I have the following config file:

#config.php

driver = "virtual"

defaultsubject = "Default subject"

defaultbody = "default.txt"

transport = "autoreply.exemple.org"

dbase = "postfixadmin"

dsn = "mysql://postfixadmin:<password>@localhost/postfixadmin"

always_keep_copy = true

select_query = "SELECT goto FROM %m.alias WHERE address='%e' AND goto='%g'"

delete_query = "DELETE FROM %m.alias WHERE domain=%d AND source='%e'"

insert_query = "INSERT INTO %m.alias (domain,address,goto) VALUES (%i,'%e','%g')"

createvacationconf = true

                         ---------------X---------------

config.inc.php:

$rcmail_config['driver'] = 'virtual';

$rcmail_config['virtual']['dsn'] = 'mysql://postfix:password@localhost';

$rcmail_config['virtual']['transport'] = 'some.domain.tld;

// Database used by Postfix

$rcmail_config['virtual']['dbase'] = 'postfix';

$rcmail_config['virtual']['select_query'] = "SELECT 1 FROM postfix.alias where address='%e' AND goto='%g'";

$rcmail_config['virtual']['delete_query'] = "DELETE FROM postfix.alias WHERE domain='%d' AND goto='%g' AND address='%e' LIMIT 1";

$rcmail_config['virtual']['insert_query'] = "INSERT INTO postfix.alias (address,goto,domain) VALUES ('e','%g','%d')";

                       -------------------X-----------------------------

ok, this works great. thanks a lot!

just in case here my sql-query-configuration for the postfixadmin setup:

$rcmail_config['virtual']['select_query'] = "SELECT goto FROM %m.alias WHERE address='%e' AND goto='%g'";

$rcmail_config['virtual']['delete_query'] = "DELETE FROM %m.alias WHERE domain='%d' AND address='%e'";

$rcmail_config['virtual']['insert_query'] = "INSERT INTO %m.alias (address,goto,domain) VALUES ('%e','%g','%d')";

Download the latest stable release 1.2.7.1 

Stable version - 1.4.3

https://sourceforge.net/projects/vacation/files/vacation/1.2.7.1/vacation-1.2.7.1.tar.gz/download

Install vacation plugin on Roundcube Mail in Centos 7

The standard roundcubemail in Centos 7 epel repository is 1.1.2 (LTS) which does not have the plugin vacation included, you should install it manually. The document logged the course of installing the plugin as well as the problems encountered.

1) Install the vacation binary program

The Centos 7 does not have vacation program in the yum repository. So it needs to be download from the source, compile and install.

Download the latest stable release 1.2.7.1 and extract it with the following command:

# tar -xvf vacation-1.2.7.1.tar.gz

Now you can compile it. You need to have the development packages to do so. The following packages are required: gcc, gdbm-devel

# make

gcc  -g -Wall   -Xlinker -warn-common -D_PATH_VACATION=\"/usr/bin/vacation\" -o vacation vacation.c strlcpy.c strlcat.c rfc822.c -lgdbm

Install it:

#make install

install -s -m 755 vacation /usr/bin/vacation

install -m 755 vaclook /usr/bin/vaclook

install -m 444 vacation.man /usr/man/man1/vacation.1

install: cannot create regular file ‘/usr/man/man1/vacation.1’: No such file or directory

make: *** [install] Error 1

There is an error encountered when installing the man files. The reason is it tries to install the man files into /usr/man instead of the /usr/share/man. So you need to edit the Makefile with the follow amendment:

MANDIR          = $(PREFIX)/man/man MANDIR          = $(PREFIX)/share/man/man

Then do the installation again:

#make install

install -s -m 755 vacation /usr/bin/vacation

install -m 755 vaclook /usr/bin/vaclook

install -m 444 vacation.man /usr/share/man/man1/vacation.1

install -m 444 vaclook.man /usr/share/man/man1/vaclook.1

2) Install Roundcube vacation plugin

There are four sources of vacation plugin:

https://github.com/rplessl/roundcube-vacation-plugin (last active is 2018-7-11)

https://github.com/bhuisgen/rc-vacation (last active is 2018-10-24)

https://github.com/gabor-toth/roundcube-vacation-plugin (last active is 2018-2-1)

https://sourceforge.net/projects/rcubevacation/ (last active is 2015-8-20)

Except the second one (rc-vacation), all the rest are alike. I've tried to install the second one, but no luck, it requires to install some modules which are beyond my knowledge. Blah, blah, blah....

Requirements :

- jQuery UI for vacation date support.

- PEAR Net/LDAP2 module for LDAP driver.

I finally select the first one  (rplessl).

Download and unzip it to the directory:  /usr/share/roundcubemail/plugins/

Rename the folder from roundcube-vacation-plugin-master to vacation for simplicity.

Now edit the file config.ini to select the driver (the method to update the auto-reply and forward rule). Since the default method is "sshftp" which is the one I preferred. So, no need to be modified.

[default]

driver = "sshftp"

subject = "Default subject"

body = "default.txt"

However, according the the document, if the imap (default) server is not the same as the smtp (postfix) server, you can change the parameter "server =", so that the .forward file in the home directory can be updated.

Now set the config.ini to be apache group readable:

# chown 0440 config.ini

# chgrp apache config.ini

Next modify the file /etc/roundcubemail/config.inc.php to activate the plugin:

// ----------------------------------

// PLUGINS

// ----------------------------------

// List of active plugins (in plugins/ directory)

$config['plugins'] = array('vacation');

After this, you will see the vacation icon in roundcube menu.

However, when clicking on the item, a blank page appears. It is due to an internal error when executing the plugin. To see what is wrong, you need to increase the debug level in /etc/roundcubemail/config.inc.php to 4.

// ----------------------------------

// LOGGING/DEBUGGING

// ----------------------------------

// system error reporting, sum of: 1 = log; 4 = show, 8 = trace

$config['debug_level'] = 4;

Afterwords, you will see the error in the page:

Fatal error: Call to undefined function ssh2_connect() in /usr/share/roundcubemail/plugins/vacation/lib/sshftp.class.php on line 29

Well, it complains about the ssh2 module is not installed. We install the required package:

# yum install php-pecl-ssh2

All done now!

---------------------------------------------

Installation procedure

See README.TXT for additional information and requirements for each driver.

Valid config.ini configuration options

An optional default subject and bodytext can be specified using:

subject = "Out of office" body = "default.txt"

The body refers to a template textfile that contains a default text. No HTML can be used in this template.

Here you'll find a list of available configuration options per driver:

[*** None Driver ***] This driver has no configuration options. Use this driver to disable the 'Vacation' subtab in the Settings tab.

[*** FTP Driver ***]

[*** SSHFTP Driver ***]

[*** Setuid Driver ***]

[*** SQL/Virtual Driver ***]

[*** Sieve Driver ***] TBD

[*** Dot forward ***] Path to vacation binary

Unsupported at the moment

File that contains the body & subject of the out of office mail. Required

Database file for vacation binary. Default should be ok. Required

If set to true use -a $alias in the .forward file and allow the user to select the aliases. By default the identities are shown if available

If the vacation binary supports setting the envelop sender, set this to the right parameter. *BSD seems to use '-R' and Debian '-z'. See 'man vacation' for more info.

If vacation/auto-reply gets disabled, should we keep the .vacation.msg? Optional.

Protecting config.ini

If you use the 'virtual' driver, it's recommended to protect config.ini from being accessed directly using a browser. In the root of the plugin directory, you'll find .htaccess that prevents DSN password in config.ini from being exposed.

Configuration examples for config.ini

[default] driver = "sshftp"

[mail.server.org] driver = "none"

[mail.work.nl] driver = "setuid" executable = "/usr/bin/squirrelmail_vacation_proxy"

[imap.provider.org] driver = "ftp" server = "ftp.provider.org" passive = True

                                                          ----------------------------------------------------

Configure the Sieve Message Filter

You can create folders in Roundcube webmail and then create rules to filter email messages into different folders. In order to do this, you need to install the dovecot-pigeonhole package with the following command.

sudo dnf install dovecot-pigeonhole

If you followed my PostfixAdmin tutorial and are using virtual mailbox domains, then you need to edit the sieve configuration file.

sudo /etc/dovecot/conf.d/90-sieve.conf

Find the following line:

sieve = file:~/sieve;active=~/.dovecot.sieve

Change it to:

sieve = file:/var/vmail/%d/%n/sieve;active=/var/vmail/%d/%n/.dovecot.sieve

By default, Postfix uses its builtin local delivery agent (LDA) to move inbound emails to the message store (inbox, sent, trash, Junk, etc). We can configure it to use Dovecot to deliver emails, via the LMTP protocol, which is a simplified version of SMTP. LMTP allows for a highly scalable and reliable mail system and it is required if you want to use the sieve plugin to filter inbound messages to different folders.

Edit the Dovecot main configuration file.

sudo nano /etc/dovecot/dovecot.conf

Add lmtp and sieve to the supported protocols.

protocols = imap lmtp sieve

Save and close the file. Then edit the Dovecot 10-master.conf file.

sudo nano /etc/dovecot/conf.d/10-master.conf

Change the lmtp service definition to the following.

service lmtp {  unix_listener /var/spool/postfix/private/dovecot-lmtp {    group = postfix    mode = 0600    user = postfix   } }

Next, edit the Postfix main configuration file.

sudo nano /etc/postfix/main.cf

Add the following lines at the end of the file. The first line tells Postfix to deliver emails to local message store via the dovecot LMTP server.  The second line disables SMTPUTF8 in Postfix, because Dovecot-LMTP doesn’t support this email extension.

mailbox_transport = lmtp:unix:private/dovecot-lmtp smtputf8_enable = no

Save and close the file. Finally, restart Postfix and Dovecot.

sudo systemctl restart postfix dovecot

------------