Script to add 'vacation' and 'forward' options to roundcubemail

I really like to have the ‘vacation’ option in roundcubemail - so as to set ‘out of office’ messages using a calendar.
So here’s a script to make those changes…
and a few others.

I added this to a new directory in /home/user-data/tools/manageseive_settings.sh assuming it won’t be removed with and upgrade.
then $sudo chmod +x /home/user-data/tools/managesieve_settings.sh
and run with $sudo /home/user-data/tools/managesieve_settings.sh

#!/bin/bash
#
# these are roundcube settings that I like to have
# - out of office / vacation filters (with the calendar stuff)
# - forwarding
# - always html
# - contacts from nextcloud by default
if [ -f '/usr/local/lib/roundcubemail/plugins/managesieve/config.inc.php' ]; then
    rm /usr/local/lib/roundcubemail/plugins/managesieve/config.inc.php
fi
cp /usr/local/lib/roundcubemail/plugins/managesieve/config.inc.php.dist /usr/local/lib/roundcubemail/plugins/managesieve/config.inc.php

# set out-of-office / vacation
sed -i '/'managesieve_vacation'/'d /usr/local/lib/roundcubemail/plugins/managesieve/config.inc.php
echo "\$config['managesieve_vacation'] = 1;"  >> /usr/local/lib/roundcubemail/plugins/managesieve/config.inc.php

# set forwarding
sed -i '/'managesieve_forward'/'d /usr/local/lib/roundcubemail/plugins/managesieve/config.inc.php
echo "\$config['managesieve_forward'] = 1;"  >> /usr/local/lib/roundcubemail/plugins/managesieve/config.inc.php

# set vacation interval
sed -i '/'managesieve_vacation_interval'/'d /usr/local/lib/roundcubemail/plugins/managesieve/config.inc.php
echo "\$config['managesieve_vacation_interval'] = '1d';"  >> /usr/local/lib/roundcubemail/plugins/managesieve/config.inc.php

# set vacation address 
sed -i '/'managesieve_vacation_addresses_init'/'d /usr/local/lib/roundcubemail/plugins/managesieve/config.inc.php
echo "\$config['managesieve_vacation_addresses_init'] = 'true';"  >> /usr/local/lib/roundcubemail/plugins/managesieve/config.inc.php

#set vacation from 
sed -i '/'managesieve_vacation_from_init'/'d /usr/local/lib/roundcubemail/plugins/managesieve/config.inc.php
echo "\$config['managesieve_vacation_from_init'] = 'true';"  >> /usr/local/lib/roundcubemail/plugins/managesieve/config.inc.php

exit```

This topic was automatically closed after 61 days. New replies are no longer allowed.