From 2902de08beeeb9cebfcc644faf02ff61458b9b21 Mon Sep 17 00:00:00 2001 From: Christoph Date: Tue, 21 Feb 2017 01:43:17 +0100 Subject: [PATCH] Initial import --- .../postfixadmin.env.a.mx.oopen.de | 58 + .../postfixadmin.env.c.mx.oopen.de | 60 + ...in.env.mail.interventionistische-linke.org | 65 + .../postfixadmin.env.mx.warenform.de | 68 + .../postfixadmin.env.rage.so36.net | 65 + ...roundcube.env.webmail.initiativenserver.de | 69 + ...env.webmail.interventionistische-linke.org | 69 + .../roundcube.env.webmail.oopen.de | 74 + .../roundcube.env.webmail.so36.net | 69 + .../roundcube.env.webmail.warenform.de | 72 + ...oundcube.env.webmail2.initiativenserver.de | 69 + .../roundcube.env.webmail2.oopen.de | 72 + .../roundcube.env.webmail2.warenform.de | 71 + DOC/roundcube.install | 2121 +++++++++++++++++ DOC/roundcube.reset_admin.txt | 12 + DOC/roundcube_plugin.install | 805 +++++++ 16 files changed, 3819 insertions(+) create mode 100644 DOC/Environments/postfixadmin.env.a.mx.oopen.de create mode 100644 DOC/Environments/postfixadmin.env.c.mx.oopen.de create mode 100644 DOC/Environments/postfixadmin.env.mail.interventionistische-linke.org create mode 100644 DOC/Environments/postfixadmin.env.mx.warenform.de create mode 100644 DOC/Environments/postfixadmin.env.rage.so36.net create mode 100644 DOC/Environments/roundcube.env.webmail.initiativenserver.de create mode 100644 DOC/Environments/roundcube.env.webmail.interventionistische-linke.org create mode 100644 DOC/Environments/roundcube.env.webmail.oopen.de create mode 100644 DOC/Environments/roundcube.env.webmail.so36.net create mode 100644 DOC/Environments/roundcube.env.webmail.warenform.de create mode 100644 DOC/Environments/roundcube.env.webmail2.initiativenserver.de create mode 100644 DOC/Environments/roundcube.env.webmail2.oopen.de create mode 100644 DOC/Environments/roundcube.env.webmail2.warenform.de create mode 100644 DOC/roundcube.install create mode 100644 DOC/roundcube.reset_admin.txt create mode 100644 DOC/roundcube_plugin.install diff --git a/DOC/Environments/postfixadmin.env.a.mx.oopen.de b/DOC/Environments/postfixadmin.env.a.mx.oopen.de new file mode 100644 index 0000000..313ebf1 --- /dev/null +++ b/DOC/Environments/postfixadmin.env.a.mx.oopen.de @@ -0,0 +1,58 @@ +## - Postfixadmin environment for server +## - +## - a.mx.oopen.de (adm.oopen.de) +## - + +## ------------------------------------- +## - a.mx.oopen.de (adm.oopen.de) + +HOSTNAME=adm.oopen.de +DOMAIN=oopen.de +ADMIN_EMAIL="admin\@oopen.de" + +APACHE_CONF_DIR=/usr/local/apache2/conf +APACHE_VHOST_DIR=/usr/local/apache2/conf/vhosts +APACHE_BASE_WEBDIR=/var/www +APACHE_LOG_DIR=/var/log/apache2 + +APACHE_USER=www-data +APACHE_GROUP=www-data + +_use_mod_php=false + +APACHE_SERVER_CERT=server.crt +APACHE_SERVER_KEY=server.key + +## - Leave empty if not needed +## - +CERT_ChainFile=sub.class2.server.ca.pem + + +## - adm.oopen.de +IPV4=83.223.86.91 +IPV6=2a01:30:0:13:2f7:50ff:fed2:cef7 + +#_pf_admin_version=2.91 +_pf_admin_version=3.0 + +#_db_type='mysql' +_db_type='pgsql' + +_db_name='postfix' +_db_user='postfix' +_db_pass='FKt4z55FxMZp' +#_db_host='localhost' +_db_host='/var/run/postgresql' + +# _encrypt=md5crypt +_encrypt=cleartext + +_spam_folder=Spam + +_autoreply_domain='autoreply.oopen.de' +vacation_user=vacation +vacation_group=vacation + +deleted_maildirs="/var/deleted-maildirs" +deleted_maildomains="/var/deleted-maildomains" + diff --git a/DOC/Environments/postfixadmin.env.c.mx.oopen.de b/DOC/Environments/postfixadmin.env.c.mx.oopen.de new file mode 100644 index 0000000..a0cbbb8 --- /dev/null +++ b/DOC/Environments/postfixadmin.env.c.mx.oopen.de @@ -0,0 +1,60 @@ +## - Postfixadmin environment for server +## - +## - c.mx.oopen.de (adm.initiativenserver.de) +## - + +## ------------------------------- +## - c.mx.oopen.de (adm.initiativenserver.de) + +HOSTNAME=adm.initiativenserver.de +DOMAIN=initiativenserver.de +ADMIN_EMAIL="admin\@initiativenserver.de" + +APACHE_CONF_DIR=/usr/local/apache2/conf +APACHE_VHOST_DIR=/usr/local/apache2/conf/vhosts +APACHE_BASE_WEBDIR=/var/www +APACHE_LOG_DIR=/var/log/apache2 + +APACHE_USER=www-data +APACHE_GROUP=www-data + +_use_mod_php=false + +APACHE_SERVER_CERT=server.crt +APACHE_SERVER_KEY=server.key + +## - Leave empty if not needed +## - +CERT_ChainFile=SSL123_CA_Bundle.pem + + +IPV4=83.223.85.101 +IPV6=2a01:30:1fff:3::101 + +_pf_admin_version=code-1676-trunk + +#_db_type='pgsql' +_db_type='mysql' +_db_name='postfix' +_db_user='postfix' +_db_pass='AeB4kohyie5rahJ7' +#_db_host='/var/run/postgresql' +_db_host='localhost' + +_mysql_rootuser=root +_mysql_rootpass=buz111 + + +# _encrypt=md5crypt +_encrypt=cleartext + +#_spam_folder=Spam +_spam_folder=Junk + +_autoreply_domain='autoreply.initiativenserver.de' +vacation_user=vacation +vacation_group=vacation + +deleted_maildirs="/var/deleted-maildirs" +deleted_maildomains="/var/deleted-maildomains" + diff --git a/DOC/Environments/postfixadmin.env.mail.interventionistische-linke.org b/DOC/Environments/postfixadmin.env.mail.interventionistische-linke.org new file mode 100644 index 0000000..38dbd9e --- /dev/null +++ b/DOC/Environments/postfixadmin.env.mail.interventionistische-linke.org @@ -0,0 +1,65 @@ +## - Postfixadmin environment for server +## - +## - adm.interventionistische-linke.org +## - + +## -------------------------------------------------------------------------- +## - mail.interventionistische-linke.org (adm.interventionistische-linke.org) + +HOSTNAME=adm.interventionistische-linke.org +DOMAIN=interventionistische-linke.org +ADMIN_EMAIL="support\@interventionistische-linke.org" + +APACHE_CONF_DIR=/usr/local/apache2/conf +APACHE_VHOST_DIR=/usr/local/apache2/conf/vhosts +APACHE_BASE_WEBDIR=/var/www +APACHE_LOG_DIR=/var/log/apache2 + +APACHE_USER=www-data +APACHE_GROUP=www-data + +_use_mod_php=false + +APACHE_SERVER_CERT=server.crt +APACHE_SERVER_KEY=server.key + +## - Leave empty if not needed +## - +CERT_ChainFile=sub.class2.server.ca.pem + +IPV4=83.223.85.215 +IPV6=2a01:30:1fff:5::215 + +_pf_admin_version=2.91 + +#_db_type='mysql' +_db_type='pgsql' + +_db_name='postfix' +_db_user='postfix' +_db_pass='NcXxt7sf7bfV' +#_db_host='localhost' +_db_host='/var/run/postgresql' + +_encrypt=md5crypt +#_encrypt=cleartext + +_spam_folder=Spam + +_autoreply_domain='autoreply.interventionistische-linke.org' +vacation_user=vacation +vacation_group=vacation + +deleted_maildirs="/data/deleted-maildirs" +deleted_maildomains="/data/deleted-maildomains" + +_welcome_email=" +Hallo, + +Deine neue E-Mail Adresse ist eingerichtet. + +- IL - Interventionistische Linke + +-- +e: support@interventionistische-linke.org" + diff --git a/DOC/Environments/postfixadmin.env.mx.warenform.de b/DOC/Environments/postfixadmin.env.mx.warenform.de new file mode 100644 index 0000000..742859e --- /dev/null +++ b/DOC/Environments/postfixadmin.env.mx.warenform.de @@ -0,0 +1,68 @@ +## - Postfixadmin environment for server +## - +## - mx.warenform.de (adm.warenform.de) +## - + +## ------------------------------------- +## - mx.warenform.de (adm.warenform.de) + +HOSTNAME=adm.warenform.de +DOMAIN=warenform.de +ADMIN_EMAIL="admin\@warenform.de" + +APACHE_CONF_DIR=/usr/local/apache2/conf +APACHE_VHOST_DIR=/usr/local/apache2/conf/vhosts +APACHE_BASE_WEBDIR=/var/www +APACHE_LOG_DIR=/var/log/apache2 + +APACHE_USER=www-data +APACHE_GROUP=www-data + +_use_mod_php=false + +APACHE_SERVER_CERT=server.crt +APACHE_SERVER_KEY=server.key + +## - Leave empty if not needed +## - +CERT_ChainFile=SSL123_CA_Bundle.pem + +IPV4=83.223.85.154 +IPV6=2a01:30:1fff:6::154 + +#_pf_admin_version=2.3.7 +_pf_admin_version=2.91 + +#_db_type='mysql' +_db_type='pgsql' + +_db_name='postfix' +_db_user='postfix' +_db_pass='CbX8vg347Vvm' +#_db_host='localhost' +_db_host='/var/run/postgresql' + +# _encrypt=md5crypt +_encrypt=cleartext + +_spam_folder=Spam + +_autoreply_domain='autoreply.warenform.de' +vacation_user=vacation +vacation_group=vacation + +deleted_maildirs="/var/deleted-maildirs" +deleted_maildomains="/var/deleted-maildomains" + +_welcome_email=" +Hallo, + +Ihre neue E-Mail Adresse ist eingerichtet. + +Das WARENFORM-Team + +-- +WARENFORM | Phone: +49 30 / 61 65 17 52 -0 +Dresdner Str. 11 | Fax: +49 30 / 61 65 17 52 -66 +D-10999 Berlin | http://www.warenform.net" + diff --git a/DOC/Environments/postfixadmin.env.rage.so36.net b/DOC/Environments/postfixadmin.env.rage.so36.net new file mode 100644 index 0000000..f8234ac --- /dev/null +++ b/DOC/Environments/postfixadmin.env.rage.so36.net @@ -0,0 +1,65 @@ +## - Postfixadmin environment for server +## - +## - rage.so36.net (adm.so36.net) +## - + +## ------------------------------- +## - rage.so36.net (adm.so36.net) + +HOSTNAME=adm.so36.net +DOMAIN=so36.net +ADMIN_EMAIL="support\@so36.net" + +APACHE_CONF_DIR=/etc/apache2 +APACHE_VHOST_DIR=/etc/apache2/sites-available +APACHE_BASE_WEBDIR=/var/www +APACHE_LOG_DIR=/var/log/apache2 + +APACHE_USER=www-data +APACHE_GROUP=www-data + +_use_mod_php=false + +APACHE_SERVER_CERT=server.crt +APACHE_SERVER_KEY=server.key + +## - Leave empty if not needed +## - +CERT_ChainFile=sub.class2.server.ca.pem + +IPV4=83.223.73.193 +IPV6=2a01:30:1fff:fd00::193 + +_pf_admin_version=2.3.7 + +#_db_type='mysql' +_db_type='pgsql' + +_db_name='postfix' +_db_user='postfix' +_db_pass='9jKqFHNGrgFb' +#_db_host='localhost' +_db_host='/var/run/postgresql' + +_encrypt=md5crypt +#_encrypt=cleartext + +_spam_folder=Spam + +_autoreply_domain='autoreply.so36.net' +vacation_user=vacation +vacation_group=vacation + +deleted_maildirs="/data/deleted-maildirs" +deleted_maildomains="/data/deleted-maildomains" + +_welcome_email=" +Hallo, + +Deine neue E-Mail Adresse ist eingerichtet. + +- so36.NET + +-- +e: support@so36.net" + diff --git a/DOC/Environments/roundcube.env.webmail.initiativenserver.de b/DOC/Environments/roundcube.env.webmail.initiativenserver.de new file mode 100644 index 0000000..b220de8 --- /dev/null +++ b/DOC/Environments/roundcube.env.webmail.initiativenserver.de @@ -0,0 +1,69 @@ +## - Rounfcube environment for server +## - +## - c.mx.oopen.de (webmail.initiativenserver.de) +## - + +## - webmail.initiativenserver.de +## - +SRC_BASE_DIR=/usr/local/src/mailsystem +SRC_ARCHIVE_DIR=${SRC_BASE_DIR}/tarballs + +ROUNDCUBE_VERSION=1.1.3 + +SPAM_FOLDER_NAME=Junk + +WEBSITE=webmail.initiativenserver.de + +IPV4=83.223.85.101 +IPV6=2a01:30:1fff:3::101 + +WEBMASTER_EMAIL=admin@oopen.de +WEBMAIL_BASEDIR=/var/www/webmail.initiativenserver.de +WEBMAIL_TMPDIR=${WEBMAIL_BASEDIR}/temp + +WEBSERVER_USER=www-data +WEBSERVER_GROUP=www-data + +APACHE_LOG_DIR=${WEBMAIL_BASEDIR}/logs + +APACHE_SERVER_CERT=server.crt +APACHE_SERVER_KEY=server.key + +## - Leave empty if not needed +## - +CERT_ChainFile=sub.class2.server.ca.pem + + +## - apache installed from debian package system ? +## - +_apache_debian=false + +## - if installed from source, specify vhost directory +## - +_vhost_dir=/usr/local/apache2/conf/vhosts +_apache_cert_dir=/usr/local/apache2/conf + +if $_apache_debian ; then + _vhost_dir=/etc/apache2/sites-available + _apache_cert_dir=/etc/apache2 +fi + +_SSLCertificateChainFile="" +if [ -n "$CERT_ChainFile" ];then + _SSLCertificateChainFile="SSLCertificateChainFile ${_apache_cert_dir}/$CERT_ChainFile" +fi + +_autoreply_domain=autoreply.oopen.de + +#_db_type=pgsql +_db_type=mysql + +_db_host=localhost +_db_user=roundcube +_db_pass=re6Xe8Fereejai3D + +#_mysql_rootuser=root +#_mysql_rootpass= +## - +## - END: webmail.initiativenserver.de + diff --git a/DOC/Environments/roundcube.env.webmail.interventionistische-linke.org b/DOC/Environments/roundcube.env.webmail.interventionistische-linke.org new file mode 100644 index 0000000..f2cf7f3 --- /dev/null +++ b/DOC/Environments/roundcube.env.webmail.interventionistische-linke.org @@ -0,0 +1,69 @@ +## - Rounfcube environment for server +## - +## - webmail.interventionistische-linke.org (webmail.interventionistische-linke.org) +## - + +## - webmail.interventionistische-linke.org +## - +SRC_BASE_DIR=/usr/local/src/mailsystem +SRC_ARCHIVE_DIR=${SRC_BASE_DIR}/tarballs + +ROUNDCUBE_VERSION=1.1.3 + +SPAM_FOLDER_NAME=SPAM + +WEBSITE=webmail.interventionistische-linke.org + +IPV4=83.223.73.211 +IPV6=2a01:30:1fff:fd00::194 + +WEBMASTER_EMAIL=admin@oopen.de +WEBMAIL_BASEDIR=/var/www/webmail.interventionistische-linke.org +WEBMAIL_TMPDIR=${WEBMAIL_BASEDIR}/temp + +WEBSERVER_USER=www-data +WEBSERVER_GROUP=www-data + +APACHE_LOG_DIR=${WEBMAIL_BASEDIR}/logs + +APACHE_SERVER_CERT=server.crt +APACHE_SERVER_KEY=server.key + +## - Leave empty if not needed +## - +CERT_ChainFile=sub.class2.server.ca.pem + + +## - apache installed from debian package system ? +## - +_apache_debian=true + +## - if installed from source, specify vhost directory +## - +_vhost_dir=/usr/local/apache2/conf/vhosts +_apache_cert_dir=/usr/local/apache2/conf + +if $_apache_debian ; then + _vhost_dir=/etc/apache2/sites-available + _apache_cert_dir=/etc/apache2 +fi + +_SSLCertificateChainFile="" +if [ -n "$CERT_ChainFile" ];then + _SSLCertificateChainFile="SSLCertificateChainFile ${_apache_cert_dir}/$CERT_ChainFile" +fi + +_autoreply_domain=autoreply.interventionistische-linke.org + +_db_type=pgsql +#_db_type=mysql + +_db_host=localhost +_db_user=roundcube +_db_pass=MjXQJpR9SvcX + +#_mysql_rootuser=root +#_mysql_rootpass= +## - +## - END: webmail.interventionistische-linke.org + diff --git a/DOC/Environments/roundcube.env.webmail.oopen.de b/DOC/Environments/roundcube.env.webmail.oopen.de new file mode 100644 index 0000000..5b7cdca --- /dev/null +++ b/DOC/Environments/roundcube.env.webmail.oopen.de @@ -0,0 +1,74 @@ +## - Rounfcube environment for server +## - +## - a.mx.oopen.de (webmail.oopen.de) +## - + +## ---------------------- +## - webmail.oopen.de +## - +SRC_BASE_DIR=/usr/local/src/mailsystem +SRC_ARCHIVE_DIR=${SRC_BASE_DIR}/tarballs + +ROUNDCUBE_VERSION=1.2.2 + +SPAM_FOLDER_NAME=Spam + +WEBSITE=webmail.oopen.de + +IPV4=83.223.86.91 +IPV6=2a01:30:0:13:2f7:50ff:fed2:cef7 + +WEBMASTER_EMAIL=admin@oopen.de +WEBMAIL_BASEDIR=/var/www/webmail.oopen.de +WEBMAIL_TMPDIR=${WEBMAIL_BASEDIR}/temp + +WEBSERVER_USER=www-data +WEBSERVER_GROUP=www-data + +APACHE_LOG_DIR=${WEBMAIL_BASEDIR}/logs + +#APACHE_SERVER_CERT=webmail.oopen.de-bundle.crt +#APACHE_SERVER_KEY=webmail.oopen.de.key +APACHE_SERVER_CERT=server-bundle.crt +APACHE_SERVER_KEY=server.key + +_use_mod_php=false + +## - Leave empty if not needed +## - +#CERT_ChainFile= + + +## - apache installed from debian package system ? +## - +_apache_debian=false + +## - if installed from source, specify vhost directory +## - +_vhost_dir=/usr/local/apache2/conf/vhosts +_apache_cert_dir=/usr/local/apache2/conf + +if $_apache_debian ; then + _vhost_dir=/etc/apache2/sites-available + _apache_cert_dir=/etc/apache2 +fi + +_SSLCertificateChainFile="" +if [ -n "$CERT_ChainFile" ];then + _SSLCertificateChainFile="SSLCertificateChainFile ${_apache_cert_dir}/$CERT_ChainFile" +fi + +_autoreply_domain=autoreply.oopen.de + +_db_type=pgsql +#_db_type=mysql + +_db_host=localhost +_db_user=roundcube +_db_pass=3Dsz3j5R +_db_name=roundcubemail + +#_mysql_rootuser=root +#_mysql_rootpass= +## - +## - END: webmail.oopen.de diff --git a/DOC/Environments/roundcube.env.webmail.so36.net b/DOC/Environments/roundcube.env.webmail.so36.net new file mode 100644 index 0000000..df1ba81 --- /dev/null +++ b/DOC/Environments/roundcube.env.webmail.so36.net @@ -0,0 +1,69 @@ +## - Rounfcube environment for server +## - +## - rage.so36.net (webmail.so36.net) +## - + +## - webmail.oopen.de +## - +SRC_BASE_DIR=/usr/local/src/mailsystem +SRC_ARCHIVE_DIR=${SRC_BASE_DIR}/tarballs + +ROUNDCUBE_VERSION=1.1.3 + +SPAM_FOLDER_NAME=SPAM + +WEBSITE=webmail.so36.net + +IPV4=83.223.73.211 +IPV6=2a01:30:1fff:fd00::194 + +WEBMASTER_EMAIL=roots@so36.net +WEBMAIL_BASEDIR=/var/www/webmail.so36.net +WEBMAIL_TMPDIR=${WEBMAIL_BASEDIR}/temp + +WEBSERVER_USER=www-data +WEBSERVER_GROUP=www-data + +APACHE_LOG_DIR=${WEBMAIL_BASEDIR}/logs + +APACHE_SERVER_CERT=server.crt +APACHE_SERVER_KEY=server.key + +## - Leave empty if not needed +## - +CERT_ChainFile=sub.class2.server.ca.pem + + +## - apache installed from debian package system ? +## - +_apache_debian=true + +## - if installed from source, specify vhost directory +## - +_vhost_dir=/usr/local/apache2/conf/vhosts +_apache_cert_dir=/usr/local/apache2/conf + +if $_apache_debian ; then + _vhost_dir=/etc/apache2/sites-available + _apache_cert_dir=/etc/apache2 +fi + +_SSLCertificateChainFile="" +if [ -n "$CERT_ChainFile" ];then + _SSLCertificateChainFile="SSLCertificateChainFile ${_apache_cert_dir}/$CERT_ChainFile" +fi + +_autoreply_domain=autoreply.so36.net + +_db_type=pgsql +#_db_type=mysql + +_db_host=localhost +_db_user=roundcube +_db_pass=MjXQJpR9SvcX + +#_mysql_rootuser=root +#_mysql_rootpass= +## - +## - END: webmail.so36.net + diff --git a/DOC/Environments/roundcube.env.webmail.warenform.de b/DOC/Environments/roundcube.env.webmail.warenform.de new file mode 100644 index 0000000..88e782a --- /dev/null +++ b/DOC/Environments/roundcube.env.webmail.warenform.de @@ -0,0 +1,72 @@ +## - Rounfcube environment for server +## - +## - mx.warenform.de (webmail.warenform.de) +## - + +## ---------------------- +## - webmail.warenform.de +## - +SRC_BASE_DIR=/usr/local/src/mailsystem +SRC_ARCHIVE_DIR=${SRC_BASE_DIR}/tarballs + +#ROUNDCUBE_VERSION=0.9.5 +ROUNDCUBE_VERSION=1.0.1 + +SPAM_FOLDER_NAME=SPAM + +WEBSITE=webmail.warenform.de + +IPV4=83.223.85.154 +IPV6=2a01:30:1fff:6::154 + +WEBMASTER_EMAIL=admin@warenform.de +WEBMAIL_BASEDIR=/var/www/webmail.warenform.de +WEBMAIL_TMPDIR=${WEBMAIL_BASEDIR}/temp + +WEBSERVER_USER=www-data +WEBSERVER_GROUP=www-data + +APACHE_LOG_DIR=/var/log/apache2 + +APACHE_SERVER_CERT=server.crt +APACHE_SERVER_KEY=server.key + +_use_mod_php=false + +## - Leave empty if not needed +## - +CERT_ChainFile=SSL123_CA_Bundle.pem + + +## - apache installed from debian package system ? +## - +_apache_debian=false + +## - if installed from source, specify vhost directory +## - +_vhost_dir=/usr/local/apache2/conf/vhosts +_apache_cert_dir=/usr/local/apache2/conf + +if $_apache_debian ; then + _vhost_dir=/etc/apache2/sites-available + _apache_cert_dir=/etc/apache2 +fi + +_SSLCertificateChainFile="" +if [ -n "$CERT_ChainFile" ];then + _SSLCertificateChainFile="SSLCertificateChainFile ${_apache_cert_dir}/$CERT_ChainFile" +fi + +_autoreply_domain=autoreply.warenform.de + +_db_type=pgsql +#_db_type=mysql + +_db_host=localhost +_db_user=roundcube +_db_pass=Hoo5heis +_db_name=roundcubemail + +#_mysql_rootuser=root +#_mysql_rootpass= + diff --git a/DOC/Environments/roundcube.env.webmail2.initiativenserver.de b/DOC/Environments/roundcube.env.webmail2.initiativenserver.de new file mode 100644 index 0000000..eae98f5 --- /dev/null +++ b/DOC/Environments/roundcube.env.webmail2.initiativenserver.de @@ -0,0 +1,69 @@ +## - Rounfcube environment for server +## - +## - c.mx.oopen.de (webmail2.initiativenserver.de) +## - + +## - webmail2.initiativenserver.de +## - +SRC_BASE_DIR=/usr/local/src/mailsystem +SRC_ARCHIVE_DIR=${SRC_BASE_DIR}/tarballs + +ROUNDCUBE_VERSION=1.1.3 + +SPAM_FOLDER_NAME=Junk + +WEBSITE=webmail2.initiativenserver.de + +IPV4=83.223.85.101 +IPV6=2a01:30:1fff:3::101 + +WEBMASTER_EMAIL=admin@oopen.de +WEBMAIL_BASEDIR=/var/www/webmail2.initiativenserver.de +WEBMAIL_TMPDIR=${WEBMAIL_BASEDIR}/temp + +WEBSERVER_USER=www-data +WEBSERVER_GROUP=www-data + +APACHE_LOG_DIR=${WEBMAIL_BASEDIR}/logs + +APACHE_SERVER_CERT=server.crt +APACHE_SERVER_KEY=server.key + +## - Leave empty if not needed +## - +CERT_ChainFile=sub.class2.server.ca.pem + + +## - apache installed from debian package system ? +## - +_apache_debian=false + +## - if installed from source, specify vhost directory +## - +_vhost_dir=/usr/local/apache2/conf/vhosts +_apache_cert_dir=/usr/local/apache2/conf + +if $_apache_debian ; then + _vhost_dir=/etc/apache2/sites-available + _apache_cert_dir=/etc/apache2 +fi + +_SSLCertificateChainFile="" +if [ -n "$CERT_ChainFile" ];then + _SSLCertificateChainFile="SSLCertificateChainFile ${_apache_cert_dir}/$CERT_ChainFile" +fi + +_autoreply_domain=autoreply.oopen.de + +#_db_type=pgsql +_db_type=mysql + +_db_host=localhost +_db_user=roundcube +_db_pass=re6Xe8Fereejai3D + +#_mysql_rootuser=root +#_mysql_rootpass= +## - +## - END: webmail2.initiativenserver.de + diff --git a/DOC/Environments/roundcube.env.webmail2.oopen.de b/DOC/Environments/roundcube.env.webmail2.oopen.de new file mode 100644 index 0000000..96433c4 --- /dev/null +++ b/DOC/Environments/roundcube.env.webmail2.oopen.de @@ -0,0 +1,72 @@ +## - Rounfcube environment for server +## - +## - a.mx.oopen.de (webmail2.oopen.de) +## - + +## ---------------------- +## - webmail2.oopen.de +## - +SRC_BASE_DIR=/usr/local/src/mailsystem +SRC_ARCHIVE_DIR=${SRC_BASE_DIR}/tarballs + +ROUNDCUBE_VERSION=1.1.4 + +SPAM_FOLDER_NAME=Spam + +WEBSITE=webmail2.oopen.de + +IPV4=83.223.85.165 +IPV6=2a01:30:1fff:9::165 + +WEBMASTER_EMAIL=admin@oopen.de +WEBMAIL_BASEDIR=/var/www/webmail2.oopen.de +WEBMAIL_TMPDIR=${WEBMAIL_BASEDIR}/temp + +WEBSERVER_USER=www-data +WEBSERVER_GROUP=www-data + +APACHE_LOG_DIR=${WEBMAIL_BASEDIR}/logs + +APACHE_SERVER_CERT=wildcard.oopen.de-bundle.crt +APACHE_SERVER_KEY=wildcard.oopen.de.key + +_use_mod_php=false + +## - Leave empty if not needed +## - +#CERT_ChainFile= + + +## - apache installed from debian package system ? +## - +_apache_debian=false + +## - if installed from source, specify vhost directory +## - +_vhost_dir=/usr/local/apache2/conf/vhosts +_apache_cert_dir=/usr/local/apache2/conf + +if $_apache_debian ; then + _vhost_dir=/etc/apache2/sites-available + _apache_cert_dir=/etc/apache2 +fi + +_SSLCertificateChainFile="" +if [ -n "$CERT_ChainFile" ];then + _SSLCertificateChainFile="SSLCertificateChainFile ${_apache_cert_dir}/$CERT_ChainFile" +fi + +_autoreply_domain=autoreply.oopen.de + +_db_type=pgsql +#_db_type=mysql + +_db_host=localhost +_db_user=roundcube +_db_pass=3Dsz3j5R +_db_name=roundcubemail2 + +#_mysql_rootuser=root +#_mysql_rootpass= +## - +## - END: webmail2.oopen.de diff --git a/DOC/Environments/roundcube.env.webmail2.warenform.de b/DOC/Environments/roundcube.env.webmail2.warenform.de new file mode 100644 index 0000000..fb54819 --- /dev/null +++ b/DOC/Environments/roundcube.env.webmail2.warenform.de @@ -0,0 +1,71 @@ +## - Rounfcube environment for server +## - +## - mx.warenform.de (webmail2.warenform.de) +## - + +## ---------------------- +## - webmail.warenform.de +## - +SRC_BASE_DIR=/usr/local/src/mailsystem +SRC_ARCHIVE_DIR=${SRC_BASE_DIR}/tarballs + +ROUNDCUBE_VERSION=1.1.1 + +SPAM_FOLDER_NAME=SPAM + +WEBSITE=webmail2.warenform.de + +IPV4=83.223.85.154 +IPV6=2a01:30:1fff:6::154 + +WEBMASTER_EMAIL=admin@warenform.de +WEBMAIL_BASEDIR=/var/www/webmail2.warenform.de +WEBMAIL_TMPDIR=${WEBMAIL_BASEDIR}/temp + +WEBSERVER_USER=www-data +WEBSERVER_GROUP=www-data + +APACHE_LOG_DIR=/var/log/apache2 + +APACHE_SERVER_CERT=server.crt +APACHE_SERVER_KEY=server.key + +_use_mod_php=false + +## - Leave empty if not needed +## - +#CERT_ChainFile=SSL123_CA_Bundle.pem + + +## - apache installed from debian package system ? +## - +_apache_debian=false + +## - if installed from source, specify vhost directory +## - +_vhost_dir=/usr/local/apache2/conf/vhosts +_apache_cert_dir=/usr/local/apache2/conf + +if $_apache_debian ; then + _vhost_dir=/etc/apache2/sites-available + _apache_cert_dir=/etc/apache2 +fi + +_SSLCertificateChainFile="" +if [ -n "$CERT_ChainFile" ];then + _SSLCertificateChainFile="SSLCertificateChainFile ${_apache_cert_dir}/$CERT_ChainFile" +fi + +_autoreply_domain=autoreply.warenform.de + +_db_type=pgsql +#_db_type=mysql + +_db_host=localhost +_db_user=roundcube +_db_pass=Hoo5heis +_db_name=roundcubemail2 + +#_mysql_rootuser=root +#_mysql_rootpass= + diff --git a/DOC/roundcube.install b/DOC/roundcube.install new file mode 100644 index 0000000..190267a --- /dev/null +++ b/DOC/roundcube.install @@ -0,0 +1,2121 @@ + +## ----------------------------------- ## +## --- install roundcube Webmailer --- ## +## ----------------------------------- ## + +## ---------------------- +## - webmail.warenform.de +## - + +. roundcube.env.webmail.warenform.de + +## - +## - END: webmail.warenform.de +## ---------------------------- + + +## ------------------ +## - webmail.oopen.de +## - + +. roundcube.env.webmail.oopen.de + +## - +## - END: webmail.oopen.de +## ----------------------- + + +## --------------------------------------- +## - webmail.interventionistische-linke.org +## - + +. roundcube.env.webmail.interventionistische-linke.org + +## - +## - END: webmail.interventionistische-linke.org +## --------------------------------------------- + + +## ---------------------------- +## - Begin Installation + +## - REQUIREMENTS +## - ============ +## - +## - * The Apache, Lighttpd, Cherokee or Hiawatha web server +## - * .htaccess support allowing overrides for DirectoryIndex +## - * PHP Version 5.2.1 or greater including +## - - PCRE, DOM, JSON, XML, Session, Sockets (required) +## - - libiconv (recommended) +## - - mbstring, fileinfo, mcrypt (optional) +## - * PEAR packages distributed with Roundcube or external: +## - - MDB2 2.5.0 or newer +## - - Mail_Mime 1.8.1 or newer +## - - Mail_mimeDecode 1.5.5 or newer +## - - Net_SMTP 1.4.2 or newer +## - - Net_IDNA2 0.1.1 or newer +## - - Auth_SASL 1.0.6 or newer +## - * php.ini options (see .htaccess file): +## - - error_reporting E_ALL & ~E_NOTICE (or lower) +## - - memory_limit > 16MB (increase as suitable to support large attachments) +## - - file_uploads enabled (for attachment upload features) +## - - session.auto_start disabled +## - - zend.ze1_compatibility_mode disabled +## - - suhosin.session.encrypt disabled +## - - mbstring.func_overload disabled +## - - magic_quotes_runtime disabled +## - - magic_quotes_sybase disabled +## - * PHP compiled with OpenSSL to connect to IMAPS and to use the spell checker +## - * A MySQL (4.0.8 or newer), PostgreSQL, MSSQL database engine +## - or the SQLite extension for PHP +## - * One of the above databases with permission to create tables +## - * An SMTP server (recommended) or PHP configured for mail delivery + +## - install php PEAR packages +## - +## - !! Take care to do this for all php installations (PHP 5.5/5.6/..) +## - + +_php_major_versions=`find /usr/local/ -maxdepth 1 -mindepth 1 -type l -name "php-*" -print | cut -d "-" -f2 | sort` +for _version in $_php_major_versions ; do + rm /usr/local/php + ln -s /usr/local/php-$_version /usr/local/php + + pear install MDB2 + + if [ "$_db_type" = "pgsql" ]; then + pear install MDB2_Driver_pgsql + elif [ "$_db_type" = "mysql" ];then + pear install MDB2_Driver_mysql + pear install MDB2_Driver_mysqli + else + echo -e "\n\t[ ERROR ]: Unknown database type \"$_db_type\"\n\n" + fi + + pear install Mail_Mime + pear install Mail_mimeDecode + pear install Net_SMTP + #pear install Net_IDNA2 + pear install channel://pear.php.net/Net_IDNA2-0.1.1 + #pear install Auth_SASL + #pear install Auth_SASL2 + pear install channel://pear.php.net/Auth_SASL2-0.1.0 + +done + +mkdir -p $WEBMAIL_BASEDIR/{sessions,tmp,temp,logs} +chown ${WEBSERVER_USER}:${WEBSERVER_GROUP} ${WEBMAIL_BASEDIR}/{sessions,tmp} + + + +if ! $_use_mod_php ; then + mkdir -p ${WEBMAIL_BASEDIR}/conf + chown root:$WEBSERVER_USER ${WEBMAIL_BASEDIR}/conf + chmod 750 ${WEBMAIL_BASEDIR}/conf + + _php_major_versions=`find /usr/local/ -maxdepth 1 -mindepth 1 -type l -name "php-*" -print | cut -d "-" -f2 | sort` + for _version in $_php_major_versions ; do + cp /usr/local/php-${_version}/etc/php.ini ${WEBMAIL_BASEDIR}/conf/php.ini-$_version + + chown root:$WEBSERVER_USER ${WEBMAIL_BASEDIR}/conf/php.ini-$_version + chmod 640 ${WEBMAIL_BASEDIR}/conf/php.ini-$_version + + cat < ${WEBMAIL_BASEDIR}/conf/fcgid-$_version +#!/bin/sh +export PHPRC="${WEBMAIL_BASEDIR}/conf/" +export TMPDIR="${WEBMAIL_BASEDIR}/tmp" +# PHP child process management (PHP_FCGI_CHILDREN) should +# always be disabled with mod_fcgid, which will only route one +# request at a time to application processes it has spawned; +# thus, any child processes created by PHP will not be used +# effectively. (Additionally, the PHP child processes may not +# be terminated properly.) By default, and with the environment +# variable setting PHP_FCGI_CHILDREN=0, PHP child process +# management is disabled. +PHP_FCGI_CHILDREN=0 +export PHP_FCGI_CHILDREN + +exec /usr/local/php-${_version}/bin/php-cgi +EOF + + chown root:$WEBSERVER_USER ${WEBMAIL_BASEDIR}/conf/fcgid-$_version + chmod 750 ${WEBMAIL_BASEDIR}/conf/fcgid-$_version + done + + ln -s php.ini-$_version ${WEBMAIL_BASEDIR}/conf/php.ini + ln -s fcgid-$_version ${WEBMAIL_BASEDIR}/conf/fcgid + + cat << EOF > ${WEBMAIL_BASEDIR}/conf/changes.php.ini.txt +error_log = "${WEBMAIL_BASEDIR}/logs/php_errors.log" +sys_temp_dir = "${WEBMAIL_BASEDIR}/tmp" +upload_tmp_dir = "${WEBMAIL_BASEDIR}/tmp" +session.save_path = "${WEBMAIL_BASEDIR}/sessions" +soap.wsdl_cache_dir = "${WEBMAIL_BASEDIR}/tmp" +EOF + + touch ${WEBMAIL_BASEDIR}/logs/php_errors.log + chown ${WEBSERVER_USER}:${WEBSERVER_GROUP} ${WEBMAIL_BASEDIR}/logs/php_errors.log + + _php_ini_file="${WEBMAIL_BASEDIR}/conf/php.ini-*" + + _key=error_log + _val="${WEBMAIL_BASEDIR}/logs/php_errors.log" + if grep -e "^\s*${_key}\s*=" $_php_ini_file > /dev/null 2>&1 ; then + #sed -i "0,/^\([ \t]*${_key}[ \t]*=.*\)/ s##;\1\n${_key} = \"${_val}\"#" $_php_ini_file + perl -i -n -p -e "s#^(\s*${_key}\s*=.*)#;\1\n${_key} = ${_val}#" $_php_ini_file + _retval=$? + elif grep -e "^\s*;\s*${_key}\s*=" $_php_ini_file > /dev/null 2>&1 ; then + sed -i "0,/^\([ \t]*;[ \t]*${_key}[ \t]*=.*\)/ s##\1\n${_key} = \"${_val}\"\n#" $_php_ini_file + _retval=$? + fi + + _key="sys_temp_dir" + _val="${WEBMAIL_BASEDIR}/tmp" + _key="sys_temp_dir" + _val="${WEBMAIL_BASEDIR}/tmp" + if grep -e "^\s*${_key}\s*=" $_php_ini_file > /dev/null 2>&1 ; then + #sed -i "0,/^\([ \t]*${_key}[ \t]*=.*\)/ s##;\1\n${_key} = \"${_val}\"#" $_php_ini_file + perl -i -n -p -e "s#^(\s*${_key}\s*=.*)#;\1\n${_key} = ${_val}#" $_php_ini_file + _retval=$? + elif grep -e "^\s*;\s*${_key}\s*=" $_php_ini_file > /dev/null 2>&1 ; then + sed -i "0,/^\([ \t]*;[ \t]*${_key}[ \t]*=.*\)/ s##\1\n${_key} = \"${_val}\"\n#" $_php_ini_file + _retval=$? + fi + + _key="upload_tmp_dir" + _val="${WEBMAIL_BASEDIR}/tmp" + if grep -e "^\s*${_key}\s*=" $_php_ini_file > /dev/null 2>&1 ; then + #sed -i "0,/^\([ \t]*${_key}[ \t]*=.*\)/ s##;\1\n${_key} = \"${_val}\"#" $_php_ini_file + perl -i -n -p -e "s#^(\s*${_key}\s*=.*)#;\1\n${_key} = ${_val}#" $_php_ini_file + _retval=$? + elif grep -e "^\s*;\s*${_key}\s*=" $_php_ini_file > /dev/null 2>&1 ; then + sed -i "0,/^\([ \t]*;[ \t]*${_key}[ \t]*=.*\)/ s##\1\n${_key} = \"${_val}\"\n#" $_php_ini_file + _retval=$? + fi + + _key="session.save_path" + _val="${WEBMAIL_BASEDIR}/sessions" + if grep -e "^\s*${_key}\s*=" $_php_ini_file > /dev/null 2>&1 ; then + #sed -i "0,/^\([ \t]*${_key}[ \t]*=.*\)/ s##;\1\n${_key} = \"${_val}\"#" $_php_ini_file + perl -i -n -p -e "s#^(\s*${_key}\s*=.*)#;\1\n${_key} = ${_val}#" $_php_ini_file + _retval=$? + elif grep -e "^\s*;\s*${_key}\s*=" $_php_ini_file > /dev/null 2>&1 ; then + sed -i "0,/^\([ \t]*;[ \t]*${_key}[ \t]*=.*\)/ s##\1\n${_key} = \"${_val}\"\n#" $_php_ini_file + _retval=$? + fi + + _key="soap.wsdl_cache_dir" + _val="${WEBMAIL_BASEDIR}/tmp" + if grep -e "^\s*${_key}\s*=" $_php_ini_file > /dev/null 2>&1 ; then + #sed -i "0,/^\([ \t]*${_key}[ \t]*=.*\)/ s##;\1\n${_key} = \"${_val}\"#" $_php_ini_file + perl -i -n -p -e "s#^(\s*${_key}\s*=.*)#;\1\n${_key} = ${_val}#" $_php_ini_file + _retval=$? + elif grep -e "^\s*;\s*${_key}\s*=" $_php_ini_file > /dev/null 2>&1 ; then + sed -i "0,/^\([ \t]*;[ \t]*${_key}[ \t]*=.*\)/ s##\1\n${_key} = \"${_val}\"\n#" $_php_ini_file + _retval=$? + fi + +fi + + + + + + + + + +## - create vhost entry for webmail.warenform.de +## - +if [ -f ${_vhost_dir}/${WEBSITE}.conf ];then + mv ${_vhost_dir}/${WEBSITE}.conf ${_vhost_dir}/${WEBSITE}.conf.`date +%Y%m%d-%H%M` +fi + +cat < ${_vhost_dir}/${WEBSITE}.conf +# -- $WEBSITE -- # + + + + ServerAdmin $WEBMASTER_EMAIL + + ServerName $WEBSITE + + RewriteEngine on + RewriteCond %{HTTPS} !=on + RewriteRule (.*) https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L] + + CustomLog ${APACHE_LOG_DIR}/${WEBSITE}-access.log combined + ErrorLog ${APACHE_LOG_DIR}/${WEBSITE}-error.log + + + + + + + ServerAdmin $WEBMASTER_EMAIL + + ServerName $WEBSITE + +EOF + +if $_use_mod_php ; then + cat <> ${_vhost_dir}/${WEBSITE}.conf + ## - its allowed to overwrite by .htaccess + ## - + php_value error_reporting "E_ALL & ~E_NOTICE" + + ## - Overwriting by .htaccess NOT allowd + ## - + php_admin_value upload_tmp_dir "${WEBMAIL_BASEDIR}/tmp/" + php_admin_flag log_errors on + php_admin_value error_log "${WEBMAIL_BASEDIR}/logs/php_error.log" + php_admin_value session.save_path "${WEBMAIL_BASEDIR}/sessions" + + DocumentRoot "${WEBMAIL_BASEDIR}/htdocs/" +EOF +else + cat <> ${_vhost_dir}/${WEBSITE}.conf + DocumentRoot "${WEBMAIL_BASEDIR}/htdocs/" + + Require all granted + FCGIWrapper ${WEBMAIL_BASEDIR}/conf/fcgid .php + + SetHandler fcgid-script + + Options +ExecCGI + +EOF +fi +cat <> ${_vhost_dir}/${WEBSITE}.conf + + SSLEngine on + + ## - HTTP Strict Transport Security (HSTS) + ## - + ## - HSTS tells a browser that the website should only be accessed through + ## - a secure connection. The HSTS header will be remembered by a standard + ## compliant browser for max-age seconds. + ## - + ## - Remember this settings for 1 year + ## - + Header add Strict-Transport-Security "max-age=31536000" + + SSLCertificateFile ${_apache_cert_dir}/$APACHE_SERVER_CERT + SSLCertificateKeyFile ${_apache_cert_dir}/$APACHE_SERVER_KEY + $_SSLCertificateChainFile + + CustomLog ${APACHE_LOG_DIR}/${WEBSITE}-access.log combined + ErrorLog ${APACHE_LOG_DIR}/${WEBSITE}-error.log + + + + +## - IPv6 +## - + + + ServerAdmin $WEBMASTER_EMAIL + + ServerName $WEBSITE + + RewriteEngine on + RewriteCond %{HTTPS} !=on + RewriteRule (.*) https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L] + + CustomLog ${APACHE_LOG_DIR}/${WEBSITE}-access.log combined + ErrorLog ${APACHE_LOG_DIR}/${WEBSITE}-error.log + + + + + + + ServerAdmin $WEBMASTER_EMAIL + + ServerName $WEBSITE + +EOF + +if $_use_mod_php ; then + + cat <> ${_vhost_dir}/${WEBSITE}.conf + ## - its allowed to overwrite by .htaccess + ## - + php_value error_reporting "E_ALL & ~E_NOTICE" + + ## - Overwriting by .htaccess NOT allowd + ## - + php_admin_value upload_tmp_dir "${WEBMAIL_BASEDIR}/tmp/" + php_admin_flag log_errors on + php_admin_value error_log "${WEBMAIL_BASEDIR}/logs/php_error.log" + php_admin_value session.save_path "${WEBMAIL_BASEDIR}/sessions" + + DocumentRoot "${WEBMAIL_BASEDIR}/htdocs/" +EOF +else + cat <> ${_vhost_dir}/${WEBSITE}.conf + DocumentRoot "${WEBMAIL_BASEDIR}/htdocs/" + + Require all granted + FCGIWrapper ${WEBMAIL_BASEDIR}/conf/fcgid .php + + SetHandler fcgid-script + + Options +ExecCGI + +EOF +fi +cat <> ${_vhost_dir}/${WEBSITE}.conf + + SSLEngine on + + ## - HTTP Strict Transport Security (HSTS) + ## - + ## - HSTS tells a browser that the website should only be accessed through + ## - a secure connection. The HSTS header will be remembered by a standard + ## compliant browser for max-age seconds. + ## - + ## - Remember this settings for 1 year + ## - + Header add Strict-Transport-Security "max-age=31536000" + + SSLCertificateFile ${_apache_cert_dir}/$APACHE_SERVER_CERT + SSLCertificateKeyFile ${_apache_cert_dir}/$APACHE_SERVER_KEY + $_SSLCertificateChainFile + + CustomLog ${APACHE_LOG_DIR}/${WEBSITE}-access.log combined + ErrorLog ${APACHE_LOG_DIR}/${WEBSITE}-error.log + + +EOF + + +## - install roundcube +## - +cd $SRC_ARCHIVE_DIR +if [ ! -f roundcubemail-${ROUNDCUBE_VERSION}.tar.gz ]; then + wget http://downloads.sourceforge.net/project/roundcubemail/roundcubemail/${ROUNDCUBE_VERSION}/roundcubemail-${ROUNDCUBE_VERSION}.tar.gz +fi + +cd $SRC_BASE_DIR +if [ -d roundcubemail-${ROUNDCUBE_VERSION} ];then + mv roundcubemail-${ROUNDCUBE_VERSION} roundcubemail-${ROUNDCUBE_VERSION}.`date +%Y%m%d-%H%M` +fi +gunzip < ${SRC_ARCHIVE_DIR}/roundcubemail-${ROUNDCUBE_VERSION}.tar.gz | tar -xf - + +mkdir -p $WEBMAIL_BASEDIR +cp -a ${SRC_BASE_DIR}/roundcubemail-${ROUNDCUBE_VERSION} $WEBMAIL_BASEDIR/ +chown -R root:root $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION} + +#mkdir -p $WEBMAIL_BASEDIR/{sessions,tmp,temp,logs} +#if [ -h "${WEBMAIL_BASEDIR}/htdocs" ]; then +# rm ${WEBMAIL_BASEDIR}/htdocs +#elif [ -d "${WEBMAIL_BASEDIR}/htdocs" ]; then +# mv ${WEBMAIL_BASEDIR}/htdocs ${WEBMAIL_BASEDIR}/htdocs.`date +%Y%m%d-%H%M` +#elif [ -f "${WEBMAIL_BASEDIR}/htdocs" ]; then +# mv ${WEBMAIL_BASEDIR}/htdocs ${WEBMAIL_BASEDIR}/htdocs.`date +%Y%m%d-%H%M` +#fi + +ln -s roundcubemail-${ROUNDCUBE_VERSION} ${WEBMAIL_BASEDIR}/htdocs + +########################### + +chown -R ${WEBSERVER_USER}:${WEBSERVER_GROUP} $WEBMAIL_BASEDIR/{sessions,temp,tmp,logs} + +if $_apache_debian ; then + ## - add to /etc/apache2/ports.conf + ## - + ## - NameVirtualHost 46.4.73.217:80 + ## - NameVirtualHost [2a01:4f8:140:34c1::4]:80 + ## - Listen 46.4.73.217:80 + ## - Listen [2a01:4f8:140:34c1::4]:80 + ## - + ## - .. + ## - NameVirtualHost 46.4.73.217:443 + ## - NameVirtualHost [2a01:4f8:140:34c1::4]:443 + ## - Listen 46.4.73.217:443 + ## - Listen [2a01:4f8:140:34c1::4]:443 + ## - + ## - .. + vim /etc/apache2/ports.conf + + + ## - enable site webmail.warenform.de + ## - + a2ensite ${WEBSITE}.conf + /etc/init.d/apache2 reload +else + /etc/init.d/apache2 restart +fi + +## - install a cronjob for cleaning up tmp-directory +## - +crontab -l > /tmp/tmp_crontab +echo "" >> /tmp/tmp_crontab +echo "## - cleanup temp directory of the webmailer" >> /tmp/tmp_crontab +echo "## -" >> /tmp/tmp_crontab +echo "23 3 * * * find $WEBMAIL_BASEDIR/tmp -type f -mtime +1 -exec rm -f {} \;" >> /tmp/tmp_crontab +crontab /tmp/tmp_crontab +rm /tmp/tmp_crontab + + +## - logrotate logfiles from webmailer, locatet at $WEBMAIL_BASEDIR/logs +## - +cat < /etc/logrotate.d/roundcube +$WEBMAIL_BASEDIR/logs/errors +$WEBMAIL_BASEDIR/logs/sql +$WEBMAIL_BASEDIR/logs/sendmail +$WEBMAIL_BASEDIR/logs/*.log { + daily + start 0 + rotate 7 + missingok + notifempty + compress + delaycompress + create 640 www-data www-data + copytruncate +} +EOF + + +## - + + +## - Datenbank etstellen: +## - +## - MySQL/PostgreSQL Datenbank erstellen +## - +## - + +if [ "$_db_type" = "mysql" ]; then + if ! mysql -u$_mysql_rootuser -p$_mysql_rootpass -N -s -e \ + "SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = '$_db_name'" 2>/dev/null \ + | grep $_db_name > /dev/null 2>&1 ; then + mysql -u$_mysql_rootuser -p$_mysql_rootpass -N -s -e \ + "CREATE DATABASE IF NOT EXISTS $_db_name CHARACTER SET utf8 COLLATE utf8_general_ci" + mysql -u$_mysql_rootuser -p$_mysql_rootpass -N -s -e \ + "GRANT ALL ON $_db_name.* TO '$_db_user'@'localhost' IDENTIFIED BY '$_db_pass'" + mysql -u$_mysql_rootuser -p$_mysql_rootpass -N -s -e "FLUSH PRIVILEGES" + fi +elif [ "$_db_type" = "pgsql" ]; then + count=`su - postgres -c "psql -q -A -t -l" | grep -c -e "^$_db_name"` + if [ $count -eq 0 ];then + echo "CREATE ROLE $_db_user WITH LOGIN NOCREATEDB NOCREATEROLE NOSUPERUSER ENCRYPTED PASSWORD '$_db_pass'" \ + | su - postgres -c "psql" > /dev/null + su - postgres -c "createdb -E utf8 -O $_db_user $_db_name" + fi +fi + + +## - run roundcube installer in webbrowser +## - +## - change: +## - +## - General configuration: +## - +## - temp_dir -> $WEBMAIL_TMPDIR +## - i.e. /var/www/webmail2.oopen.de/temp/ +## - +## - Logging and Debugging: + +## - log_dir -> /logs/ +## - i.e. /var/www/webmail2.oopen.de/logs/ +## - +## - Database setup as needed +## - +## - IMAP Settings: +## - +## - default_host -> localhost +## - default_port -> 143 +## - junk_mbox -> as needed i.e. Spam +## - +## - SMTP Settings +## - +## - smtp_server -> localhost +## - smtp_port -> 25 +## - smtp_user/smtp_pass -> [x] Use the current IMAP username and password for SMTP authentication +## - +## - Display settings & user prefs +## - +## - language -> de_DE +## - skin -> classic +## - +http://${WEBSITE}/installer +cat <>$WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/config/config.inc.php + +// ================================== +// Added after basic installation +// ================================== + +// ---------------------------------- +// SYSTEM +// ---------------------------------- + +// Allow browser-autocompletion on login form. +// 0 - disabled, 1 - username and host only, 2 - username, host, password +\$config['login_autocomplete'] = 1; + +// Path to a local mime magic database file for PHPs finfo extension. +// Set to null if the default path should be used. +\$config['mime_magic'] = '/usr/share/misc/magic'; + + +// ---------------------------------- +// USER PREFERENCES +// ---------------------------------- + +// Clear Trash on logout +\$config['logout_purge'] = true; + +// 'Delete always' +// This setting reflects if mail should be always deleted +// when moving to Trash fails. This is necessary in some setups +// when user is over quota and Trash is included in the quota. +\$config['delete_always'] = true; + +EOF + + +## - edit $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}//program/localization/de_DE/labels.inc +## - $labels['welcome'] = 'Login $product'; +## - +vim $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}//program/localization/de_DE/labels.inc + +## - to display/print the logo if a message is printed +## - +## - edit skins/default/print.css +## - +## - add to section "#header" +## - visibility: hidden; +## - + + +## -------- +## - Enable Spellchecking +## - +## - i.e for languages +## - English Deutsch Dansk Français Italiano Español +## - +apt-get install aspell-en aspell-de aspell-da aspell-es aspell-fr aspell-it + +## - In config.inc.pgp add/change: +## - +## - // Make use of the built-in spell checker. It is based on GoogieSpell. +## - // Since Google only accepts connections over https your PHP installatation +## - // requires to be compiled with Open SSL support +## - $config['enable_spellcheck'] = true; +## - +## - // Set the spell checking engine. Possible values: +## - // - 'googie' - the default +## - // - 'pspell' - requires the PHP Pspell module and aspell installed +## - // - 'enchant' - requires the PHP Enchant module +## - // - 'atd' - install your own After the Deadline server or check with the people at http://www.afterthedeadline.com before using their API +## - // Since Google shut down their public spell checking service, you need to +## - // connect to a Nox Spell Server when using 'googie' here. Therefore specify the 'spellcheck_uri' +## - //$config['spellcheck_engine'] = 'googie'; +## - $config['spellcheck_engine'] = 'pspell'; +## - +## - // These languages can be selected for spell checking. +## - // Configure as a PHP style hash array: array('en'=>'English', 'de'=>'Deutsch'); +## - // Leave empty for default set of available language. +## - // +## - // Take care tha dictionaries for aspell ar installed ! +## - // for debian: +## - // apt-get install aspell-en aspell-de aspell-da aspell-es aspell-fr aspell-it +## - $config['enable_spellcheck'] = true; +## - $config['spellcheck_engine'] = 'pspell'; +## - $config['spellcheck_languages'] = array( +## - 'en' => 'English', +## - 'de' => 'Deutsch', +## - 'da' => 'Dansk', +## - 'fr' => 'Français', +## - 'it' => 'Italiano', +## - 'es' => 'Español', +## - ); +## - // Makes that words with all letters capitalized will be ignored (e.g. GOOGLE) +## - $config['spellcheck_ignore_caps'] = true; +## - +## - // Makes that words with numbers will be ignored (e.g. g00gle) +## - $config['spellcheck_ignore_nums'] = true; +## - +## - // Makes that words with symbols will be ignored (e.g. g@@gle) +## - $config['spellcheck_ignore_syms'] = true; +## - +cat <>$WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/config/config.inc.php + +// ---------------------------------- +// USER INTERFACE +// ---------------------------------- + +// Make use of the built-in spell checker. It is based on GoogieSpell. +// Since Google only accepts connections over https your PHP installatation +// requires to be compiled with Open SSL support +\$config['enable_spellcheck'] = true; + +// Enables spellchecker exceptions dictionary. +// Setting it to 'shared' will make the dictionary shared by all users. +\$config['spellcheck_dictionary'] = false; + +// Set the spell checking engine. Possible values: +// - 'googie' - the default +// - 'pspell' - requires the PHP Pspell module and aspell installed +// - 'enchant' - requires the PHP Enchant module +// - 'atd' - install your own After the Deadline server or check with the people at http://www.afterthedeadline.com before using their API +// Since Google shut down their public spell checking service, you need to +// connect to a Nox Spell Server when using 'googie' here. Therefore specify the 'spellcheck_uri' +\$config['spellcheck_engine'] = 'pspell'; + +// For locally installed Nox Spell Server or After the Deadline services, +// please specify the URI to call it. +// Get Nox Spell Server from http://orangoo.com/labs/?page_id=72 or +// the After the Deadline package from http://www.afterthedeadline.com. +// Leave empty to use the public API of service.afterthedeadline.com +\$config['spellcheck_uri'] = ''; + +// These languages can be selected for spell checking. +// Configure as a PHP style hash array: array('en'=>'English', 'de'=>'Deutsch'); +// Leave empty for default set of available language. +// +// Take care tha dictionaries for aspell ar installed ! +// for debian: +// apt-get install aspell-en aspell-de aspell-da aspell-es aspell-fr aspell-it +\$config['spellcheck_languages'] = array( + 'en' => 'English', + 'de' => 'Deutsch', + 'da' => 'Dansk', + 'fr' => 'Français', + 'it' => 'Italiano', + 'es' => 'Español', +); +// Makes that words with all letters capitalized will be ignored (e.g. GOOGLE) +\$config['spellcheck_ignore_caps'] = true; + +// Makes that words with numbers will be ignored (e.g. g00gle) +\$config['spellcheck_ignore_nums'] = true; + +// Makes that words with symbols will be ignored (e.g. g@@gle) +\$config['spellcheck_ignore_syms'] = true; + +EOF + + +## - Notice: +## - +## - - robots.txt +## - - favicon.ico + + +## -------------------------------------------- # +## --- Install Plugin Manager for Roundcube --- # +## -------------------------------------------- # + +## - Download base plugins from: +## - http://myroundcube.com/myroundcube-plugins/plugin-manager +## - +## - See also: +## - https://code.google.com/p/myroundcube/ +## - + +## - unzip downloaded plugins.zip file into plugin folder +## - of roundcube installation. + +## - register plugin, add "plugin_manager" to array plugins +## - $rcmail_config['plugins'] = array('plugin_manager'); +## - +vim $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/config/main.inc.php + +## - Notice: +## - This install also plugins: +## - - codemirror_ui +## - - db_version +## - - http_request +## - - plugin_manager +## - - qtip +## - - settings + + +## ------------------------------- # +## --- Install plugin lang_sel --- # +## ------------------------------- # + +## - Download Plugin from roundcube webmail interface +## - +## - Settings -> Plugins downloads +## - +## - Unpack to "$WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins/" directory +## - + +cp $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins/lang_sel/config.inc.php.dist \ + $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins/lang_sel/config.inc.php + + +## ---------- +## --- Provied Language selection on logon screen - ## +## ---------- + +## - !! +## - +## - For that to work, plugin's "settings" and "lang_sel" must be present +## - if not yet authenticated (logged in into roundcube) + + +## - Notice! +## - Currently (at time of that installation) pluginmanager in conjunction with +## - plugins 'lang_sel' and 'settings' does not work as exspected: +## - +## - $rcmail_config['plugin_manager_unauth'] = array( +## - .. +## - 'settings' => true, +## - 'lang_sel' => true, +## - ); +## - +## - +## - $rcmail_config['plugin_manager_defaults'] = array( +## - ... +## - 'globalplugins' => array( +## - 'settings' => array('protected' => true, 'active' => true), +## - 'lang_sel' => array('protected' => true, 'active' => true), +## - .. +## - +## - Configuring that way, a language selection is shown. but the selected language +## - IS NOT loaded. +## - +## - But if registering within roundcube providing a Language selection on logon screen +## - works fine WITH loadind the selected language: +## - +## - Comment out all settings in plugin_manager concerning plugins 'lang_sel' and +## - settings +## - +vim $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins/plugin_manager/config.inc.php +## - +## - Afterwards register plugins in roundcube( maybe the registration order in that array +## - is : +## - +## - $rcmail_config['plugins'] = array('settings', 'lang_sel','plugin_manager'); +## - +vim $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/config/main.inc.php + + +## -------------------------------- # +## --- Install plugin vkeyboard --- # +## -------------------------------- # + +## - Download Plugin from roundcube webmail interface +## - +## - Settings -> Plugins downloads +## - +## - Unpack to "$WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins/" directory +## - + + +## --------------------------------- # +## --- Install plugin timepicker --- # +## --------------------------------- # + +## - Download Plugin from roundcube webmail interface +## - +## - Settings -> Plugins downloads +## - +## - Unpack to "$WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins/" directory +## - + + +## ----------------------------------- # +## --- Install plugin idle_timeout --- # +## ----------------------------------- # + +## - Download Plugin from roundcube webmail interface +## - +## - Settings -> Plugins downloads +## - +## - Unpack to "$WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins/" directory +## - +cp $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins/idle_timeout/config.inc.php.dist \ + $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins/idle_timeout/config.inc.php + +## - Edit plugins configuration file (config.inc.php) +## - +## - add/change: +## - +## - $rcmail_config['idle_timeout_warning'] = 28; +## - $rcmail_config['idle_timeout_logout'] = 2; +## - +vim $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins/idle_timeout/config.inc.php + + +## ----------------------------------------------- # +## --- integrate password plugin for roundcube --- # +## ----------------------------------------------- # + +cp $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins/password/config.inc.php.dist \ + $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins/password/config.inc.php + +## - edit $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins/password/config.inc.php +## - +## - adjust: +## - +## - $rcmail_config['password_driver'] = 'sql'; +## - $rcmail_config['password_confirm_current'] = true; +## - +## - NOTE: The database configuration data from POSTFIX Dateabase are needed !! +## - Put in your database credentials +## - +## - $rcmail_config['password_db_dsn'] = '${_db_type}://${_db_user}:${_db_pass}@localhost/${_db_name}'; +## - +## - $rcmail_config['password_query'] = 'UPDATE mailbox SET password=%p WHERE username=%u'; +## - +vim $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins/password/config.inc.php + + +## ------------------------------------------ # +## --- integrate acl plugin for roundcube --- # +## ------------------------------------------ # + +cp $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins/acl/config.inc.php.dist \ + $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins/acl/config.inc.php + +## - edit $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins/acl/config.inc.php +## - +## - change: +## - $rcmail_config['acl_advanced_mode'] = true; +## - +vim $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins/acl/config.inc.php + + +## - Note: register plugin either with plugin_manager or with roundcube methode NOT BOTH + + +## - register acl plugin with plugin_manager +## - +## - edit: $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins/plugin_manager/config.inc.php +## - +## - add to array $rcmail_config['plugin_manager_defaults'] (Section globalplugins) +## - after line "'globalplugins' => array(" +## - +## - 'acl' => array('protected' => true, 'active' => true), +## - +vim $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins/plugin_manager/config.inc.php + + +## - register acl plugin with roundcube +## - +## - edit $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/config/main.inc.php +## - +## - add "acl" to array plugins +## - $rcmail_config['plugins'] = array('global_alias','contextmenue', 'password', 'acl'); +## - +vim $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/config/main.inc.php + + +## -------------------------------------------------- # +## --- integrate managesieve plugin for roundcube --- # +## -------------------------------------------------- # + + +cp $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins/managesieve/config.inc.php.dist \ + $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins/managesieve/config.inc.php + +## - edit $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins/managesieve/config.inc.php +## - +## - adjust the following variables: +## - $rcmail_config['managesieve_port'] = 4190; +## - $rcmail_config['managesieve_default'] = '/usr/local/dovecot/etc/dovecot/sieve/move-spam.sieve'; +## - +## - +vim $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins/managesieve/config.inc.php + + + +## ---------------------- +## - Install contextmenue +## - + + + + +## ---------------------------------- # +## --- Install plugin markasjunk2 --- # +## ---------------------------------- # + +cd $WEBMAIL_BASEDIR +rm markasjunk2.tar.gz +wget http://www.tehinterweb.co.uk/roundcube/plugins/markasjunk2.tar.gz + +gunzip < $WEBMAIL_BASEDIR/markasjunk2.tar.gz | tar -C $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins -xf - + +cp $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins/markasjunk2/config.inc.php.dist \ + $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins/markasjunk2/config.inc.php + +## ---------------------------------------------------------------------- +## ---------------------------------------------------------------------- +## ---------------------------------------------------------------------- + + +## ---------------------- +## - Install global_alias +## - + +cp -a $WEBMAIL_TMPDIR/plugins/global_alias $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins/ + +cp -a $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins/global_alias/config.inc.php.dist \ + $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins/global_alias/config.inc.php + + +## - Note: register plugin either with plugin_manager or with roundcube methode NOT BOTH + + +## - register global_alias plugin with plugin_manager +## - +## - edit: $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins/plugin_manager/config.inc.php +## - +## - add to array $rcmail_config['plugin_manager_defaults'] (Section globalplugins) +## - after line "'globalplugins' => array(" +## - +## - 'global_alias' => array( +## - 'protected' => true, +## - /* +## - 'hosts' => array('mail4us.net', 'svn.mail4us.net'), +## - */ +## - 'hosts' => false, +## - 'active' => true +## - ), +## - +vim $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins/plugin_manager/config.inc.php + + +## - register global_alias with roundcube +## - +## - edit $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/config/main.inc.php +## - +## - register plugin, add "global_alias" to array plugins +## - $rcmail_config['plugins'] = array('global_alias'); +## - +vim $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/config/main.inc.php + + +## ----------------------------------------------- # +## --- integrate calendar plugin for roundcube --- # +## ----------------------------------------------- # + +## - requirements: +## - - plugin jqueryui +## - - plugin qtip +## - - plugin http_auth +## - - plugin jscolor +## - + +## ------------------- +## - Install http_auth +## - + +## - Download within the plugin manager +## - +cp -a ${WEBMAIL_BASEDIR}/plugins/http_auth $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins/ + + +## ------------------- +## - Install jscolor +## - + +## - Download within the plugin manager +## - +cp -a $WEBMAIL_BASEDIR/plugins/jscolor $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins/ + + +## - create configuration file +## - +cp -a $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins/jscolor/config.inc.php.dist \ + $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins/jscolor/config.inc.php + + + +## ------------------ +## - Install calendar +## - +cp -a $WEBMAIL_BASEDIR/plugins/calendar $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins/ + +cp -a $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins/calendar/config.inc.php.dist \ + $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins/calendar/config.inc.php + + +## - edit $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins/calendar/config.inc.php +## - +## - adjust the following variables: +## - $rcmail_config['calendar_admin'] = 'ckubu@oopen.de'; +## - +## - # Notice: make this folder writable for webserver user +## - # +## - $rcmail_config['cal_tempdir'] = '$WEBMAIL_BASEDIR/temp'; i.e. /var/www/webmail.oopen.de/temp +## - $rcmail_config['backend'] = "database"; +## - +## - +## - # smtp login data needed for cronjob "reminders.php" +## - # +## - $rcmail_config['cron_log'] = true; +## - $rcmail_config['cron_smtp_user'] = 'adm@oopen.de'; //smtp user +## - $rcmail_config['cron_smtp_pass'] = 'EadGl15E'; //smtp password +## - $rcmail_config['cron_rc_url'] = 'http://webmail.oopen.de/'; //trailing slash !!! +## - $rcmail_config['cron_ip'] = '127.0.0.1'; //please use real IP +## - $rcmail_config['cron_sender'] = 'noreply@oopen.de'; +## - +vim $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins/calendar/config.inc.php + +chown $WEBSERVER_USER:$WEBSERVER_GROUP $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins/calendar/temp + +## - create tables for calendar plugin in roundcube database +## - you will find needed sql-statements in directora calendar/SQL +## - +## - !! Do that as roundcube user !! +## - if not, you have to adjust ownerchip of tables and sequences afterwards +## - ALTER TABLE OWNER TO ; +## - ALTER SEQUENCE OWNER TO ; +## - + + +## - Trigger cronjob for sending reminders +## - +## - +## - */5 * * * * su $WEBSERVER_USER -c"php5 -d suhosin.session.encrypt=off $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins//calendar/cron/reminders.php" > /dev/null +## - +## - !! Notice +## - +## - I have compiled and installed php from source code. so i ha to change +## - my crontab rule because of errors ("Class rcmail not found" or +## - "Location not found" to +## - +## - */5 * * * * su www-data -c "cd /var/www/webmail.initiativenserver.de/htdocs/plugins/calendar/cron ; /usr/local/php/bin/php -d suhosin.session.encrypt=off -f reminders.php" +## - +crontab -l > /tmp/tmp_crontab +echo "" >> /tmp/tmp_crontab +echo "## - Trigger cronjob for sending reminders (calendar plugin roundcube)" >> /tmp/tmp_crontab +echo "## -" >> /tmp/tmp_crontab +echo "*/5 * * * * su $WEBSERVER_USER -c\"php5 -d suhosin.session.encrypt=off $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins//calendar/cron/reminders.php > /dev/null" >> /tmp/tmp_crontab +crontab /tmp/tmp_crontab +rm /tmp/tmp_crontab + + +## - Note: register plugin either with plugin_manager or with roundcube methode NOT BOTH + +## - register calendar plugin with plugin_manager +## - +## - edit: $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins/plugin_manager/config.inc.php +## - +## - add to array $rcmail_config['plugin_manager_defaults'] (Section calendaring) +## - after line "'calendar' => array(" +## - +## - 'calendar' => array( +## - 'label_name' => 'calendar.pluginname', +## - 'label_description' => 'calendar.plugindescription', +## - 'buttons' => array('#calendar_button', '#rcmrowcalendarlink', '#rcmrowcalendarcategories', '#rcmrowcalendarfeeds'), +## - 'reload' => true, +## - 'config' => './?_task=settings&_action=edit-prefs&_section=calendarlink&_framed=1', +## - 'section' => 'calendarlink', +## - 'uninstall' => true, +## - 'uninstall_request' => array( +## - 'action' => 'plugin.calendar_uninstall', +## - 'method' => 'post', +## - ), +## - 'active' => true +## - ), +## - +vim $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins/plugin_manager/config.inc.php + + +## - register calendar plugin without using plugin_manager +## - +## - edit $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/config/main.inc.php +## - +## - add "calendar" to array plugins +## - $rcmail_config['plugins'] = array('global_alias','contextmenue', 'password', 'acl', 'calendar') +## - +vim $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/config/main.inc.php + + + +## ----------------------- +## - Install calendar_plus +## - + + + +## ----------------- +## - Install carddav +## - + + + +## ---------------------- +## - Install carddav_plus +## - + + + +## --------------------------------------------------- # +## --- Install vacation plugin bhusigen rc-vacation -- # +## --------------------------------------------------- # + +## - see: https://github.com/bhuisgen/rc-vacation/ + +## - Download from site https://github.com/bhuisgen/rc-vacation/ and +## - store archive in $WEBMAIL_BASEDIR +## - +cd $WEBMAIL_BASEDIR +rm rc-vacation-master.zip +wget -O rc-vacation-master.zip https://github.com/bhuisgen/rc-vacation/archive/master.zip + +cd $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins +unzip $WEBMAIL_BASEDIR/rc-vacation-master.zip +ln -s rc-vacation-master $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins/vacation + + +## - +## - or use git to get the sources directly: +## - +cd $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins +git clone https://github.com/bhuisgen/rc-vacation.git + +ln -s rc-vacation vacation + +cp $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins/vacation/config.inc.php.dist \ + $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins/vacation/config.inc.php + + +if [ "$_db_type" = "pgsql" ];then + + ## -------------------------------------------------------------- ## + ## - !! That (very long) part concerns to PostgeSQL Database !! - ## + ## -------------------------------------------------------------- ## + + ## - Note: In the following sql statements set the correct AUTOREPLY domain !! + ## - Also chnage the database parameters as yor needs + ## - + ## - edit configuration $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins/vacation/config.inc.php + ## - + ## - $rcmail_config['vacation_gui_vacationforwarder'] = TRUE; + ## - $rcmail_config['vacation_forwarder_multiple'] = TRUE; + ## - $rcmail_config['vacation_forwarder_separator'] = ','; + ## - + ## - $rcmail_config['vacation_driver'] = 'sql'; + ## - + ## - #configure your database connection to POSTFIX database + ## - $rcmail_config['vacation_sql_dsn'] = '${_db_type}://${_db_user}:${_db_pass}@localhost/${_db_name}'; + ## - + ## - + ## - # !! NOTE: You have to create postgres function udf_forwarders_out and + ## - # udf_forwarders_in to get the following SQL statements working + ## - # + ## - /* - OLD: vcation.pl included in posfixadmin until version 2.3.7 + ## - $rcmail_config['vacation_sql_read'] = + ## - array("SELECT subject AS vacation_subject, body AS vacation_message, " . + ## - "CASE WHEN vacation.active = TRUE THEN 1 ELSE 0 END AS vacation_enable, " . + ## - "udf_forwarders_out(%username,'$_autoreply_domain',',') AS vacation_forwarder FROM vacation,alias " . + ## - "WHERE email=%username AND address=%username AND vacation.domain=%email_domain;" + ## - ); + ## - */ + ## - /* - NEW: vcation.pl included in posfixadmin since version 2.91 + ## - $rcmail_config['vacation_sql_read'] = + ## - array("SELECT subject AS vacation_subject, body AS vacation_message, date_part('epoch',activefrom)::int AS vacation_start, date_part('epoch',activeuntil)::int AS vacation_end, " . + ## - "CASE WHEN vacation.active = TRUE THEN 1 ELSE 0 END AS vacation_enable, " . + ## - "udf_forwarders_out(%username,'autoreply.oopen.de',',') AS vacation_forwarder FROM vacation,alias " . + ## - "WHERE email=%username AND address=%username AND vacation.domain=%email_domain;" + ## - ); + ## - */ + ## - + ## - + ## - /* !! Wichtig: + ## - Nur wenn rcmail_config['vacation_gui_vacationforwarder'] = FALSE + ## - */ + ## - + ## - + ## - /* - OLD: vcation.pl included in posfixadmin until version 2.3.7 + ## - $rcmail_config['vacation_gui_vacationforwarder'] = FALSE; + ## - $rcmail_config['vacation_sql_write'] = + ## - array("DELETE FROM vacation WHERE email=%email AND " . + ## - "domain=%email_domain;", + ## - "DELETE from vacation_notification WHERE on_vacation=%email;", + ## - "INSERT INTO vacation (email,domain,subject,body,created," . + ## - "active) VALUES (%email,%email_domain,%vacation_subject," . + ## - "%vacation_message,NOW(),udf_set_active(%vacation_enable));", + ## - "UPDATE alias SET goto = udf_forwarders_in(udf_forwarders_out(%email,'$_autoreply_domain',',')," . + ## - "%email,'$_autoreply_domain',',',udf_set_active(%vacation_enable))" . + ## - ", modified = NOW() " . + ## - " WHERE address = %email" + ## - + ## - ); + ## - */ + ## - /* - NEW: vcation.pl included in posfixadmin since version 2.91 + ## - --------------------------------------------------------------- + ## - $rcmail_config['vacation_gui_vacationforwarder'] = FALSE; + ## - $rcmail_config['vacation_sql_write'] = + ## - array("DELETE FROM vacation WHERE email=%email AND domain=%email_domain;", + ## - "DELETE from vacation_notification WHERE on_vacation=%email;", + ## - "INSERT INTO vacation (email,domain,subject,body,activefrom,activeuntil,interval_time,created,active) " . + ## - "VALUES (%email,%email_domain,%vacation_subject,%vacation_message," . + ## - "to_timestamp(%vacation_start - extract(timezone from current_timestamp))," . + ## - "to_timestamp(%vacation_end + 86399 - extract(timezone from current_timestamp))," . + ## - "86400,NOW(),udf_set_active(%vacation_enable));", + ## - "UPDATE alias SET goto = udf_forwarders_in(udf_forwarders_out(%email,'$_autoreply_domain',',')," . + ## - "%email,'$_autoreply_domain',',',udf_set_active(%vacation_enable))" . + ## - ", modified = NOW() " . + ## - " WHERE address = %email" + ## - + ## - ); + ## - */ + ## - + ## - + ## - /* !! Wichtig: + ## - Nur wenn rcmail_config['vacation_gui_vacationforwarder'] = TRUE + ## - */ + ## - + ## - /* - OLD: vcation.pl included in posfixadmin until version 2.3.7 + ## - ------------------------------------------------------------- + ## - $rcmail_config['vacation_gui_vacationforwarder'] = TRUE; + ## - $rcmail_config['vacation_sql_write'] = + ## - array("DELETE FROM vacation WHERE email=%email AND " . + ## - "domain=%email_domain;", + ## - "DELETE from vacation_notification WHERE on_vacation=%email;", + ## - "INSERT INTO vacation (email,domain,subject,body,created," . + ## - "active) VALUES (%email,%email_domain,%vacation_subject," . + ## - "%vacation_message,NOW(),udf_set_active(%vacation_enable));", + ## - "UPDATE alias SET goto = udf_forwarders_in(%vacation_forwarder," . + ## - "%email,'$_autoreply_domain',',',udf_set_active(%vacation_enable))" . + ## - ", modified = NOW() " . + ## - " WHERE address = %email" + ## - + ## - ); + ## - */ + ## - /* - NEW: vcation.pl included in posfixadmin since version 2.91 + ## - --------------------------------------------------------------- + ## - $rcmail_config['vacation_gui_vacationforwarder'] = TRUE; + ## - $rcmail_config['vacation_sql_write'] = + ## - array("DELETE FROM vacation WHERE email=%email AND domain=%email_domain;", + ## - "DELETE from vacation_notification WHERE on_vacation=%email;", + ## - "INSERT INTO vacation (email,domain,subject,body,activefrom,activeuntil,interval_time,created,active) " . + ## - "VALUES (%email,%email_domain,%vacation_subject,%vacation_message," . + ## - "to_timestamp(%vacation_start - extract(timezone from current_timestamp))," . + ## - "to_timestamp(%vacation_end + 86399 - extract(timezone from current_timestamp))," . + ## - "86400,NOW(),udf_set_active(%vacation_enable));", + ## - "UPDATE alias SET goto = udf_forwarders_in(%vacation_forwarder," . + ## - "%email,'$_autoreply_domain',',',udf_set_active(%vacation_enable))" . + ## - ", modified = NOW() " . + ## - " WHERE address = %email" + ## - ); + ## - */ + + ## - + vim $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins/vacation/config.inc.php + + + ## - create postfix trigger function udf_forwarders_out: + ## - + cat < /tmp/postgres.forwarders_out.sql +CREATE LANGUAGE plpgsql; + +CREATE FUNCTION udf_forwarders_out(email_str text, vacation_domain text, list_seperator character) RETURNS text + LANGUAGE plpgsql + AS \$\$ + DECLARE + forward_str text; + local_email_part TEXT; + domain_email_part TEXT; + BEGIN + + -- get list of forwarders + -- + SELECT goto INTO forward_str FROM alias WHERE address=email_str; + + -- entferne mailbox emailadresse + -- + forward_str = replace(forward_str, email_str, '' ); + + -- entferne vacation adresse + -- + local_email_part = substring(email_str, 1, position('@' in email_str) - 1); + domain_email_part = substring(email_str, position('@' in email_str) + 1 ); + forward_str = replace(forward_str, local_email_part || '#' || domain_email_part || '@' || vacation_domain, ''); + + -- enferne doppelte seperatorzeichen + -- + WHILE position( list_seperator || list_seperator in forward_str ) > 0 LOOP + forward_str = replace(forward_str, list_seperator || list_seperator , ''); + END LOOP; + + -- entferne erstes zeichen wenn es das seperatorzeichen ist + -- + IF substring(forward_str,1,1) = list_seperator THEN + forward_str = substring(forward_str from 2); + END IF; + + + -- entferne letztes zeichen wenn es das seperatorzeichen ist + -- + IF substring(forward_str from char_length(forward_str)) = list_seperator THEN + forward_str = substring(forward_str, 1, char_length(forward_str) - 1); + END IF; + + + -- forward_str = substring(forward_str from char_length(forward_str)); + + RETURN forward_str; + END; + \$\$; +EOF + + ## - create function + ## - + ## - Note 1. + ## - if datbase language plpgsql already exists, an error occurs. but you can + ## - savely ignore that error + ## - + ## - Note 2. + ## - if you create the function not as postfix database user, you have to + ## - give the permission afterwards: + ## - ALTER FUNCTION public.udf_forwarders_out(email_str text, vacation_domain text, list_seperator character) OWNER TO postfix; + ## - But we will use the db postfix user (here also named postfix) + ## - + psql -Upostfix postfix < /tmp/postgres.forwarders_out.sql + + rm /tmp/postgres.forwarders_out.sql + + + ## - create sql file for installing function udf_set_active: + ## - + cat < /tmp/postgres.set_active.sql +CREATE LANGUAGE plpgsql; + +CREATE FUNCTION udf_set_active(vacation_enable text) RETURNS boolean + LANGUAGE plpgsql + AS \$\$ + DECLARE + return_val boolean; + BEGIN + + return_val = 't'; + + IF vacation_enable = '' THEN + return_val = 'f'; + END IF; + + IF vacation_enable = '0' THEN + return_val = 'f'; + END IF; + + IF lower(vacation_enable) = 'false' THEN + return_val = 'f'; + END IF; + + RETURN return_val; + END; + \$\$; +EOF + + ## - create function udf_set_active + ## - + ## - Note 1. + ## - if datbase language plpgsql already exists, an error occurs. but you can + ## - savely ignore that error + ## - + ## - Note 2. + ## - if you create the function not as postfix database user, you have to + ## - give the permission afterwards: + ## - ALTER FUNCTION public.udf_forwarders_in(forewarders_str text, email_str text, vacation_domain text, list_seperator character, vacation_enable boolean) OWNER TO postfix; + ## - But we will use the db postfix user (here also named postfix) + ## - + psql -Upostfix postfix < /tmp/postgres.set_active.sql + + rm /tmp/postgres.set_active.sql + + + ## - create postfix database function udf_forwarders_in: + ## - + cat < /tmp/postgres.forwarders_in.sql +CREATE LANGUAGE plpgsql; + +CREATE FUNCTION udf_forwarders_in(forewarders_str text, email_str text, vacation_domain text, list_seperator character, vacation_enable boolean) RETURNS text + LANGUAGE plpgsql + AS \$\$ + DECLARE + return_str text; + local_email_part TEXT; + domain_email_part TEXT; + BEGIN + + return_str = email_str; + + IF vacation_enable THEN + local_email_part = substring(email_str, 1, position('@' in email_str) - 1); + domain_email_part = substring(email_str, position('@' in email_str) + 1 ); + return_str = return_str || list_seperator || local_email_part || '#' || domain_email_part || '@' || vacation_domain; + END IF; + + IF char_length(forewarders_str) > 7 THEN + return_str = return_str || list_seperator || forewarders_str; + END IF; + + RETURN return_str; + END; + \$\$; +EOF + + ## - create function udf_forwarders_in + ## - + ## - Note 1. + ## - if datbase language plpgsql already exists, an error occurs. but you can + ## - savely ignore that error + ## - + ## - Note 2. + ## - if you create the function not as postfix database user, you have to + ## - give the permission afterwards: + ## - ALTER FUNCTION public.udf_forwarders_in(forewarders_str text, email_str text, vacation_domain text, list_seperator character, vacation_enable boolean) OWNER TO postfix; + ## - But we will use the db postfix user (here also named postfix) + ## - + psql -Upostfix postfix < /tmp/postgres.forwarders_in.sql + + rm /tmp/postgres.forwarders_in.sql + +elif [ "$_db_type" = "mysql" ];then + + ## ---------------------------------------------------------- ## + ## - !! That (very long) part concerns to MySQL Database !! - ## + ## ---------------------------------------------------------- ## + + ## - Note: In the following sql statements set the correct AUTOREPLY domain !! + ## - Also chnage the database parameters as yor needs + ## - + ## - edit configuration $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins/vacation/config.inc.php + ## - + ## - $rcmail_config['vacation_gui_vacationforwarder'] = FALSE; + ## - $rcmail_config['vacation_forwarder_multiple'] = FALSE; + ## - $rcmail_config['vacation_forwarder_separator'] = ','; + ## - + ## - $rcmail_config['vacation_driver'] = 'sql'; + ## - + ## - #configure your database connection to POSTFIX database + ## - $rcmail_config['vacation_sql_dsn'] = '${_db_type}://${_db_user}:${_db_pass}@localhost/${_db_name}'; + ## - + ## - # !! NOTE: You have to create myql functions FORWARDERS_OUT and + ## - # FORWARDERS_IN to get the following SQL read statement working + ## - # + ## - + ## - // read data queries + ## - /* - OLD: vcation.pl included in posfixadmin until version 2.3.7 + ## - $rcmail_config['vacation_sql_read'] = + ## - array("SELECT subject AS vacation_subject, body AS vacation_message, " . + ## - "vacation.active AS vacation_enable, FORWARDERS_OUT(%username,'$_autoreply_domain',',') AS vacation_forwarder FROM vacation,alias " . + ## - "WHERE email=%username AND address=%username AND vacation.domain=%email_domain;" + ## - ); + ## - *) + ## - /* - NEW: vcation.pl included in posfixadmin since version 2.91 */ + ## - $rcmail_config['vacation_sql_read'] = + ## - array("SELECT subject AS vacation_subject, body AS vacation_message," . + ## - "UNIX_TIMESTAMP(activefrom) AS vacation_start," . + ## - "UNIX_TIMESTAMP(activeuntil) AS vacation_end," . + ## - "vacation.active AS vacation_enable," . + ## - "FORWARDERS_OUT(%username,'autoreply.initiativenserver.de',',') AS vacation_forwarder " . + ## - "FROM vacation,alias " . + ## - "WHERE email=%username AND address=%username AND vacation.domain=%email_domain;" + ## - ); + ## - + ## - + ## - // write data queries + ## - /* !! Wichtig: + ## - Nur wenn rcmail_config['vacation_gui_vacationforwarder'] = FALSE + ## - */ + ## - + ## - /* - OLD: vcation.pl included in posfixadmin until version 2.3.7 + ## - $rcmail_config['vacation_gui_vacationforwarder'] = FALSE; + ## - $rcmail_config['vacation_sql_write'] = + ## - array("DELETE FROM vacation WHERE email=%email AND " . + ## - "domain=%email_domain;", + ## - "DELETE from vacation_notification WHERE on_vacation=%email;", + ## - "INSERT INTO vacation (email,domain,subject,body,created," . + ## - "active) VALUES (%email,%email_domain,%vacation_subject," . + ## - "%vacation_message,NOW(),%vacation_enable);", + ## - "UPDATE alias SET goto = FORWARDERS_IN(FORWARDERS_OUT(%email,'$_autoreply_domain',',')," . + ## - "%email,'$_autoreply_domain',',',%vacation_enable)" . + ## - ", modified = NOW() " . + ## - " WHERE address = %email" + ## - ); + ## - /* + ## - + ## - /* - NEW: vcation.pl included in posfixadmin since version 2.91 */ + ## - /* + ## - $rcmail_config['vacation_gui_vacationforwarder'] = FALSE; + ## - $rcmail_config['vacation_sql_write'] = + ## - array("DELETE FROM vacation WHERE email=%email AND domain=%email_domain;", + ## - "DELETE from vacation_notification WHERE on_vacation=%email;", + ## - "INSERT INTO vacation (email,domain,subject,body,activefrom,activeuntil,interval_time,created,active) " . + ## - "VALUES (%email,%email_domain,%vacation_subject,%vacation_message," . + ## - "CONCAT(DATE(FROM_UNIXTIME(%vacation_start)), ' 00:00:00')," . + ## - "CONCAT(DATE(FROM_UNIXTIME(%vacation_end)), ' 23:59:59')," . + ## - "86400,NOW(),%vacation_enable);", + ## - "UPDATE alias SET goto = FORWARDERS_IN(FORWARDERS_OUT(%email,'autoreply.initiativenserver.de',',')," . + ## - "%email,'autoreply.initiativenserver.de',',',%vacation_enable)" . + ## - ", modified = NOW() " . + ## - " WHERE address = %email" + ## - ); + ## - */ + ## - + ## - /* !! Wichtig: + ## - Nur wenn rcmail_config['vacation_gui_vacationforwarder'] = TRUE + ## - */ + ## - + ## - /* + ## - + ## - /* - OLD: vcation.pl included in posfixadmin until version 2.3.7 + ## - $rcmail_config['vacation_gui_vacationforwarder'] = TRUE; + ## - $rcmail_config['vacation_sql_write'] = + ## - array("DELETE FROM vacation WHERE email=%email AND " . + ## - "domain=%email_domain;", + ## - "DELETE from vacation_notification WHERE on_vacation=%email;", + ## - "INSERT INTO vacation (email,domain,subject,body,created," . + ## - "active) VALUES (%email,%email_domain,%vacation_subject," . + ## - "%vacation_message,NOW(),%vacation_enable);", + ## - "UPDATE alias SET goto = FORWARDERS_IN(%vacation_forwarder," . + ## - "%email,'autoreply.initiativenserver.de',',',%vacation_enable)" . + ## - ", modified = NOW() " . + ## - " WHERE address = %email" + ## - ); + ## - */ + ## - + ## - /* - NEW: vcation.pl included in posfixadmin since version 2.91 */ + ## - $rcmail_config['vacation_gui_vacationforwarder'] = TRUE; + ## - $rcmail_config['vacation_sql_write'] = + ## - array("DELETE FROM vacation WHERE email=%email AND domain=%email_domain;", + ## - "DELETE from vacation_notification WHERE on_vacation=%email;", + ## - "INSERT INTO vacation (email,domain,subject,body,activefrom,activeuntil,interval_time,created,active) " . + ## - "VALUES (%email,%email_domain,%vacation_subject,%vacation_message," . + ## - "CONCAT(DATE(FROM_UNIXTIME(%vacation_start)), ' 00:00:00')," . + ## - "CONCAT(DATE(FROM_UNIXTIME(%vacation_end)), ' 23:59:59')," . + ## - "86400,NOW(),%vacation_enable);", + ## - "UPDATE alias SET goto = FORWARDERS_IN(%vacation_forwarder," . + ## - "%email,'autoreply.initiativenserver.de',',',%vacation_enable)" . + ## - ", modified = NOW() " . + ## - " WHERE address = %email" + ## - ); + ## - + ## - + vim $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins/vacation/config.inc.php + + + ## - create function FORWARDERS_OUT: + ## - + cat < /tmp/FORWARDERS_OUT.sql +DROP FUNCTION IF EXISTS FORWARDERS_OUT ; + +DELIMITER | + +CREATE FUNCTION FORWARDERS_OUT (email_str TEXT, vacation_domain TEXT , list_seperator CHAR) + RETURNS TEXT + DETERMINISTIC + BEGIN + DECLARE forward_str TEXT; + DECLARE local_email_part TEXT; + DECLARE domain_email_part TEXT; + DECLARE first_char CHAR; + DECLARE last_char CHAR; + + -- get list of forwarders + -- + SELECT goto INTO forward_str FROM alias WHERE address=email_str; + + -- entferne mailbox emailadresse + -- + SET forward_str = REPLACE(forward_str, email_str, '' ); + -- SELECT REPLACE(forward_str, email_str, '' ) INTO forward_str; + + -- entferne vacation adresse + -- + SET local_email_part = SUBSTRING(email_str,1, LOCATE('@',email_str) - 1); + SET domain_email_part = SUBSTRING(email_str, LOCATE('@',email_str) + 1, LENGTH(email_str)); + SET forward_str = REPLACE(forward_str, CONCAT(local_email_part, "#" ,domain_email_part,"@", vacation_domain), ''); + -- SELECT REPLACE(forward_str, CONCAT(list_seperator,list_seperator), list_seperator) INTO forward_str; + + -- enferne doppelte seperatorzeichen + -- + WHILE LOCATE(CONCAT(list_seperator,list_seperator) , forward_str) DO + SET forward_str = REPLACE(forward_str, CONCAT(list_seperator,list_seperator), list_seperator); + -- SELECT REPLACE(forward_str, CONCAT(list_seperator,list_seperator), list_seperator) INTO forward_str; + END WHILE ; + + -- entferne erstes zeichen wenn es das seperatorzeichen ist + -- + IF LEFT(forward_str,1) = list_seperator THEN + SET forward_str = SUBSTRING(forward_str FROM 2); + -- SELECT SUBSTRING(forward_str FROM 2) INTO forward_str; + END IF; + + -- entferne letztes zeichen wenn es das seperatorzeichen ist + -- + IF RIGHT(forward_str,1) = list_seperator THEN + SET forward_str = SUBSTRING(forward_str , 1, LENGTH(forward_str) - 1); + -- SELECT SUBSTRING(forward_str , 1, LENGTH(forward_str) - 1) INTO forward_str; + END IF; + + RETURN forward_str; + END | + +DELIMITER ; +EOF + + ## - create function + ## - + ## - Note 1. + ## - Create function as postfix database user + ## - + ## - The postfix databaseuser wil need 'Super_priv'. At MySQL monitor + ## - (as mysql admin user i.e. root) type: + ## - UPDATE user SET Super_priv = 'Y' WHERE User = 'postfix'; + ## - + ## - Note 2. + ## - You can verify on mysql monitor (database postfix) with: + ## - SHOW FUNCTION STATUS; + ## - or see the code: + ## - SHOW CREATE FUNCTION FORWARDERS_OUT; + ## - + mysql -upostfix -p postfix < /tmp/FORWARDERS_OUT.sql + + rm /tmp/FORWARDERS_OUT.sql + + + ## - create database function FORWARDERS_IN: + ## - + cat < /tmp/FORWARDERS_IN.sql +DROP FUNCTION IF EXISTS FOWARDERS_IN ; + +DELIMITER | + +CREATE FUNCTION FORWARDERS_IN (forewarders_str TEXT, + email_str TEXT, + vacation_domain TEXT , + list_seperator CHAR , + vacation_enable BOOLEAN) + RETURNS TEXT + DETERMINISTIC + BEGIN + DECLARE return_str TEXT; + DECLARE local_email_part TEXT; + DECLARE domain_email_part TEXT; + + + SET return_str = email_str; + + IF vacation_enable THEN + SET local_email_part = SUBSTRING(email_str,1, LOCATE('@',email_str) - 1); + SET domain_email_part = SUBSTRING(email_str, LOCATE('@',email_str) + 1, LENGTH(email_str)); + SET return_str = CONCAT(return_str, list_seperator, local_email_part, "#" ,domain_email_part,"@", vacation_domain); + END IF; + + IF LENGTH(forewarders_str) > 2 THEN + SET return_str = CONCAT(return_str, list_seperator, forewarders_str); + END IF; + + RETURN return_str; + END | + +DELIMITER ; +EOF + + + ## - create function FOWARDERS_IN + ## - + ## - Note 1. + ## - Create function as postfix database user + ## - + ## - The postfix databaseuser wil need 'Super_priv'. At MySQL monitor + ## - (as mysql admin user i.e. root) type: + ## - UPDATE user SET Super_priv = 'Y' WHERE User = 'postfix'; + ## - + ## - Note 2. + ## - You can verify on mysql monitor (database postfix) with: + ## - SHOW FUNCTION STATUS; + ## - or see the code: + ## - SHOW CREATE FUNCTION FOWARDERS_IN; + ## - + + mysql -upostfix -p postfix < /tmp/FORWARDERS_IN.sql + + rm /tmp/FORWARDERS_IN.sql + +else + echo -e "\n\t[ ERROR ]: Unknown database type \"$_db_type\"" +fo + + + +## - Since version 0.9.0, due to changes in the way roundcube access database, the +## - vacation plugin doesn'work anymore. At least this plugins are affected: +## - - vacation plugin +## - - aliases plugin +## - - forward plugin +## - +## - To Fix that issue, in file lib/drivers/sql.php replace +## - all occurences of +## - +## - $db = new rcube_mdb2($dsn, '', FALSE); +## - +## - with: +## - +## - if (!class_exists('rcube_db')) { +## - $db = new rcube_mdb2($dsn, '', FALSE); +## - } else { +## - $db = rcube_db::factory($dsn, '', FALSE); +## - } +## - + +## - !! Notice: already fixed since in actual plugin distribution !! +## - +#perl -i.ORIG -n -p -e "s#^(\s*)(\\\$db\ +=\ +new rcube_mdb2\(\\\$dsn.*)#\1//!\2\n\1if (!class_exists('rcube_db')) {\n\1 \\\$db = new rcube_mdb2(\\\$dsn, '', FALSE);\n\1} else {\n\1 \\\$db = rcube_db::factory(\\\$dsn, '', FALSE);\n\1}\n#g" \ +# $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins/vacation/lib/drivers/sql.php + + +## - Note: register plugin either with plugin_manager or with roundcube methode NOT BOTH + + +## - register vacation plugin with plugin_manager +## - +## - edit: $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins/plugin_manager/config.inc.php +## - +## - add to array $rcmail_config['plugin_manager_defaults'] (Section globalplugins) +## - after line "'globalplugins' => array(" +## - +## - 'vacation' => array('protected' => true, 'active' => true), +## - +vim $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins/plugin_manager/config.inc.php + + +## - register vacation plugin with roundcube +## - +## - edit $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/config/main.inc.php +## - +## - add "rc-vacation" to array plugins +## - $rcmail_config['plugins'] = array('global_alias','contextmenue', 'password', 'acl', 'calendar', 'managesieve', 'markasjunk2', 'vkeyboard', 'vacation'); +## - +vim $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/config/main.inc.php + + +## ------------------------------------------------------------------- ## + +## ------------------------------------------- # +## --- Install vacation plugin for roundcube - # +## --- vacation-1.9.9 - # +## ------------------------------------------- # + +cd /var/www/webmail.warenform.de/htdocs/plugins/ +unzip /usr/local/src/mailsystem/tarballs/vacation-1.9.9.zip + +## - Enable the vacation plugin in config/main.inc.php. +## - +## - add 'vacation' to the array in $rcmail_config['plugins'] +## - +## - $rcmail_config['plugins'] = array('acl','password', 'vacation', 'jqueryui', 'calendar') +## - +vim /var/www/webmail.warenform.de/htdocs/config/main.inc.php + + +## - Edit config.ini to configure vacation plugin +## - +## - add lines +## - + +cat <> /var/www/webmail.warenform.de/htdocs/plugins/vacation/config.ini +[localhost] +driver = "virtual" + +; Specifies a DSN (see db.inc.php) that has access to the dbase specified +; below. -- Optional. +; +dsn = "${_db_type}://${_db_user}:${_db_pass}@localhost/${_db_name}" + +; Applies to Postfix SMTP-server only. See +; http://www.postfix.org/VIRTUAL_README.html#autoreplies. +; This must match the transport in +; /etc/postfix/transport and /etc/postfix/master.cf -- Required +; +transport = "$_autoreply_domain" + +; Database used by the mailserver. The vacation and virtual alias tables must exist +; in this database. -- Required. +dbase = "postfix" + +; Always maintain an \$email -> \$email alias in the alias table. Defaults +; to true if omitted. -- Optional. +; +always_keep_copy = true + +; Parameters used by the SQL-Queries +; %e = email address, +; %d = domainname, +; %i = domain_id, +; %m is required as the Roundcube database should be different from the mailserver's database. +; %g = goto . +; The latter is used for the transport. %g will expands to john@domain.org@\$transport + +; Query to retrieve aliases for the current user. -- Required. +; +##!select_query = "SELECT destination FROM %m.virtual_aliases WHERE source='%e' AND destination='%g'" +select_query = "SELECT goto FROM alias WHERE address='%e' AND goto='%g'"; + +; Aliases are recreated when saving vacation settings. -- Required. +; +##!delete_query = "DELETE FROM %m.virtual_aliases WHERE domain_id=%i AND source='%e'" +delete_query = "DELETE FROM alias WHERE domain='%d' AND address ='%e'"; + +; Query to create new aliases. -- Required. +; +##!insert_query = "INSERT INTO %m.virtual_aliases (domain_id,source,destination) VALUES (%i,'%e','%g')" +insert_query = "INSERT INTO alias (address,goto,domain,active) VALUES ('%e','%g','%d',true)" + +; Required if you use a domain_id for storing the domain's in the alias table. +; +##!domain_lookup_query = "SELECT id FROM postfix.virtual_domains WHERE name='%d'" + +; Creates /etc/postfixadmin/vacation.conf which has database configuration +; for the vacation.pl script. -- Optional. +; +; It uses the selected DSN to create the file. Make sure this file is only readable +; by the vacation user after it's created. +; If unset or false, you must edit vacation.pl manually and set database accordingly. +; +createvacationconf = false + +; If vacation/auto-reply gets disabled, should we delete the subject/body set +; by the end-user? -- Optional. Defaults to true. +; +always_keep_message = true + +; If set to True, the end-user will not be able to set forwards. Defaults to false. Optional +disable_forward = False + +EOF + +perl -i -n -p -e"s#^(\s*)(subject\s*=\s*.+)#\#\1\2\n\1subject = \"Abwesenheitsnachricht\"#" \ + /var/www/webmail.warenform.de/htdocs/plugins/vacation/config.ini + +cp /var/www/webmail.warenform.de/htdocs/plugins/vacation/default.txt /var/www/webmail.warenform.de/htdocs/plugins/vacation/default.txt.ORIG +cat</var/www/webmail.warenform.de/htdocs/plugins/vacation/default.txt +Hallo, + +ich bin vom bis nicht im Büro. In dringenden Fällen melden Sie sich bitte bei . + +MfG + +EOF + + +## - RECOMMEND: if you don't want to display the forward fieldset, then +## - comment out the concerning code in vacation.php and replace with a +## - hidden field to realise, that always a copy is send to the concerning +## - email address +## - +## - comment out line 160 to 188 (incl.): +## - +## - $out .= '
' . $this->gettext('forward') . ''; +## - +## - // Keep a local copy of the mail +## - $field_id = 'vacation_keepcopy'; +## - $input_localcopy = new html_checkbox(array('name' => '_vacation_keepcopy', 'id' => $field_id, 'value' => 1)); +## - $out .= sprintf("

 %s

\n", +## - $field_id, +## - rep_specialchars_output($this->gettext('keepcopy')), +## - $input_localcopy->show($settings['keepcopy'])); +## - +## - +## - +## - // Information on the forward in a seperate fieldset. +## - if (! isset($this->inicfg['disable_forward']) || ( isset($this->inicfg['disable_forward']) && $this->inicfg['disable_forward']==false)) +## - { +## - $out .= '

' . $this->gettext('separate_forward') . '

'; +## - +## - // Forward mail to another account +## - $field_id = 'vacation_forward'; +## - $input_autoresponderforward = new html_inputfield(array('name' => '_vacation_forward', 'id' => $field_id, 'size' => 90)); +## - $out .= sprintf("

 %s

\n", +## - $field_id, +## - rep_specialchars_output($this->gettext('forwardingaddresses')), +## - $input_autoresponderforward->show($settings['forward'])); +## - +## - +## - } +## - $out .= "
\n"; +## - +## - replace with: +## - +## - // ckubu 20111202 +## - // dont't show forward fieldset +## - $field_id = 'vacation_keepcopy'; +## - $out .= sprintf("", $field_id); +## - + + +## - that vacation plugin doesn't work with postgres database out of the box. some changes +## - on lib/virtual.class.php is needed +## - +cat < /tmp/vacation-1.9.9-virtual.class.diff +50a51,52 +> /* CHANGED ckubu: that doesn't work with postgres database backend +> +52a55,58 +> */ +> $sql = sprintf("SELECT subject,body,active FROM vacation WHERE email='%s'", +> Q($this->user->data['username'])); +> +65a72,74 +> +> /* CHANGED ckubu: that doesn't work with postgres database backend +> +66a76,77 +> */ +> $vacArr['enabled'] = ($row['active'] == 't') && ($fwdArr['enabled'] == 1); +85a97,98 +> /* CHANGED ckubu: that doesn't work with postgres database backend +> +86a100,101 +> */ +> $sql = sprintf("UPDATE vacation SET created=now(),active=false WHERE email='%s'", Q($this->user->data['username'])); +112a128,130 +> +> /* CHANGED ckubu: that doesn't work with postgres database backend +> +113a132,133 +> */ +> $sql = "INSERT INTO vacation (email,subject,body,domain,created,active) VALUES (?,?,?,?,NOW(),true)"; +114a135,137 +> +> /* CHANGED ckubu: that doesn't work with postgres database backend +> +115a139,140 +> */ +> $sql = "UPDATE vacation SET email=?,subject=?,body=?,domain=?,active=true WHERE email=?"; +280c305 +< ?> +\ Kein Zeilenumbruch am Dateiende. +--- +> ?> +EOF + +cp $WEBMAIL_BASEDIR/htdocs/plugins/vacation/lib/virtual.class.php \ + $WEBMAIL_BASEDIR/htdocs/plugins/vacation/lib/virtual.class.php.ORIG + +patch -p0 $WEBMAIL_BASEDIR/htdocs/plugins/vacation/lib/virtual.class.php \ + /tmp/vacation-1.9.9-virtual.class.diff + + + +## - the output of the vacation plugin is blso roken. for now, we will correct that +## - in a very very simple way, only for usability.. +## - +cp -a $WEBMAIL_BASEDIR/htdocs/plugins/vacation/skins/default \ + $WEBMAIL_BASEDIR/htdocs/plugins/vacation/skins/default.ORIG + +cat < $WEBMAIL_BASEDIR/htdocs/plugins/vacation/skins/default/vacation.css +#vacationpage +{ + width: 800px; + margin-left: 15px; + margin-top: 95px; + border: 1px solid #999999; +} + +#pagecontent { + position: absolute; + top: 85px; + left: 20px; + bottom: 20px; + width: 800px; + +} + +#pagecontent label { + float:left; + /*width:20%;*/ + + margin-right:0.5em; + padding-top:0.2em; + text-align:left; + vertical-align: top; + color:#666666; +font-size:11px; +font-weight:bold; +} +EOF + +## ------------------------------------------------- # +## --- ENDE: Install vacation plugin for roundcube - # +## --- vacation-1.9.9 - # +## ------------------------------------------------- # + +## ------------------------------------------------------------------- ## + + + diff --git a/DOC/roundcube.reset_admin.txt b/DOC/roundcube.reset_admin.txt new file mode 100644 index 0000000..f36039e --- /dev/null +++ b/DOC/roundcube.reset_admin.txt @@ -0,0 +1,12 @@ +## - To reset Plugin Manager ‘superadmin’ account do the following +## - + +- Logout from Roundcube and close your browser to make sure all sessions are ended. + +- Delete the [md5-hash].myrc file in the root of the Roundcube installation folder. + +- DROP table ‘plugin_manager’ from roundcube SQL database. + +- Remove entry ‘myrc_plugin_manager’ from ‘system’ table. + +- Login to Roundcube. diff --git a/DOC/roundcube_plugin.install b/DOC/roundcube_plugin.install new file mode 100644 index 0000000..5fbaf81 --- /dev/null +++ b/DOC/roundcube_plugin.install @@ -0,0 +1,805 @@ + +## ---------------------- +## - webmail.warenform.de +## - + +. roundcube.env.webmail.warenform.de + +## - +## - END: webmail.warenform.de +## ---------------------------- + +## ---------------------- +## - webmail2.warenform.de +## - + +. roundcube.env.webmail2.warenform.de + +## - +## - END: webmail.warenform.de +## ---------------------------- + +## ---------------------- +## - webmail.so36.net +## - + +. roundcube.env.webmail.so36.net + +## - +## - END: webmail.so36.net +## ---------------------------- + +## ---------------------- +## - webmail.interventionistische-linke.org +## - + +. roundcube.env.webmail.interventionistische-linke.org + +## - +## - END: webmail.interventionistische-linke.org +## ---------------------------- + +## ---------------------- +## - webmail.initiativenserver.de +## - + +. roundcube.env.webmail.initiativenserver.de + +## - +## - END: webmail.interventionistische-linke.org +## ---------------------------- + +## ---------------------- +## - webmail2.initiativenserver.de +## - + +. roundcube.env.webmail2.initiativenserver.de + +## - +## - END: webmail.interventionistische-linke.org +## ---------------------------- + +## ---------------------- +## - webmail2.oopen.de +## - + +. roundcube.env.webmail2.oopen.de + +## - +## - END: webmail.oopen.de +## ---------------------------- + +## ---------------------- +## - webmail.oopen.de +## - + +. roundcube.env.webmail.oopen.de + +## - +## - END: webmail.oopen.de +## ---------------------------- + + + + + +## ----------------------------------------------- # +## --- integrate jqueryui plugin for roundcube --- # +## ----------------------------------------------- # + +## - jqueryui plugin comes with roundcube core distribution. So you have +## - only to register it. + +## - register jqueryui plugin with roundcube +## - +## - edit $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/config/config.inc.php +## - +## - add "login_lang" to array plugins +## - $config['plugins'] = array('jqueryui'); +## - +vim $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/config/config.inc.php + + + +## ----------------------------------------------- # +## --- integrate password plugin for roundcube --- # +## ----------------------------------------------- # + +cp $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins/password/config.inc.php.dist \ + $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins/password/config.inc.php + +## - edit $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins/password/config.inc.php +## - +## - adjust: +## - +## - $config['password_driver'] = 'sql'; +## - $config['password_confirm_current'] = true; +## - +## - $config['password_minimum_length'] = 8; +## - $config['password_require_nonalpha'] = true; +## - +## - NOTE: The database configuration data from POSTFIX Dateabase are needed !! +## - Put in your database credentials +## - +## - $config['password_db_dsn'] = '${_db_type}://${_db_user}:${_db_pass}@localhost/${_db_name}'; +## - +## - $config['password_query'] = 'UPDATE mailbox SET password=%p WHERE username=%u'; +## - +vim $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins/password/config.inc.php + +## - register password plugin with roundcube +## - +## - edit $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/config/config.inc.php +## - +## - add "password" to array plugins +## - $config['plugins'] = array('jqueryui', 'password'); +## - +vim $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/config/config.inc.php + + + +## --------------------------------------------------- # +## --- Install vacation plugin bhusigen rc-vacation -- # +## --------------------------------------------------- # + +## - see: https://github.com/bhuisgen/rc-vacation/ + +## - requirements, if using datepicker: +## - - plugin jqueryui + +## - Download from site https://github.com/bhuisgen/rc-vacation/ and +## - store archive in $WEBMAIL_BASEDIR +## - +cd $WEBMAIL_BASEDIR +rm rc-vacation-master.zip +wget -O rc-vacation-master.zip https://github.com/bhuisgen/rc-vacation/archive/master.zip + +cd $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins +unzip $WEBMAIL_BASEDIR/rc-vacation-master.zip +ln -s rc-vacation-master $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins/vacation + +cp $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins/vacation/config.inc.php.dist \ + $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins/vacation/config.inc.php + +if [ "$_db_type" = "pgsql" ];then + + ## -------------------------------------------------------------- ## + ## - !! That (very long) part concerns to PostgeSQL Database !! - ## + ## -------------------------------------------------------------- ## + + ## - Note: In the following sql statements set the correct AUTOREPLY domain !! + ## - Also chnage the database parameters as yor needs + ## - + ## - edit configuration $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins/vacation/config.inc.php + ## - + ## - $rcmail_config['vacation_gui_vacationdate'] = TRUE; + ## - $rcmail_config['vacation_subject_default'] = 'Re: $SUBJECT'; + ## - + ## - $rcmail_config['vacation_gui_vacationforwarder'] = FALSE; + ## - + ## - $rcmail_config['vacation_dateformat'] = 'Y-m-d' ; + ## - $rcmail_config['vacation_jquery_calendar'] = TRUE; + ## - $rcmail_config['vacation_jquery_dateformat'] = 'yy-m-d'; + ## - + ## - $rcmail_config['vacation_forwarder_multiple'] = FALSE; + ## - $rcmail_config['vacation_forwarder_separator'] = ','; + ## - + ## - $rcmail_config['vacation_driver'] = 'sql'; + ## - + ## - #configure your database connection to POSTFIX database + ## - $rcmail_config['vacation_sql_dsn'] = '${_db_type}://${_db_user}:${_db_pass}@localhost/${_db_name}'; + ## - + ## - + ## - # !! NOTE: You have to create postgres function udf_forwarders_out and + ## - # udf_forwarders_in to get the following SQL statements working + ## - # + ## - + ## - // read data queries + ## - $rcmail_config['vacation_sql_read'] = + ## - array( + ## - "SELECT + ## - subject AS vacation_subject, + ## - body AS vacation_message, + ## - date(activefrom) AS vacation_start, + ## - date(activeuntil) AS vacation_end, + ## - CASE WHEN vacation.active = TRUE THEN true ELSE false END AS vacation_enable, + ## - udf_forwarders_out(%username,'$_autoreply_domain',',') AS vacation_forwarder + ## - FROM vacation,alias + ## - WHERE email=%username AND address=%username AND vacation.domain=%email_domain;" + ## - ); + ## - + ## - + ## - // write data queries + ## - /* !! Wichtig: + ## - Nur wenn rcmail_config['vacation_gui_vacationforwarder'] = TRUE + ## - + ## - NOTE: interval_time wird statisch gesetzt auf 86400 (1 Tag) + ## - */ + ## - $rcmail_config['vacation_sql_write'] = + ## - array("DELETE FROM vacation WHERE email=%email AND domain=%email_domain;", + ## - "DELETE from vacation_notification WHERE on_vacation=%email;", + ## - "INSERT INTO vacation (email,domain,subject,body,activefrom,activeuntil,interval_time,created,active) " . + ## - "VALUES (%email,%email_domain,%vacation_subject,%vacation_message," . + ## - "to_timestamp(%vacation_start - extract(timezone from current_timestamp))," . + ## - "to_timestamp(%vacation_end + 86399 - extract(timezone from current_timestamp))," . + ## - "86400,NOW(),udf_set_active(%vacation_enable));", + ## - "UPDATE alias SET goto = udf_forwarders_in(udf_forwarders_out(%email,'$_autoreply_domain',',')," . + ## - "%email,'$_autoreply_domain',',',udf_set_active(%vacation_enable))" . + ## - ", modified = NOW() " . + ## - " WHERE address = %email" + ## - + ## - ); + ## - + ## - /* !! Wichtig: + ## - Nur wenn rcmail_config['vacation_gui_vacationforwarder'] = TRUE + ## - + ## - NOTE: interval_time wird statisch gesetzt auf 86400 (1 Tag) + ## - */ + ## - /* + ## - $rcmail_config['vacation_sql_write'] = + ## - array("DELETE FROM vacation WHERE email=%email AND domain=%email_domain;", + ## - "DELETE from vacation_notification WHERE on_vacation=%email;", + ## - "INSERT INTO vacation (email,domain,subject,body,activefrom,activeuntil,interval_time,created,active) " . + ## - "VALUES (%email,%email_domain,%vacation_subject,%vacation_message," . + ## - "to_timestamp(%vacation_start - extract(timezone from current_timestamp))," . + ## - "to_timestamp(%vacation_end + 86399 - extract(timezone from current_timestamp))," . + ## - "86400,NOW(),udf_set_active(%vacation_enable));", + ## - "UPDATE alias SET goto = udf_forwarders_in(%vacation_forwarder," . + ## - "%email,'$_autoreply_domain',',',udf_set_active(%vacation_enable))" . + ## - ", modified = NOW() " . + ## - " WHERE address = %email" + ## - ); + ## - + ## - !! Notice !! + ## - Replace '$_autoreply_domain' string with the true vaction domain. + ## - + ## - i.e for oopen.de: :1,$s/\$_autoreply_domain/autoreply.oopen.de/gc + ## - + vim $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins/vacation/config.inc.php + + + ## - create postfix trigger function udf_forwarders_out: + ## - + cat < /tmp/postgres.forwarders_out.sql +CREATE LANGUAGE plpgsql; + +CREATE FUNCTION udf_forwarders_out(email_str text, vacation_domain text, list_seperator character) RETURNS text + LANGUAGE plpgsql + AS \$\$ + DECLARE + forward_str text; + local_email_part TEXT; + domain_email_part TEXT; + BEGIN + + -- get list of forwarders + -- + SELECT goto INTO forward_str FROM alias WHERE address=email_str; + + -- entferne mailbox emailadresse + -- + forward_str = replace(forward_str, email_str, '' ); + + -- entferne vacation adresse + -- + local_email_part = substring(email_str, 1, position('@' in email_str) - 1); + domain_email_part = substring(email_str, position('@' in email_str) + 1 ); + forward_str = replace(forward_str, local_email_part || '#' || domain_email_part || '@' || vacation_domain, ''); + + -- enferne doppelte seperatorzeichen + -- + WHILE position( list_seperator || list_seperator in forward_str ) > 0 LOOP + forward_str = replace(forward_str, list_seperator || list_seperator , ''); + END LOOP; + + -- entferne erstes zeichen wenn es das seperatorzeichen ist + -- + IF substring(forward_str,1,1) = list_seperator THEN + forward_str = substring(forward_str from 2); + END IF; + + + -- entferne letztes zeichen wenn es das seperatorzeichen ist + -- + IF substring(forward_str from char_length(forward_str)) = list_seperator THEN + forward_str = substring(forward_str, 1, char_length(forward_str) - 1); + END IF; + + + -- forward_str = substring(forward_str from char_length(forward_str)); + + RETURN forward_str; + END; + \$\$; +EOF + + ## - create function + ## - + ## - Note 1. + ## - if datbase language plpgsql already exists, an error occurs. but you can + ## - savely ignore that error + ## - + ## - Note 2. + ## - if you create the function not as postfix database user, you have to + ## - give the permission afterwards: + ## - ALTER FUNCTION public.udf_forwarders_out(email_str text, vacation_domain text, list_seperator character) OWNER TO postfix; + ## - But we will use the db postfix user (here also named postfix) + ## - + psql -Upostfix postfix < /tmp/postgres.forwarders_out.sql + + rm /tmp/postgres.forwarders_out.sql + + + ## - create sql file for installing function udf_set_active: + ## - + cat < /tmp/postgres.set_active.sql +CREATE LANGUAGE plpgsql; + +CREATE FUNCTION udf_set_active(vacation_enable text) RETURNS boolean + LANGUAGE plpgsql + AS \$\$ + DECLARE + return_val boolean; + BEGIN + + return_val = 't'; + + IF vacation_enable = '' THEN + return_val = 'f'; + END IF; + + IF vacation_enable = '0' THEN + return_val = 'f'; + END IF; + + IF lower(vacation_enable) = 'false' THEN + return_val = 'f'; + END IF; + + RETURN return_val; + END; + \$\$; +EOF + + ## - create function udf_set_active + ## - + ## - Note 1. + ## - if datbase language plpgsql already exists, an error occurs. but you can + ## - savely ignore that error + ## - + ## - Note 2. + ## - if you create the function not as postfix database user, you have to + ## - give the permission afterwards: + ## - ALTER FUNCTION public.udf_forwarders_in(forewarders_str text, email_str text, vacation_domain text, list_seperator character, vacation_enable boolean) OWNER TO postfix; + ## - But we will use the db postfix user (here also named postfix) + ## - + psql -Upostfix postfix < /tmp/postgres.set_active.sql + + rm /tmp/postgres.set_active.sql + + + ## - create postfix database function udf_forwarders_in: + ## - + cat < /tmp/postgres.forwarders_in.sql +CREATE LANGUAGE plpgsql; + +CREATE FUNCTION udf_forwarders_in(forewarders_str text, email_str text, vacation_domain text, list_seperator character, vacation_enable boolean) RETURNS text + LANGUAGE plpgsql + AS \$\$ + DECLARE + return_str text; + local_email_part TEXT; + domain_email_part TEXT; + BEGIN + + return_str = email_str; + + IF vacation_enable THEN + local_email_part = substring(email_str, 1, position('@' in email_str) - 1); + domain_email_part = substring(email_str, position('@' in email_str) + 1 ); + return_str = return_str || list_seperator || local_email_part || '#' || domain_email_part || '@' || vacation_domain; + END IF; + + IF char_length(forewarders_str) > 7 THEN + return_str = return_str || list_seperator || forewarders_str; + END IF; + + RETURN return_str; + END; + \$\$; +EOF + + ## - create function udf_forwarders_in + ## - + ## - Note 1. + ## - if datbase language plpgsql already exists, an error occurs. but you can + ## - savely ignore that error + ## - + ## - Note 2. + ## - if you create the function not as postfix database user, you have to + ## - give the permission afterwards: + ## - ALTER FUNCTION public.udf_forwarders_in(forewarders_str text, email_str text, vacation_domain text, list_seperator character, vacation_enable boolean) OWNER TO postfix; + ## - But we will use the db postfix user (here also named postfix) + ## - + psql -Upostfix postfix < /tmp/postgres.forwarders_in.sql + + rm /tmp/postgres.forwarders_in.sql + +elif [ "$_db_type" = "mysql" ];then + + ## ---------------------------------------------------------- ## + ## - !! That (very long) part concerns to MySQL Database !! - ## + ## ---------------------------------------------------------- ## + + ## - Note: In the following sql statements set the correct AUTOREPLY domain !! + ## - Also chnage the database parameters as yor needs + ## - + ## - edit configuration $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins/vacation/config.inc.php + ## - + ## - $rcmail_config['vacation_gui_vacationforwarder'] = FALSE; + ## - $rcmail_config['vacation_forwarder_multiple'] = FALSE; + ## - $rcmail_config['vacation_forwarder_separator'] = ','; + ## - + ## - $rcmail_config['vacation_driver'] = 'sql'; + ## - + ## - #configure your database connection to POSTFIX database + ## - $rcmail_config['vacation_sql_dsn'] = '${_db_type}://${_db_user}:${_db_pass}@localhost/${_db_name}'; + ## - + ## - # !! NOTE: You have to create myql functions FORWARDERS_OUT and + ## - # FORWARDERS_IN to get the following SQL read statement working + ## - # + ## - + ## - // read data queries + ## - /* - OLD: vcation.pl included in posfixadmin until version 2.3.7 + ## - $rcmail_config['vacation_sql_read'] = + ## - array("SELECT subject AS vacation_subject, body AS vacation_message, " . + ## - "vacation.active AS vacation_enable, FORWARDERS_OUT(%username,'$_autoreply_domain',',') AS vacation_forwarder FROM vacation,alias " . + ## - "WHERE email=%username AND address=%username AND vacation.domain=%email_domain;" + ## - ); + ## - *) + ## - /* - NEW: vcation.pl included in posfixadmin since version 2.91 */ + ## - $rcmail_config['vacation_sql_read'] = + ## - array("SELECT subject AS vacation_subject, body AS vacation_message," . + ## - "UNIX_TIMESTAMP(activefrom) AS vacation_start," . + ## - "UNIX_TIMESTAMP(activeuntil) AS vacation_end," . + ## - "vacation.active AS vacation_enable," . + ## - "FORWARDERS_OUT(%username,'$_autoreply_domain',',') AS vacation_forwarder " . + ## - "FROM vacation,alias " . + ## - "WHERE email=%username AND address=%username AND vacation.domain=%email_domain;" + ## - ); + ## - + ## - + ## - // write data queries + ## - /* !! Wichtig: + ## - Nur wenn rcmail_config['vacation_gui_vacationforwarder'] = FALSE + ## - */ + ## - + ## - /* - OLD: vcation.pl included in posfixadmin until version 2.3.7 + ## - $rcmail_config['vacation_gui_vacationforwarder'] = FALSE; + ## - $rcmail_config['vacation_sql_write'] = + ## - array("DELETE FROM vacation WHERE email=%email AND " . + ## - "domain=%email_domain;", + ## - "DELETE from vacation_notification WHERE on_vacation=%email;", + ## - "INSERT INTO vacation (email,domain,subject,body,created," . + ## - "active) VALUES (%email,%email_domain,%vacation_subject," . + ## - "%vacation_message,NOW(),%vacation_enable);", + ## - "UPDATE alias SET goto = FORWARDERS_IN(FORWARDERS_OUT(%email,'$_autoreply_domain',',')," . + ## - "%email,'$_autoreply_domain',',',%vacation_enable)" . + ## - ", modified = NOW() " . + ## - " WHERE address = %email" + ## - ); + ## - /* + ## - + ## - /* - NEW: vcation.pl included in posfixadmin since version 2.91 */ + ## - /* + ## - $rcmail_config['vacation_gui_vacationforwarder'] = FALSE; + ## - $rcmail_config['vacation_sql_write'] = + ## - array("DELETE FROM vacation WHERE email=%email AND domain=%email_domain;", + ## - "DELETE from vacation_notification WHERE on_vacation=%email;", + ## - "INSERT INTO vacation (email,domain,subject,body,activefrom,activeuntil,interval_time,created,active) " . + ## - "VALUES (%email,%email_domain,%vacation_subject,%vacation_message," . + ## - "CONCAT(DATE(FROM_UNIXTIME(%vacation_start)), ' 00:00:00')," . + ## - "CONCAT(DATE(FROM_UNIXTIME(%vacation_end)), ' 23:59:59')," . + ## - "86400,NOW(),%vacation_enable);", + ## - "UPDATE alias SET goto = FORWARDERS_IN(FORWARDERS_OUT(%email,'$_autoreply_domain',',')," . + ## - "%email,'$_autoreply_domain',',',%vacation_enable)" . + ## - ", modified = NOW() " . + ## - " WHERE address = %email" + ## - ); + ## - */ + ## - + ## - /* !! Wichtig: + ## - Nur wenn rcmail_config['vacation_gui_vacationforwarder'] = TRUE + ## - */ + ## - + ## - /* + ## - + ## - /* - OLD: vcation.pl included in posfixadmin until version 2.3.7 + ## - $rcmail_config['vacation_gui_vacationforwarder'] = TRUE; + ## - $rcmail_config['vacation_sql_write'] = + ## - array("DELETE FROM vacation WHERE email=%email AND " . + ## - "domain=%email_domain;", + ## - "DELETE from vacation_notification WHERE on_vacation=%email;", + ## - "INSERT INTO vacation (email,domain,subject,body,created," . + ## - "active) VALUES (%email,%email_domain,%vacation_subject," . + ## - "%vacation_message,NOW(),%vacation_enable);", + ## - "UPDATE alias SET goto = FORWARDERS_IN(%vacation_forwarder," . + ## - "%email,'$_autoreply_domain',',',%vacation_enable)" . + ## - ", modified = NOW() " . + ## - " WHERE address = %email" + ## - ); + ## - */ + ## - + ## - /* - NEW: vcation.pl included in posfixadmin since version 2.91 */ + ## - $rcmail_config['vacation_gui_vacationforwarder'] = TRUE; + ## - $rcmail_config['vacation_sql_write'] = + ## - array("DELETE FROM vacation WHERE email=%email AND domain=%email_domain;", + ## - "DELETE from vacation_notification WHERE on_vacation=%email;", + ## - "INSERT INTO vacation (email,domain,subject,body,activefrom,activeuntil,interval_time,created,active) " . + ## - "VALUES (%email,%email_domain,%vacation_subject,%vacation_message," . + ## - "CONCAT(DATE(FROM_UNIXTIME(%vacation_start)), ' 00:00:00')," . + ## - "CONCAT(DATE(FROM_UNIXTIME(%vacation_end)), ' 23:59:59')," . + ## - "86400,NOW(),%vacation_enable);", + ## - "UPDATE alias SET goto = FORWARDERS_IN(%vacation_forwarder," . + ## - "%email,'$_autoreply_domain',',',%vacation_enable)" . + ## - ", modified = NOW() " . + ## - " WHERE address = %email" + ## - ); + ## - + ## - + vim $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins/vacation/config.inc.php + + + ## - create function FORWARDERS_OUT: + ## - + cat < /tmp/FORWARDERS_OUT.sql +DROP FUNCTION IF EXISTS FORWARDERS_OUT ; + +DELIMITER | + +CREATE FUNCTION FORWARDERS_OUT (email_str TEXT, vacation_domain TEXT , list_seperator CHAR) + RETURNS TEXT + DETERMINISTIC + BEGIN + DECLARE forward_str TEXT; + DECLARE local_email_part TEXT; + DECLARE domain_email_part TEXT; + DECLARE first_char CHAR; + DECLARE last_char CHAR; + + -- get list of forwarders + -- + SELECT goto INTO forward_str FROM alias WHERE address=email_str; + + -- entferne mailbox emailadresse + -- + SET forward_str = REPLACE(forward_str, email_str, '' ); + -- SELECT REPLACE(forward_str, email_str, '' ) INTO forward_str; + + -- entferne vacation adresse + -- + SET local_email_part = SUBSTRING(email_str,1, LOCATE('@',email_str) - 1); + SET domain_email_part = SUBSTRING(email_str, LOCATE('@',email_str) + 1, LENGTH(email_str)); + SET forward_str = REPLACE(forward_str, CONCAT(local_email_part, "#" ,domain_email_part,"@", vacation_domain), ''); + -- SELECT REPLACE(forward_str, CONCAT(list_seperator,list_seperator), list_seperator) INTO forward_str; + + -- enferne doppelte seperatorzeichen + -- + WHILE LOCATE(CONCAT(list_seperator,list_seperator) , forward_str) DO + SET forward_str = REPLACE(forward_str, CONCAT(list_seperator,list_seperator), list_seperator); + -- SELECT REPLACE(forward_str, CONCAT(list_seperator,list_seperator), list_seperator) INTO forward_str; + END WHILE ; + + -- entferne erstes zeichen wenn es das seperatorzeichen ist + -- + IF LEFT(forward_str,1) = list_seperator THEN + SET forward_str = SUBSTRING(forward_str FROM 2); + -- SELECT SUBSTRING(forward_str FROM 2) INTO forward_str; + END IF; + + -- entferne letztes zeichen wenn es das seperatorzeichen ist + -- + IF RIGHT(forward_str,1) = list_seperator THEN + SET forward_str = SUBSTRING(forward_str , 1, LENGTH(forward_str) - 1); + -- SELECT SUBSTRING(forward_str , 1, LENGTH(forward_str) - 1) INTO forward_str; + END IF; + + RETURN forward_str; + END | + +DELIMITER ; +EOF + + ## - create function + ## - + ## - Note 1. + ## - Create function as postfix database user + ## - + ## - The postfix databaseuser wil need 'Super_priv'. At MySQL monitor + ## - (as mysql admin user i.e. root) type: + ## - UPDATE user SET Super_priv = 'Y' WHERE User = 'postfix'; + ## - + ## - Note 2. + ## - You can verify on mysql monitor (database postfix) with: + ## - SHOW FUNCTION STATUS; + ## - or see the code: + ## - SHOW CREATE FUNCTION FORWARDERS_OUT; + ## - + mysql -upostfix -p postfix < /tmp/FORWARDERS_OUT.sql + + rm /tmp/FORWARDERS_OUT.sql + + + ## - create database function FORWARDERS_IN: + ## - + cat < /tmp/FORWARDERS_IN.sql +DROP FUNCTION IF EXISTS FOWARDERS_IN ; + +DELIMITER | + +CREATE FUNCTION FORWARDERS_IN (forewarders_str TEXT, + email_str TEXT, + vacation_domain TEXT , + list_seperator CHAR , + vacation_enable BOOLEAN) + RETURNS TEXT + DETERMINISTIC + BEGIN + DECLARE return_str TEXT; + DECLARE local_email_part TEXT; + DECLARE domain_email_part TEXT; + + + SET return_str = email_str; + + IF vacation_enable THEN + SET local_email_part = SUBSTRING(email_str,1, LOCATE('@',email_str) - 1); + SET domain_email_part = SUBSTRING(email_str, LOCATE('@',email_str) + 1, LENGTH(email_str)); + SET return_str = CONCAT(return_str, list_seperator, local_email_part, "#" ,domain_email_part,"@", vacation_domain); + END IF; + + IF LENGTH(forewarders_str) > 2 THEN + SET return_str = CONCAT(return_str, list_seperator, forewarders_str); + END IF; + + RETURN return_str; + END | + +DELIMITER ; +EOF + + + ## - create function FOWARDERS_IN + ## - + ## - Note 1. + ## - Create function as postfix database user + ## - + ## - The postfix databaseuser wil need 'Super_priv'. At MySQL monitor + ## - (as mysql admin user i.e. root) type: + ## - UPDATE user SET Super_priv = 'Y' WHERE User = 'postfix'; + ## - + ## - Note 2. + ## - You can verify on mysql monitor (database postfix) with: + ## - SHOW FUNCTION STATUS; + ## - or see the code: + ## - SHOW CREATE FUNCTION FOWARDERS_IN; + ## - + + mysql -upostfix -p postfix < /tmp/FORWARDERS_IN.sql + + rm /tmp/FORWARDERS_IN.sql + +else + echo -e "\n\t[ ERROR ]: Unknown database type \"$_db_type\"" +fo + + +## - register vacation plugin with roundcube +## - +## - edit $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/config/config.inc.php +## - +## - add "rc-vacation" to array plugins +## - $rcmail_config['plugins'] = array('jquery', 'password', 'vacation'); +## - +vim $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/config/config.inc.php + + + +## -------------------------------------------------------- # +## --- Install plugin language selector on login screen --- # +## -------------------------------------------------------- # + +## - see: https://github.com/hassansin/roundcube-login-language/ + +## - Download from site https://github.com/hassansin/roundcube-login-language/ and +## - store archive in $WEBMAIL_BASEDIR +## - +cd $WEBMAIL_BASEDIR +rm login-language-master.zip +wget -O login-language-master.zip https://github.com/hassansin/roundcube-login-language/archive/master.zip + +cd $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins +unzip $WEBMAIL_BASEDIR/login-language-master.zip +ln -s roundcube-login-language-master/ $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins/login_lang + +cp $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins/login_lang/config.inc.php.dist \ + $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins/login_lang/config.inc.php + + +## - edit config.php and set default language selection +## - +## - $config['language_dropdown_selected'] = 'de_DE'; +## - +vim $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins/login_lang/config.inc.php + + +## - register language selector plugin with roundcube +## - +## - edit $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/config/config.inc.php +## - +## - add "login_lang" to array plugins +## - $config['plugins'] = array('login_lang', 'jqueryui', 'password', 'vacation'); +## - +vim $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/config/config.inc.php + + + +## -------------------------------------------------- # +## --- integrate ContextMenu plugin for roundcube --- # +## -------------------------------------------------- # + +## - see: https://github.com/JohnDoh/Roundcube-Plugin-Context-Menu + +## - Download from site https://github.com/bhuisgen/rc-vacation/ and +## - store archive in $WEBMAIL_BASEDIR +## - +cd $WEBMAIL_BASEDIR +rm Roundcube-Plugin-Context-Menu-master.zip +wget -O Roundcube-Plugin-Context-Menu-master.zip https://github.com/JohnDoh/Roundcube-Plugin-Context-Menu/archive/master.zip + +cd $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins +unzip $WEBMAIL_BASEDIR/Roundcube-Plugin-Context-Menu-master.zip +ln -s Roundcube-Plugin-Context-Menu-master $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins/contextmenu + + +## - register ContextMenu plugin with roundcube +## - +## - edit $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/config/config.inc.php +## - +## - add "login_lang" to array plugins +## - $config['plugins'] = array('login_lang', 'jqueryui', 'password', 'vacation', 'contextmenu'); +## - +vim $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/config/config.inc.php + + + + +## ---------------------------------- # +## --- Install plugin markasjunk2 --- # +## ---------------------------------- # + +cd $WEBMAIL_BASEDIR +rm Roundcube-Plugin-Mark-as-Junk-2-master.zip +wget -O Roundcube-Plugin-Mark-as-Junk-2-master.zip https://github.com/JohnDoh/Roundcube-Plugin-Mark-as-Junk-2/archive/master.zip + +cd $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins +unzip $WEBMAIL_BASEDIR/Roundcube-Plugin-Mark-as-Junk-2-master.zip +ln -s Roundcube-Plugin-Mark-as-Junk-2-master $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins/markasjunk2 + +cp $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins/markasjunk2/config.inc.php.dist \ + $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/plugins/markasjunk2/config.inc.php + + +## - register markasjunk2 plugin with roundcube +## - +## - edit $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/config/config.inc.php +## - +## - add "login_lang" to array plugins +## - $config['plugins'] = array('login_lang', 'jqueryui', 'password', 'vacation', 'contextmenu','markasjunk2'); +## - +vim $WEBMAIL_BASEDIR/roundcubemail-${ROUNDCUBE_VERSION}/config/config.inc.php + + + + +