From 7e462b08e02547baf090b6117c5ee6c9e921b2c6 Mon Sep 17 00:00:00 2001 From: Matthew Saunders Brown Date: Mon, 29 Aug 2022 15:37:49 -0700 Subject: [PATCH] update for roundcube 1.6.0 --- config/config.inc.php | 2 +- install.sh | 31 ++++++++++++++++++------------- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/config/config.inc.php b/config/config.inc.php index a307ec5..c6b207e 100644 --- a/config/config.inc.php +++ b/config/config.inc.php @@ -29,7 +29,7 @@ $config['log_driver'] = 'syslog'; // %d - domain (http hostname $_SERVER['HTTP_HOST'] without the first part) // %s - domain name after the '@' from e-mail address provided at login screen // For example %n = mail.domain.tld, %t = domain.tld -$config['default_host'] = 'tls://%n'; +$config['imap_host'] = 'tls://%n'; $config['imap_auth_type'] = 'PLAIN'; $config['smtp_auth_type'] = 'PLAIN'; diff --git a/install.sh b/install.sh index f89efe0..6498c2d 100644 --- a/install.sh +++ b/install.sh @@ -28,14 +28,14 @@ fi installer_dir=$(dirname $(readlink -f $0)) cd /usr/local/src/ -wget https://github.com/roundcube/roundcubemail/releases/download/1.4.12/roundcubemail-1.4.12-complete.tar.gz -tar zxf roundcubemail-1.4.12-complete.tar.gz -mv roundcubemail-1.4.12 /srv/www/html/roundcube +wget https://github.com/roundcube/roundcubemail/releases/download/1.6.0/roundcubemail-1.6.0-complete.tar.gz +tar zxf roundcubemail-1.6.0-complete.tar.gz +mv roundcubemail-1.6.0 /srv/www/html/roundcube cd /usr/local/src/ -wget https://github.com/johndoh/roundcube-sauserprefs/archive/refs/tags/1.18.4.tar.gz -O roundcube-sauserprefs-1.18.4.tar.gz -tar zxf roundcube-sauserprefs-1.18.4.tar.gz -mv roundcube-sauserprefs-1.18.4 /srv/www/html/roundcube/plugins/sauserprefs +wget https://github.com/johndoh/roundcube-sauserprefs/archive/refs/tags/1.20.tar.gz -O roundcube-sauserprefs-1.20.tar.gz +tar zxf roundcube-sauserprefs-1.20.tar.gz +mv roundcube-sauserprefs-1.20 /srv/www/html/roundcube/plugins/sauserprefs cd $installer_dir @@ -56,26 +56,31 @@ apt-get -qq -y install pwgen des_key=`pwgen -1 24` sed -i "s|.*des_key.*|\$config['des_key'] = '$des_key';|g" /srv/www/html/roundcube/config/config.inc.php -# install plugins / configs +# install plugin configs cp -a plugins/* /srv/www/html/roundcube/plugins/ sed -i "s|.*sauserprefs_db_dsnw.*|\$config['sauserprefs_db_dsnw'] = 'mysql://$dbuser:$dbpass@$dbhost/$dbdatabase';|g" /srv/www/html/roundcube/plugins/sauserprefs/config.inc.php # create tmp files storage dir install --owner=www-data --group=www-data --mode=750 --directory /var/tmp/roundcube +# prefix roundcubemail mysql tables with rc_ +cp /srv/www/html/roundcube/installer/SQL/mysql.initial.sql $installer_dir/rc.sql +tables=(`grep TABLE rc.sql |cut -d \\\` -f 2`) +for table in "${!tables[@]}" +do + table=${tables[$table]} + sed -i "s|\`$table\`|\`rc_$table\`|g" rc.sql +done +# load roundcube database tables +mysql vmail < rc.sql + # set permissions -# # USER=$(stat -c '%U' /srv/www/html) -# # GROUP=$(stat -c '%G' /srv/www/html) -# # chown -R $USER:$GROUP /srv/www/html/roundcube rm -r /srv/www/html/roundcube/installer/ chown -R vhost:vhost /srv/www/html/roundcube find /srv/www/html/roundcube -type d -exec chmod 755 {} + find /srv/www/html/roundcube -type f -exec chmod 644 {} + chmod 755 /srv/www/html/roundcube/bin/*.sh -# load roundcube database tables -mysql vmail < rc.sql - # install & enable rc systemd cron cp sbin/rc-cron.sh /usr/local/sbin/ chmod 755 /usr/local/sbin/rc-cron.sh