Difference between revisions of "Talk:Zarafa on SME8"

From SME Server
Jump to navigationJump to search
(qmail user template if statement does not handle all situations correctly)
 
(87 intermediate revisions by 2 users not shown)
Line 1: Line 1:
'''New zarafa-7.0.x- and z-push-install/upgradescripts for SME8 <u>for testing</u>.'''<br> These scipts always take the default NEW-config-files from the zarafa.rpms (found in /usr/share/doc/zarafa/example-config/) and make SME-templates of these default config-files !  So, you will always have the newest templated config-files, even after upgrading to a new Zarafa-version with altered config-files !<br>
+
* The first if-statement below from the "Creating SME-QMAIL-user-templates" section from the 'Zarafa Install Script' does not correctly handle the situation where <tt>GlobalForward</tt> is <tt>enabled</tt> but an account has the <tt>zarafa</tt> property set to <tt>disabled</tt> ...
There is even more integration with the SME-perlDB too. (Most of the zarafa-config-keys can be set in the SME-perlDB !).<br>  
+
<syntaxhighlight lang="Bash">
You can find a upgrade-path to Z-push 2.0 (tested with Zarafa 7.0.12 and Z-push 2.0.7).<br>
+
{
For version 1.3 of the Webapp you need minimum zarafa 7.0.12.
+
  my \$zarafa = \$user->prop('zarafa') || 'disabled';
 +
  my \$zarafa2 = \${'zarafa-server'}{GlobalForward} || 'disabled';
  
= INSTALLATION of Zarafa 7.0.x on SME8 =
+
  if (\$zarafa eq 'enabled' || \$zarafa2 eq 'enabled')
== Search latest STABLE php53-mapi.rpm ==
+
  { return "| /usr/bin/zarafa-dagent -q \$USERNAME ; if [ \\$\\? -ne 0 ] ; then exit -1; else exit 99; fi;"
 +
  }
 +
}
 +
</syntaxhighlight>
 +
Maybe this could work:
 +
<syntaxhighlight lang="Bash">
 +
{
 +
  my \$zarafa = \$user->prop('zarafa') || ' ';
 +
  my \$zarafa2 = \${'zarafa-server'}{GlobalForward} || 'disabled';
  
SME8 uses PHP5.3<br>
+
  if ((\$zarafa ne 'disabled' && \$zarafa2 eq 'enabled') || (\$zarafa eq 'enabled' && \$zarafa2 eq 'disabled'))
Unfortunately, PHP 5.1 and PHP 5.3 are ABI incompatible, that means that PHP modules that were compiled for PHP 5.1 (like the php-mapi.rpm compiled in the Zarafa-rpms for RHEL 5) can not be run using PHP 5.3 :<br>
+
  { return "| /usr/bin/zarafa-dagent -q \$USERNAME ; if [ \\$\\? -ne 0 ] ; then exit -1; else exit 99; fi;"
 +
  }
 +
}
 +
</syntaxhighlight>
  
https://community.zarafa.com/pg/blog/read/1837/support-for-php-53-in-rhel-5-via-new-php53mapi-rpm-package
 
  
So, search on the EPEL-repositories the latest STABLE php53-mapi-package.
+
*On 64-bit systems there are a few symbolic links and path not correct after installation
  
https://admin.fedoraproject.org/updates/search/php53-mapi?
+
<syntaxhighlight lang="Bash">
 +
if [ `getconf LONG_BIT` = "64" ]
 +
then
 +
  echo "64-bit, creating symbolic link"
 +
  ln -s /usr/lib64/zarafa /usr/lib/zarafa
 +
fi
 +
</syntaxhighlight>
 +
and
  
== Set the epel-repository :==
+
/usr/lib/libcrypto.so.0.9.8
 +
/usr/lib/libsssl.so.0.9.8
 +
both link to /lib but should be /lib64
  
/sbin/e-smith/db yum_repositories set epel repository \
+
= Installing 7.1.x (works for me. Please test in your environment) =
Name 'Epel - EL5' \
+
This script takes the example-config-files of ZCP to make a SME-template from it (cf 'replace'-actions refering to SME-db)<br>
BaseUrl 'http://download.fedoraproject.org/pub/epel/5/$basearch' \
+
7.1.x needs a few changes in server.cfg and a new search.cfg-template to replace the indexer.cfg-template : [http://doc.zarafa.com/7.1/Administrator_Manual/en-US/html-single/index.html#_700to710]
MirrorList 'http://mirrors.fedoraproject.org/mirrorlist?repo=epel-5&arch=$basearch' \
 
EnableGroups no \
 
GPGCheck yes \
 
GPGKey http://download.fedora.redhat.com/pub/epel/RPM-GPG-KEY-EPEL \
 
Visible no \
 
status disabled
 
  
/sbin/e-smith/db yum_repositories set epel-testing repository \
+
==== INSTALLSCRIPT (7.1.x) ====
Name 'Epel-testing - EL5' \
+
===== nano -w /etc/e-smith/events/actions/zarafa-install =====
BaseUrl 'http://download.fedoraproject.org/pub/epel/testing/5/$basearch' \
 
MirrorList 'http://mirrors.fedoraproject.org/mirrorlist?repo=testing-epel5&arch=$basearch' \
 
EnableGroups no \
 
GPGCheck yes \
 
GPGKey http://download.fedora.redhat.com/pub/epel/RPM-GPG-KEY-EPEL \
 
Visible no \
 
status disabled
 
  
  signal-event yum-modify
+
  <nowiki>
 +
#!/usr/bin/env bash
 +
clear
  
== Download via the Zarafawebsite the package for ZCP corresponding with the php53-mapi.rpm (cf. version above) ==
+
if [ `whoami` != "root" ]; then
 +
echo "This installation must be run as user root."
 +
echo "Become root, and run this script again."
 +
echo
 +
exit 1
 +
fi
  
cd /to an installdirectory, ex. : /root/InstallZarafa
+
##########################################
 +
# Creating some Zarafa-actions
 +
##########################################
  
wget http://download.zarafa.com/community/final/7.0/[version]/zcp-[version]-rhel-5-[cpu-arch]-free.tar.gz
+
#
 
+
#--- zarafa-expand-templates ---
The 'free'-version has the ability to connect with Microsoft Outlook (default 3 users for free, buy zarafa-CAL's if you want more).
+
#
 +
echo
 +
echo "Creating zarafa-expand-templates-action ..."
 +
echo
 +
cat <<HERE1 > /etc/e-smith/events/actions/zarafa-expand-templates
 +
#!/bin/sh
 +
/sbin/e-smith/expand-template /etc/zarafa/gateway.cfg
 +
/sbin/e-smith/expand-template /etc/zarafa/ical.cfg
 +
/sbin/e-smith/expand-template /etc/zarafa/server.cfg
 +
/sbin/e-smith/expand-template /etc/zarafa/unix.cfg
 +
/sbin/e-smith/expand-template /etc/zarafa/monitor.cfg
 +
/sbin/e-smith/expand-template /etc/zarafa/search.cfg
 +
/sbin/e-smith/expand-template /etc/zarafa/spooler.cfg
 +
/sbin/e-smith/expand-template /etc/zarafa/dagent.cfg
 +
/sbin/e-smith/expand-template /etc/zarafa/licensed.cfg
 +
/etc/e-smith/events/actions/qmail-update-user
 +
HERE1
  
== Unpack the corresponding package for ZCP :==
 
  
Go (cd /...) to the installdirectory (if you haven't done this yet) :
+
#
 
+
#--- zarafa-services ---
cd /to the installdirectory
+
#
 
+
echo
And unpack :
+
echo "Creating zarafa-services-action ..."
 
+
echo
tar -zxvf zcp-*
+
cat <<HERE2 > /etc/e-smith/events/actions/zarafa-services
 
+
#!/bin/sh
== Go  (cd ./zcp-...) to the created subdirectory (zcp-...) :==
+
FILE=/etc/rc.d/init.d/zarafa-licensed
 
+
if [ "\$1" == start ]; then
  cd ./zcp- ...
+
  /etc/rc.d/init.d/zarafa-dagent start
 
+
/etc/rc.d/init.d/zarafa-gateway start
  '''Remove the devel packages'''
+
  /etc/rc.d/init.d/zarafa-ical start
  '''Move the windows-directory to an installshare in your network'''
+
  if [ -a \$FILE ]; then \$FILE start; fi
 
+
/etc/rc.d/init.d/zarafa-monitor start
== Download the latest webapp.rpm too in the same subdirectory :==
+
  /etc/rc.d/init.d/zarafa-spooler start
 
+
/etc/rc.d/init.d/zarafa-search start
  wget http://download.zarafa.com/community/final/WebApp/[version]/rhel/[zarafa-webapp-version.noarch.rpm]
+
/etc/rc.d/init.d/zarafa-server start
 
+
exit 0
== Install all rpm's in the unpacked package of ZCP and the webapp.rpm too :==
+
fi
 
+
if [ "\$1" == stop ]; then
  yum localinstall *.rpm
+
  /etc/rc.d/init.d/zarafa-dagent stop
 
+
/etc/rc.d/init.d/zarafa-gateway stop
All packages have dependencies that cannot be resolved if you install only part of the rpm's.
+
  /etc/rc.d/init.d/zarafa-ical stop
 
+
if [ -a \$FILE ]; then \$FILE stop; fi
== Remove the default php-mapi.rpm ==
+
  /etc/rc.d/init.d/zarafa-search stop
 
+
  /etc/rc.d/init.d/zarafa-spooler stop
We have to remove the installation of the default php-mapi (because it's not built for php 5.3).
+
/etc/rc.d/init.d/zarafa-server stop
 
+
  /etc/rc.d/init.d/zarafa-monitor stop 
  rpm -e php-mapi --nodeps
+
exit 0
 
 
== Install the php53-mapi.rpm ==
 
 
 
Install the php53-mapi.rpm of the EPEL-repository :
 
 
 
-If you downloaded the rpm :
 
 
 
  rpm -Uvh --force php53-mapi
 
 
 
-If you did set the EPEL-repository :
 
 
 
  yum install php53-mapi --enablerepo=epel --enablerepo=epel-testing
 
 
 
== Make install/update-actions ==
 
=== nano -w /etc/e-smith/events/actions/zarafa-install ===
 
 
 
  <nowiki>
 
#!/usr/bin/env bash
 
clear
 
 
 
if [ `whoami` != "root" ]; then
 
echo "This installation must be run as user root."
 
echo "Become root, and run this script again."
 
echo
 
exit 1
 
 
fi
 
fi
 
+
if [ "\$1" == restart ]; then
##########################################
+
/etc/rc.d/init.d/zarafa-dagent stop
# Creating some Zarafa-actions
+
/etc/rc.d/init.d/zarafa-gateway stop
##########################################
+
/etc/rc.d/init.d/zarafa-ical stop
 
+
if [ -a \$FILE ]; then \$FILE stop; fi
#
+
/etc/rc.d/init.d/zarafa-monitor stop
#--- zarafa-expand-templates ---
+
/etc/rc.d/init.d/zarafa-search stop
#
+
/etc/rc.d/init.d/zarafa-spooler stop
echo
+
/etc/rc.d/init.d/zarafa-server stop
echo "Creating zarafa-expand-templates-action ..."
+
/etc/rc.d/init.d/zarafa-dagent start
echo
+
/etc/rc.d/init.d/zarafa-gateway start
cat <<HERE1 > /etc/e-smith/events/actions/zarafa-expand-templates
+
/etc/rc.d/init.d/zarafa-ical start
#!/bin/sh
+
if [ -a \$FILE ]; then \$FILE start; fi
/sbin/e-smith/expand-template /etc/zarafa/gateway.cfg
+
/etc/rc.d/init.d/zarafa-monitor start
/sbin/e-smith/expand-template /etc/zarafa/ical.cfg
+
/etc/rc.d/init.d/zarafa-server start
/sbin/e-smith/expand-template /etc/zarafa/server.cfg
+
/etc/rc.d/init.d/zarafa-spooler start
/sbin/e-smith/expand-template /etc/zarafa/unix.cfg
+
/etc/rc.d/init.d/zarafa-search start
/sbin/e-smith/expand-template /etc/zarafa/monitor.cfg
+
exit 0
/sbin/e-smith/expand-template /etc/zarafa/indexer.cfg
+
fi
/sbin/e-smith/expand-template /etc/zarafa/spooler.cfg
+
if [ "\$1" == enabled ]; then
/sbin/e-smith/expand-template /etc/zarafa/dagent.cfg
+
config setprop zarafa-gateway status enabled
/sbin/e-smith/expand-template /etc/zarafa/licensed.cfg
+
config setprop zarafa-ical status enabled
/etc/e-smith/events/actions/qmail-update-user
+
if [ -a \$FILE ]; then config setprop zarafa-licensed status enabled; fi
HERE1
+
config setprop zarafa-monitor status enabled
 
+
config setprop zarafa-server status enabled
 
+
config setprop zarafa-spooler status enabled
#
+
config setprop zarafa-search status enabled
#--- zarafa-services ---
+
config setprop zarafa-dagent status enabled
#
+
exit 0
 +
fi
 +
if [ "\$1" == disabled ]; then
 +
config setprop zarafa-gateway status disabled
 +
config setprop zarafa-ical status disabled
 +
if [ -a \$FILE ]; then config setprop zarafa-licensed status disabled; fi
 +
config setprop zarafa-monitor status disabled
 +
config setprop zarafa-server status disabled
 +
config setprop zarafa-spooler status disabled
 +
config setprop zarafa-search status disabled
 +
config setprop zarafa-dagent status disabled
 +
exit 0
 +
fi
 +
echo "Usage: start|stop|restart|enabled|disabled"
 +
exit 0
 +
HERE2
 +
 
 +
 
 +
#
 +
#--- zarafa-create-user-action ---
 +
#
 
echo
 
echo
echo "Creating zarafa-services-action ..."
+
echo "Creating zarafa-create-user-action ..."
 
echo
 
echo
cat <<HERE2 > /etc/e-smith/events/actions/zarafa-services
+
cat <<HERE3 > /etc/e-smith/events/actions/zarafa-create-user
 
#!/bin/sh
 
#!/bin/sh
FILE=/etc/rc.d/init.d/zarafa-licensed
+
clear
if [ "\$1" == start ]; then
+
/bin/echo "Enter the username of the ZARAFA-user"
/etc/rc.d/init.d/zarafa-dagent start
+
/bin/echo "If you have a multicompany-setup, format of the SME-username and the ZARAFA-username"
/etc/rc.d/init.d/zarafa-gateway start
+
/bin/echo "has to be [username].[companyname] !!!"
/etc/rc.d/init.d/zarafa-ical start
+
read USERNAME
if [ -a \$FILE ]; then \$FILE start; fi
+
/bin/echo "Enter password:"
/etc/rc.d/init.d/zarafa-monitor start
+
read PASSWORD
/etc/rc.d/init.d/zarafa-spooler start
+
/bin/echo "Enter e-mail address:"
/etc/rc.d/init.d/zarafa-indexer start
+
read EMAIL
/etc/rc.d/init.d/zarafa-server start
+
/bin/echo "Enter full name:"
exit 0
+
read FULLNAME
fi
+
/bin/echo "Executing..."
if [ "\$1" == stop ]; then
+
/usr/bin/zarafa-admin -c "\$USERNAME" -p "\$PASSWORD" -e "\$EMAIL" -f "\$FULLNAME"
/etc/rc.d/init.d/zarafa-dagent stop
+
/usr/bin/zarafa-admin -l
/etc/rc.d/init.d/zarafa-gateway stop
+
/sbin/e-smith/db accounts setprop \$USERNAME zarafa enabled
/etc/rc.d/init.d/zarafa-ical stop
+
/etc/e-smith/events/actions/qmail-update-user
if [ -a \$FILE ]; then \$FILE stop; fi
+
HERE3
/etc/rc.d/init.d/zarafa-indexer stop
+
 
/etc/rc.d/init.d/zarafa-spooler stop
+
 
/etc/rc.d/init.d/zarafa-server stop
+
#
/etc/rc.d/init.d/zarafa-monitor stop 
+
#--- zarafa-create-company-action ---
exit 0
+
#
fi
+
echo
if [ "\$1" == restart ]; then
+
echo "Creating zarafa-create-company-action ..."
/etc/rc.d/init.d/zarafa-dagent stop
+
echo
/etc/rc.d/init.d/zarafa-gateway stop
+
cat <<HERE4 > /etc/e-smith/events/actions/zarafa-create-company
/etc/rc.d/init.d/zarafa-ical stop
+
#!/bin/sh
if [ -a \$FILE ]; then \$FILE stop; fi
+
clear
/etc/rc.d/init.d/zarafa-monitor stop
+
/bin/echo "Enter the companyname :"
/etc/rc.d/init.d/zarafa-indexer stop
+
read COMPANYNAME
/etc/rc.d/init.d/zarafa-spooler stop
+
/bin/echo "Executing..."
/etc/rc.d/init.d/zarafa-server stop
+
/usr/bin/zarafa-admin --create-company "\$COMPANYNAME"
/etc/rc.d/init.d/zarafa-dagent start
+
HERE4
/etc/rc.d/init.d/zarafa-gateway start
+
 
/etc/rc.d/init.d/zarafa-ical start
+
 
if [ -a \$FILE ]; then \$FILE start; fi
+
/bin/chmod 554 /etc/e-smith/events/actions/zarafa-expand-templates
/etc/rc.d/init.d/zarafa-monitor start
+
/bin/chmod 554 /etc/e-smith/events/actions/zarafa-services
/etc/rc.d/init.d/zarafa-server start
+
/bin/chmod 554 /etc/e-smith/events/actions/zarafa-create-user
/etc/rc.d/init.d/zarafa-spooler start
+
/bin/chmod 554 /etc/e-smith/events/actions/zarafa-create-company
/etc/rc.d/init.d/zarafa-indexer start
+
 
exit 0
+
#
fi
+
#--- zarafa-configuration-helper-action ---
if [ "\$1" == enabled ]; then
+
#
config setprop zarafa-gateway status enabled
+
echo
config setprop zarafa-ical status enabled
+
echo "Creating zarafa-configuration-helper-action ..."
if [ -a \$FILE ]; then config setprop zarafa-licensed status enabled; fi
+
echo
config setprop zarafa-monitor status enabled
+
cat <<HERE5 > /etc/e-smith/events/actions/helpers.inc
config setprop zarafa-server status enabled
+
# -*- Mode: sh -*-
config setprop zarafa-spooler status enabled
+
replace() {
config setprop zarafa-indexer status enabled
+
file=\$1
config setprop zarafa-dagent status enabled
+
option=\$2
exit 0
+
value=\$3
fi
+
if [ "\$1" == disabled ]; then
+
# escape &-signs, and % for sed
config setprop zarafa-gateway status disabled
+
value=\`echo \$value | sed -e 's/\&/\\\\\&/g' -e 's/\%/\\\\\%/g'\`
config setprop zarafa-ical status disabled
+
sed -i -e "s%\([[:space:]]*\$option[[:space:]]*=[[:space:]]*\).*%\1\$value%" \$file
if [ -a \$FILE ]; then config setprop zarafa-licensed status disabled; fi
 
config setprop zarafa-monitor status disabled
 
config setprop zarafa-server status disabled
 
config setprop zarafa-spooler status disabled
 
config setprop zarafa-indexer status disabled
 
config setprop zarafa-dagent status disabled
 
exit 0
 
fi
 
echo "Usage: start|stop|restart|enabled|disabled"
 
exit 0
 
HERE2
 
  
 +
}
 +
HERE5
 +
 +
. /etc/e-smith/events/actions/helpers.inc
 +
 +
##########################################
 +
# Creating zarafa-db-creation-templates
 +
##########################################
  
 
#
 
#
#--- zarafa-create-user-action ---
+
#--- /etc/e-smith/db/configuration/migrate/80zarafa ---
 
#
 
#
 
echo
 
echo
echo "Creating zarafa-create-user-action ..."
+
echo "Creating /etc/e-smith/db/configuration/migrate/80zarafa ..."
 
echo
 
echo
cat <<HERE3 > /etc/e-smith/events/actions/zarafa-create-user
+
cat <<HERE6 > /etc/e-smith/db/configuration/migrate/80zarafa
#!/bin/sh
+
{
clear
+
    use MIME::Base64 qw(encode_base64);
/bin/echo "Enter the username of the ZARAFA-user"
+
 
/bin/echo "If you have a multicompany-setup, format of the SME-username and the ZARAFA-username"
+
    my \$rec = \$DB->get('zarafa-server') || \$DB->new_record('zarafa-server', {type => 'service'});
/bin/echo "has to be [username].[companyname] !!!"
+
 
read USERNAME
+
    my \$pw = \$rec->prop('DbPassword');
/bin/echo "Enter password:"
+
    return "" if \$pw;
read PASSWORD
 
/bin/echo "Enter e-mail address:"
 
read EMAIL
 
/bin/echo "Enter full name:"
 
read FULLNAME
 
/bin/echo "Executing..."
 
/usr/bin/zarafa-admin -c "\$USERNAME" -p "\$PASSWORD" -e "\$EMAIL" -f "\$FULLNAME"
 
/usr/bin/zarafa-admin -l
 
/sbin/e-smith/db accounts setprop \$USERNAME zarafa enabled
 
/etc/e-smith/events/actions/qmail-update-user
 
HERE3
 
  
 +
    \$rec->set_prop('DbPassword', sprintf("%15.0f", int( (1000000000000000) * rand() )));
 +
}
 +
HERE6
  
 
#
 
#
#--- zarafa-create-company-action ---
+
#--- /etc/e-smith/templates/etc/e-smith/sql/init/80zarafa ---
 
#
 
#
 
echo
 
echo
echo "Creating zarafa-create-company-action ..."
+
echo "Creating /etc/e-smith/templates/etc/e-smith/sql/init/80zarafa ..."
 
echo
 
echo
cat <<HERE4 > /etc/e-smith/events/actions/zarafa-create-company
+
cat <<HERE7 > /etc/e-smith/templates/etc/e-smith/sql/init/80zarafa
#!/bin/sh
+
{
clear
+
    my \$db = \${'zarafa-server'}{DbName} || 'zarafa';
/bin/echo "Enter the companyname :"
+
    my \$user = \${'zarafa-server'}{DbUser} || 'zarafa';
read COMPANYNAME
+
    my \$pass = \${'zarafa-server'}{DbPassword} || 'changeme';
/bin/echo "Executing..."
+
    \$OUT .= <<END
/usr/bin/zarafa-admin --create-company "\$COMPANYNAME"
+
#! /bin/sh
HERE4
+
    if [ -d /var/lib/mysql/\$db ]; then
 +
      exit
 +
    fi
 +
    /usr/bin/mysql <<EOF
 +
    CREATE DATABASE \$db DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
 +
    use \$db;
 +
 +
    use mysql;
 +
    GRANT ALL PRIVILEGES ON \$db.* TO \$user\@localhost
 +
            IDENTIFIED BY '\$pass';
 +
    flush privileges;
 +
EOF
 +
END
 +
}
 +
HERE7
  
 
+
#
/bin/chmod 554 /etc/e-smith/events/actions/zarafa-expand-templates
+
#--- /etc/e-smith/templates.metadata/etc/e-smith/sql/init/80zarafa ---
/bin/chmod 554 /etc/e-smith/events/actions/zarafa-services
+
#
/bin/chmod 554 /etc/e-smith/events/actions/zarafa-create-user
+
echo
/bin/chmod 554 /etc/e-smith/events/actions/zarafa-create-company
+
echo "Creating /etc/e-smith/templates.metadata/etc/e-smith/sql/init/80zarafa ..."
 +
echo
 +
cat <<HERE8 > /etc/e-smith/templates.metadata/etc/e-smith/sql/init/80zarafa
 +
PERMS=0750
 +
HERE8
 +
 
 +
##########################################
 +
# Creating SME-HTTPD-templates
 +
##########################################
  
 
#
 
#
#--- zarafa-configuration-helper-action ---
+
#--- /etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/29ZarafaAliases ---
 
#
 
#
 
echo
 
echo
echo "Creating zarafa-configuration-helper-action ..."
+
echo "Creating /etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/29ZarafaAliases ..."
 
echo
 
echo
cat <<HERE5 > /etc/e-smith/events/actions/helpers.inc
+
cat <<HERE9 > /etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/29ZarafaAliases
# -*- Mode: sh -*-
+
{
replace() {
+
    # vim: ft=perl:
file=\$1
+
 
option=\$2
+
    \$haveSSL = (exists \${modSSL}{status} and \${modSSL}{status} eq "enabled") ?  'yes' : 'no';
value=\$3
+
    my \$zwebmailStatus = \$zarafa{'status'} || "disabled";
+
    my \$zwebmailAccessType = \$zarafa{'access'} || "SSL";
# escape &-signs, and % for sed
 
value=\`echo \$value | sed -e 's/\&/\\\\\&/g' -e 's/\%/\\\\\%/g'\`
 
sed -i -e "s%\([[:space:]]*\$option[[:space:]]*=[[:space:]]*\).*%\1\$value%" \$file
 
  
}
+
    my \$dirs;
HERE5
+
    \$dirs{zarafa} = '/usr/share/zarafa-webaccess';
 +
    \$dirs{webaccess} = '/usr/share/zarafa-webaccess';
 +
    \$dirs{webmail} = '/usr/share/zarafa-webaccess';
 +
    if (\$imp{'status'} eq 'enabled') {\$dirs{webmail} = ''};
 +
    \$dirs{webapp} = '/usr/share/zarafa-webapp';
 +
 
 +
    return "    # Zarafa is disabled in this VirtualHost\n"
 +
                unless \$zwebmailStatus eq 'enabled';
  
. /etc/e-smith/events/actions/helpers.inc
+
    foreach \$place ('zarafa','webmail','webaccess','webapp')
 
+
    {
##########################################
+
        if ((\$port eq "80") && (\$haveSSL eq 'yes') && (\$zwebmailAccessType eq 'SSL'))
# Creating zarafa-db-creation-templates
+
        {
##########################################
+
            \$OUT .= "    RewriteRule ^/\$place(/.*|\\$)    https://%{HTTP_HOST}/\$place\\\$1 [L,R]\n";
 +
        } else {
 +
            if ((\$dirs{\$place}) ne '') {\$OUT .= "    Alias /\$place  \$dirs{\$place}\n"};
 +
        }
 +
    }
 +
}
 +
HERE9
  
 
#
 
#
#--- /etc/e-smith/db/configuration/migrate/80zarafa ---
+
#--- /etc/e-smith/templates/etc/httpd/conf/httpd.conf/86ZarafaAlias ---
 
#
 
#
 
echo
 
echo
echo "Creating /etc/e-smith/db/configuration/migrate/80zarafa ..."
+
echo "Creating /etc/e-smith/templates/etc/httpd/conf/httpd.conf/86ZarafaAlias ..."
 
echo
 
echo
cat <<HERE6 > /etc/e-smith/db/configuration/migrate/80zarafa
+
cat <<HERE10 > /etc/e-smith/templates/etc/httpd/conf/httpd.conf/86ZarafaAlias
 
{
 
{
     use MIME::Base64 qw(encode_base64);
+
     my \$zstatus = \$zarafa{'status'};
  
     my \$rec = \$DB->get('zarafa-server') || \$DB->new_record('zarafa-server', {type => 'service'});
+
     if (defined \$zstatus && \$zstatus eq 'enabled')
 +
    {
 +
        \$OUT .= qq(
 +
#--------------------------------------------------------------------
 +
# Zarafa specific configuration files.
 +
#--------------------------------------------------------------------
  
    my \$pw = \$rec->prop('DbPassword');
+
Alias /zarafa /usr/share/zarafa-webaccess/
    return "" if \$pw;
+
<Directory /usr/share/zarafa-webaccess/>
 +
  Options -Indexes
 +
  AllowOverride All
 +
  order allow,deny
 +
  allow from all
 +
  AddType application/x-httpd-php .php
 +
  php_flag magic_quotes_gpc off
 +
  php_flag track_vars on
 +
</Directory>
  
     \$rec->set_prop('DbPassword', sprintf("%15.0f", int( (1000000000000000) * rand() )));
+
Alias /webapp /usr/share/zarafa-webapp/
 +
<Directory /usr/share/zarafa-webapp/>
 +
  Options -Indexes
 +
  AllowOverride All
 +
  order allow,deny
 +
  allow from all
 +
  AddType application/x-httpd-php .php
 +
  php_flag magic_quotes_gpc off
 +
  php_flag track_vars on
 +
</Directory>
 +
   
 +
);
 +
     }   
 +
    else
 +
    {
 +
      \$OUT .= "# Zarafa Webmail is not configured as it is disabled in the config db";
 +
    }
 
}
 
}
HERE6
+
HERE10
 +
 
 +
##########################################
 +
# Creating SME-QMAIL-user-templates
 +
##########################################
  
 
#
 
#
#--- /etc/e-smith/templates/etc/e-smith/sql/init/80zarafa ---
+
#--- /etc/e-smith/templates-user/.qmail/80Zarafa ---
 
#
 
#
 
echo
 
echo
echo "Creating /etc/e-smith/templates/etc/e-smith/sql/init/80zarafa ..."
+
echo "Creating /etc/e-smith/templates-user/.qmail/80Zarafa ..."
 
echo
 
echo
cat <<HERE7 > /etc/e-smith/templates/etc/e-smith/sql/init/80zarafa
+
cat <<HERE11 > /etc/e-smith/templates-user/.qmail/80Zarafa
 
{
 
{
    my \$db = \${'zarafa-server'}{DbName} || 'zarafa';
+
  my \$zarafa = \$user->prop('zarafa') || 'disabled';
    my \$user = \${'zarafa-server'}{DbUser} || 'zarafa';
+
  my \$zarafa2 = \${'zarafa-server'}{GlobalForward} || 'disabled';
    my \$pass = \${'zarafa-server'}{DbPassword} || 'changeme';
+
 
    \$OUT .= <<END
+
  if (\$zarafa eq 'enabled' || \$zarafa2 eq 'enabled')
#! /bin/sh
+
  { return "| /usr/bin/zarafa-dagent -q \$USERNAME ; if [ \\$\\? -ne 0 ] ; then exit -1; else exit 99; fi;"
    if [ -d /var/lib/mysql/\$db ]; then
+
  }
      exit
+
}
    fi
+
HERE11
    /usr/bin/mysql <<EOF
+
 
    CREATE DATABASE \$db DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
 
    use \$db;
 
 
    use mysql;
 
    GRANT ALL PRIVILEGES ON \$db.* TO \$user\@localhost
 
            IDENTIFIED BY '\$pass';
 
    flush privileges;
 
EOF
 
END
 
}
 
HERE7
 
 
 
 
#
 
#
#--- /etc/e-smith/templates.metadata/etc/e-smith/sql/init/80zarafa ---
+
#--- /etc/e-smith/templates-user/.qmail-junkmail/01Zarafa ---
 
#
 
#
 
echo
 
echo
echo "Creating /etc/e-smith/templates.metadata/etc/e-smith/sql/init/80zarafa ..."
+
echo "Creating /etc/e-smith/templates-user/.qmail-junkmail/01Zarafa ..."
 
echo
 
echo
cat <<HERE8 > /etc/e-smith/templates.metadata/etc/e-smith/sql/init/80zarafa
+
cat <<HERE12 > /etc/e-smith/templates-user/.qmail-junkmail/01Zarafa
PERMS=0750
+
{
HERE8
+
    # vim: ft=perl:
 +
    die "USERNAME not set." unless defined (\$USERNAME);
  
##########################################
+
    use esmith::AccountsDB;
# Creating SME-HTTPD-templates
+
    \$adb = esmith::AccountsDB->open_ro or die "Couldn't open AccountsDB";
 +
 
 +
    \$user = \$adb->get(\$USERNAME) or die "No user \$USERNAME in AccountsDB";
 +
 
 +
    my \$zarafa = \$user->prop('zarafa') || 'disabled';
 +
    my \$zarafa2 = \${'zarafa-server'}{GlobalForward} || 'disabled';
 +
    return "| /usr/bin/zarafa-dagent -qj \$USERNAME ; if [ \\$\\? -ne 0 ] ; then exit -1; else exit 99; fi;"
 +
          if (\$zarafa eq 'enabled' || \$zarafa2 eq 'enabled');
 +
}
 +
HERE12
 +
 
 +
 
 +
##########################################
 +
# Creating Zarafa-configuration-templates
 
##########################################
 
##########################################
  
 
#
 
#
#--- /etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/29ZarafaAliases ---
+
#--- unix config ---
 
#
 
#
 
echo
 
echo
echo "Creating /etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/29ZarafaAliases ..."
+
echo "Creating zarafa-unix-configuration-template ..."
 
echo
 
echo
cat <<HERE9 > /etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/29ZarafaAliases
+
mkdir -p /etc/e-smith/templates/etc/zarafa/unix.cfg
 +
cat <<HERE13 > /etc/e-smith/templates/etc/zarafa/unix.cfg/unix.cfg
 
{
 
{
    # vim: ft=perl:
+
use esmith::AccountsDB
 
+
}
    \$haveSSL = (exists \${modSSL}{status} and \${modSSL}{status} eq "enabled") ?  'yes' : 'no';
+
##############################################################
    my \$zwebmailStatus = \$zarafa{'status'} || "disabled";
+
#  UNIX USER PLUGIN SETTINGS
    my \$zwebmailAccessType = \$zarafa{'access'} || "SSL";
+
#
 +
# Any of these directives that are required, are only required if the
 +
# userplugin parameter is set to unix.
 +
 
 +
# Charset used in /etc/passwd for the fullname of a user. Normally this
 +
# is us-ascii, but this can differ according to your setup.
 +
# The charset specified here must be supported by your iconv(1)
 +
# setup. See iconv -l for all charsets.
 +
fullname_charset = iso-8859-15
  
    my \$dirs;
+
# Default email domain for constructing new users
    \$dirs{zarafa} = '/usr/share/zarafa-webaccess';
+
# Required, no default
    \$dirs{webaccess} = '/usr/share/zarafa-webaccess';
+
default_domain = { \${'zarafa-server'}{DomainName} || \$DomainName; }
    \$dirs{webmail} = '/usr/share/zarafa-webaccess';
 
    if (\$imp{'status'} eq 'enabled') {\$dirs{webmail} = ''};
 
    \$dirs{webapp} = '/usr/share/zarafa-webapp';
 
 
 
    return "    # Zarafa is disabled in this VirtualHost\n"
 
                unless \$zwebmailStatus eq 'enabled';
 
  
    foreach \$place ('zarafa','webmail','webaccess','webapp')
+
# The lowest user id that is considered a regular user
    {
+
# Optional, default = 1000
        if ((\$port eq "80") && (\$haveSSL eq 'yes') && (\$zwebmailAccessType eq 'SSL'))
+
min_user_uid = 101
        {
 
            \$OUT .= "    RewriteRule ^/\$place(/.*|\\$)    https://%{HTTP_HOST}/\$place\\\$1 [L,R]\n";
 
        } else {
 
            if ((\$dirs{\$place}) ne '') {\$OUT .= "    Alias /\$place  \$dirs{\$place}\n"};
 
        }
 
    }
 
}
 
HERE9
 
  
#
+
# The highest user id that is considered a regular user
#--- /etc/e-smith/templates/etc/httpd/conf/httpd.conf/86ZarafaAlias ---
+
# Optional, default = 10000
#
+
max_user_uid = 10000
echo
 
echo "Creating /etc/e-smith/templates/etc/httpd/conf/httpd.conf/86ZarafaAlias ..."
 
echo
 
cat <<HERE10 > /etc/e-smith/templates/etc/httpd/conf/httpd.conf/86ZarafaAlias
 
{
 
    my \$zstatus = \$zarafa{'status'};
 
  
     if (defined \$zstatus && \$zstatus eq 'enabled')
+
# A list of user ids that are not considered to be regular users
     {
+
# Optional, default = empty
        \$OUT .= qq(
+
# except_user_uids =
#--------------------------------------------------------------------
+
except_user_uids = {
# Zarafa specific configuration files.
+
\$accounts = esmith::AccountsDB->open_ro or die "Could not open AccountsDB";
#--------------------------------------------------------------------
+
{
 +
while ((\$name, \$passwd, \$uid, \$gid, \$quota,
 +
     \$comment, \$gcos, \$dir, \$shell) = getpwent())
 +
{
 +
\$user = \$accounts->get(\$name);
 +
      
 +
\$OUT .= "\$uid "
 +
    unless \$uid <= 101 or (defined \$user and \$user->prop('type') eq "user");
 +
}
 +
}
 +
}
 +
 
 +
# The lowest group id that is considered a regular group
 +
# Optional, default = 1000
 +
min_group_gid = 5000
  
Alias /zarafa /usr/share/zarafa-webaccess/
+
# The highest group id that is considered a regular group
<Directory /usr/share/zarafa-webaccess/>
+
# Optional, default = 10000
  Options -Indexes
+
max_group_gid = 10000
  AllowOverride All
 
  order allow,deny
 
  allow from all
 
  AddType application/x-httpd-php .php
 
  php_flag magic_quotes_gpc off
 
  php_flag track_vars on
 
</Directory>
 
  
Alias /webapp /usr/share/zarafa-webapp/
+
# A list of group ids that are not considered to be regular groups
<Directory /usr/share/zarafa-webapp/>
+
# Optional, default = empty
  Options -Indexes
+
# except_group_gids =
  AllowOverride All
+
except_group_gids = {
  order allow,deny
+
setpwent();
  allow from all
+
while ((\$name, \$passwd, \$uid, \$gid, \$quota,
  AddType application/x-httpd-php .php
+
    \$comment, \$gcos, \$dir, \$shell) = getpwent())
  php_flag magic_quotes_gpc off
+
{
  php_flag track_vars on
+
\$group = \$accounts->get(\$name);
</Directory>
+
      
   
+
\$OUT .= "\$gid "
);
+
    unless \$gid < 5000 or (defined \$group and \$group->prop('type') eq "group");
     }   
+
}
    else
+
endpwent();
    {
 
      \$OUT .= "# Zarafa Webmail is not configured as it is disabled in the config db";
 
    }
 
 
}
 
}
HERE10
 
  
##########################################
+
# Create a user as non-active when it has this unix shell
# Creating SME-QMAIL-user-templates
+
non_login_shell = /bin/false
##########################################
+
HERE13
 +
 
  
 
#
 
#
#--- /etc/e-smith/templates-user/.qmail/80Zarafa ---
+
#--- sysconfig config ---
 
#
 
#
 
echo
 
echo
echo "Creating /etc/e-smith/templates-user/.qmail/80Zarafa ..."
+
echo "Creating zarafa-sysconfig-configuration-template ..."
 
echo
 
echo
cat <<HERE11 > /etc/e-smith/templates-user/.qmail/80Zarafa
+
mkdir -p /etc/e-smith/templates/etc/sysconfig/zarafa
{
+
cat /etc/sysconfig/zarafa | sed -e 's/\r$//g' > /etc/e-smith/templates/etc/sysconfig/zarafa/zarafa
  my \$zarafa = \$user->prop('zarafa') || 'disabled';
+
replace /etc/e-smith/templates/etc/sysconfig/zarafa/zarafa ZARAFA_LOCALE '"{ ${'\''zarafa'\''}{language} || '\''en_US.UTF-8'\'' ; }"'
  my \$zarafa2 = \${'zarafa-server'}{GlobalForward} || 'disabled';
+
replace /etc/e-smith/templates/etc/sysconfig/zarafa/zarafa ZARAFA_USERSCRIPT_LOCALE '"{ ${'\''zarafa'\''}{language} || '\''en_US.UTF-8'\'' ; }"'
  
  if (\$zarafa eq 'enabled' || \$zarafa2 eq 'enabled')
 
  { return "| /usr/bin/zarafa-dagent -q \$USERNAME ; if [ \\$\\? -ne 0 ] ; then exit -1; else exit 99; fi;"
 
  }
 
}
 
HERE11
 
  
 
#
 
#
#--- /etc/e-smith/templates-user/.qmail-junkmail/01Zarafa ---
+
#--- licensed config ---
 
#
 
#
 
echo
 
echo
echo "Creating /etc/e-smith/templates-user/.qmail-junkmail/01Zarafa ..."
+
echo "Creating zarafa-licensed-configuration-template ..."
 
echo
 
echo
cat <<HERE12 > /etc/e-smith/templates-user/.qmail-junkmail/01Zarafa
+
mkdir -p /etc/e-smith/templates/etc/zarafa/licensed.cfg
{
+
cat /usr/share/doc/zarafa-licensed/example-config/licensed.cfg | sed -e 's/\r$//g' > /etc/e-smith/templates/etc/zarafa/licensed.cfg/licensed.cfg
    # vim: ft=perl:
+
replace /etc/e-smith/templates/etc/zarafa/licensed.cfg/licensed.cfg log_method '{ ${'\''zarafa-licensed'\''}{log_method} || '\''file'\''; }'
    die "USERNAME not set." unless defined (\$USERNAME);
+
replace /etc/e-smith/templates/etc/zarafa/licensed.cfg/licensed.cfg log_level '{ ${'\''zarafa-licensed'\''}{log_level} || '\''2'\''; }'
 +
replace /etc/e-smith/templates/etc/zarafa/licensed.cfg/licensed.cfg log_timestamp '{ ${'\''zarafa-licensed'\''}{log_timestamp} || '\''1'\''; }'
  
    use esmith::AccountsDB;
+
#
    \$adb = esmith::AccountsDB->open_ro or die "Couldn't open AccountsDB";
+
#--- server config ---
 
 
    \$user = \$adb->get(\$USERNAME) or die "No user \$USERNAME in AccountsDB";
 
 
 
    my \$zarafa = \$user->prop('zarafa') || 'disabled';
 
    my \$zarafa2 = \${'zarafa-server'}{GlobalForward} || 'disabled';
 
    return "| /usr/bin/zarafa-dagent -qj \$USERNAME ; if [ \\$\\? -ne 0 ] ; then exit -1; else exit 99; fi;"
 
          if (\$zarafa eq 'enabled' || \$zarafa2 eq 'enabled');
 
}
 
HERE12
 
 
 
 
 
##########################################
 
# Creating Zarafa-configuration-templates
 
##########################################
 
 
 
#
 
#--- unix config ---
 
 
#
 
#
 
echo
 
echo
echo "Creating zarafa-unix-configuration-template ..."
+
echo "Creating zarafa-server-configuration-template ..."
 
echo
 
echo
mkdir -p /etc/e-smith/templates/etc/zarafa/unix.cfg
+
mkdir -p /etc/e-smith/templates/etc/zarafa/server.cfg
cat <<HERE13 > /etc/e-smith/templates/etc/zarafa/unix.cfg/unix.cfg
+
cat /usr/share/doc/zarafa/example-config/server.cfg | sed -e 's/\r$//g' > /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg
{
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_tcp_enabled '{ ${'\''zarafa-server'\''}{server_tcp_enabled} || '\''yes'\''; }'
use esmith::AccountsDB
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_tcp_port '{ ${'\''zarafa-server'\''}{TCPPort} || '\''236'\''; }'
}
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_pipe_enabled '{ ${'\''zarafa-server'\''}{server_pipe_enabled} || '\''yes'\''; }'
##############################################################
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_name '{ ${'\''zarafa-server'\''}{server_name} || '\''Zarafa'\''; }'
#  UNIX USER PLUGIN SETTINGS
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg database_engine '{ ${'\''zarafa-server'\''}{database_engine} || '\''mysql'\''; }'
#
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg allow_local_users '{ ${'\''zarafa-server'\''}{allow_local_users} || '\''yes'\''; }'
# Any of these directives that are required, are only required if the
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg local_admin_users '{ ${'\''zarafa-server'\''}{local_admin_users} || '\''root'\''; }'
# userplugin parameter is set to unix.
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg system_email_address '{ ${'\''zarafa-server'\''}{system_email_address} || '\''postmaster@localhost'\''; }'
 
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg session_timeout '{ ${'\''zarafa-server'\''}{session_timeout} || '\''300'\''; }'
# Charset used in /etc/passwd for the fullname of a user. Normally this
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg license_timeout '{ ${'\''zarafa-server'\''}{license_timeout} || '\''10'\''; }'
# is us-ascii, but this can differ according to your setup.
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg log_method '{ ${'\''zarafa-server'\''}{log_method} || '\''file'\''; }'
# The charset specified here must be supported by your iconv(1)
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg log_level '{ ${'\''zarafa-server'\''}{log_level} || '\''2'\''; }'
# setup. See iconv -l for all charsets.
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg log_timestamp '{ ${'\''zarafa-server'\''}{log_timestamp} || '\''1'\''; }'
fullname_charset = iso-8859-15
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg audit_log_enabled '{ ${'\''zarafa-server'\''}{audit_log_enabled} || '\''no'\''; }'
 
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg audit_log_level '{ ${'\''zarafa-server'\''}{audit_log_level} || '\''1'\''; }'
# Default email domain for constructing new users
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg audit_log_timestamp '{ ${'\''zarafa-server'\''}{audit_log_timestamp} || '\''1'\''; }'
# Required, no default
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg mysql_host '{ ${'\''zarafa-server'\''}{mysql_host} || '\''localhost'\''; }'
default_domain = { \${'zarafa-server'}{DomainName} || \$DomainName; }
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg mysql_port '{ ${'\''zarafa-server'\''}{mysql_port} || '\''3306'\''; }'
 
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg mysql_user '{ ${'\''zarafa-server'\''}{DbUser} || '\''zarafa'\''; }'
# The lowest user id that is considered a regular user
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg mysql_password '{ ${'\''zarafa-server'\''}{DbPassword}; }'
# Optional, default = 1000
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg mysql_database '{ ${'\''zarafa-server'\''}{DbName} || '\''zarafa'\''; }'
min_user_uid = 101
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg attachment_storage '{ ${'\''zarafa-server'\''}{attachment_storage} || '\''files'\''; }'
 
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg attachment_path '/home/e-smith/files/zarafa'
# The highest user id that is considered a regular user
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg attachment_compression '{ ${'\''zarafa-server'\''}{attachment_compression} || '\''6'\''; }'
# Optional, default = 10000
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_ssl_enabled '{ ${'\''zarafa-ssl'\''}{server_ssl_enabled} || '\''yes'\''; }'
max_user_uid = 10000
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_ssl_port '{ ${'\''zarafa-ssl'\''}{TCPPort} || '\''237'\''; }'
 
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_ssl_key_file '/home/e-smith/ssl.pem/{$SystemName}.{$DomainName}.pem'
# A list of user ids that are not considered to be regular users
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_ssl_key_pass '{ ${'\''zarafa-server'\''}{DbPassword}; }'
# Optional, default = empty
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_ssl_ca_file '/home/e-smith/ssl.crt/{$SystemName}.{$DomainName}.crt'
# except_user_uids =
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_ssl_ca_path '/home/e-smith/ssl.crt'
except_user_uids = {
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg sslkeys_path '/home/e-smith/ssl.pem'
\$accounts = esmith::AccountsDB->open_ro or die "Could not open AccountsDB";
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg threads '{ ${'\''zarafa-server'\''}{threads} || '\''8'\''; }'
{
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg watchdog_frequency '{ ${'\''zarafa-server'\''}{watchdog_frequency} || '\''1'\''; }'
while ((\$name, \$passwd, \$uid, \$gid, \$quota,
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg watchdog_max_age '{ ${'\''zarafa-server'\''}{watchdog_max_age} || '\''500'\''; }'
    \$comment, \$gcos, \$dir, \$shell) = getpwent())
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_max_keep_alive_requests '{ ${'\''zarafa-server'\''}{server_max_keep_alive_requests} || '\''100'\''; }'
{
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_recv_timeout '{ ${'\''zarafa-server'\''}{server_recv_timeout} || '\''5'\''; }'
\$user = \$accounts->get(\$name);
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_read_timeout '{ ${'\''zarafa-server'\''}{server_read_timeout} || '\''60'\''; }'
   
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_send_timeout '{ ${'\''zarafa-server'\''}{server_send_timeout} || '\''60'\''; }'
\$OUT .= "\$uid "
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg softdelete_lifetime '{ ${'\''zarafa-server'\''}{softdelete_lifetime} || '\''30'\''; }'
    unless \$uid <= 101 or (defined \$user and \$user->prop('type') eq "user");
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg sync_lifetime '{ ${'\''zarafa-server'\''}{sync_lifetime} || '\''365'\''; }'
}
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg sync_log_all_changes '{ ${'\''zarafa-server'\''}{sync_log_all_changes} || '\''no'\''; }'
}
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg enable_sso '{ ${'\''zarafa-server'\''}{enable_sso} || '\''no'\''; }'
}
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg enable_gab '{ ${'\''zarafa-server'\''}{enable_gab} || '\''yes'\''; }'
 
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg auth_method '{ ${'\''zarafa-server'\''}{auth_method} || '\''plugin'\''; }'
# The lowest group id that is considered a regular group
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg pam_service '{ ${'\''zarafa-server'\''}{pam_service} || '\''passwd'\''; }'
# Optional, default = 1000
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg cache_cell_size '{ ${'\''zarafa-server'\''}{cache_cell_size} || '\''268435456'\''; }'
min_group_gid = 5000
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg cache_object_size '{ ${'\''zarafa-server'\''}{cache_object_size} || '\''5242880'\''; }'
 
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg cache_indexedobject_size '{ ${'\''zarafa-server'\''}{cache_indexedobject_size} || '\''16777216'\''; }'
# The highest group id that is considered a regular group
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg cache_quota_size '{ ${'\''zarafa-server'\''}{cache_quota_size} || '\''1048576'\''; }'
# Optional, default = 10000
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg cache_quota_lifetime '{ ${'\''zarafa-server'\''}{cache_quota_lifetime} || '\''1'\''; }'
max_group_gid = 10000
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg cache_acl_size '{ ${'\''zarafa-server'\''}{cache_acl_size} || '\''1048576'\''; }'
 
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg cache_store_size '{ ${'\''zarafa-server'\''}{cache_store_size} || '\''1048576'\''; }'
# A list of group ids that are not considered to be regular groups
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg cache_user_size '{ ${'\''zarafa-server'\''}{cache_user_size} || '\''1048576'\''; }'
# Optional, default = empty
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg cache_userdetails_size '{ ${'\''zarafa-server'\''}{cache_userdetails_size} || '\''26214400'\''; }'
# except_group_gids =
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg cache_userdetails_lifetime '{ ${'\''zarafa-server'\''}{cache_userdetails_lifetime} || '\''5'\''; }'
except_group_gids = {
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg cache_server_size '{ ${'\''zarafa-server'\''}{cache_server_size} || '\''1048576'\''; }'
setpwent();
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg cache_server_lifetime '{ ${'\''zarafa-server'\''}{cache_server_lifetime} || '\''30'\''; }'
while ((\$name, \$passwd, \$uid, \$gid, \$quota,
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg quota_warn '{ ${'\''zarafa-server'\''}{quota_warn} || '\''0'\''; }'
    \$comment, \$gcos, \$dir, \$shell) = getpwent())
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg quota_soft '{ ${'\''zarafa-server'\''}{quota_soft} || '\''0'\''; }'
{
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg quota_hard '{ ${'\''zarafa-server'\''}{quota_hard} || '\''0'\''; }'
\$group = \$accounts->get(\$name);
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg companyquota_warn '{ ${'\''zarafa-server'\''}{companyquota_warn} || '\''0'\''; }'
   
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg user_plugin '{ ${'\''zarafa-server'\''}{user_plugin} || '\''db'\''; }'
\$OUT .= "\$gid "
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg user_plugin_config '{ ${'\''zarafa-server'\''}{user_plugin_config}; }'
    unless \$gid < 5000 or (defined \$group and \$group->prop('type') eq "group");
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg user_safe_mode '{ ${'\''zarafa-server'\''}{user_safe_mode} || '\''no'\''; }'
}
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg thread_stacksize '{ ${'\''zarafa-server'\''}{thread_stacksize} || '\''512'\''; }'
endpwent();
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg enable_hosted_zarafa '{ ${'\''zarafa-server'\''}{enable_hosted_zarafa} || '\''false'\''; }'
}
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg enable_distributed_zarafa '{ ${'\''zarafa-server'\''}{enable_distributed_zarafa} || '\''false'\''; }'
 
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg storename_format '{ ${'\''zarafa-server'\''}{storename_format} || '\''%f'\''; }'
# Create a user as non-active when it has this unix shell
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg loginname_format '{ ${'\''zarafa-server'\''}{loginname_format} || '\''%u'\''; }'
non_login_shell = /bin/false
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg client_update_enabled '{ ${'\''zarafa-server'\''}{client_update_enabled} || '\''false'\''; }'
HERE13
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg client_update_path '{ ${'\''zarafa-server'\''}{client_update_path} || '\''/var/lib/zarafa/client'\''; }'
 +
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg client_update_log_level '{ ${'\''zarafa-server'\''}{client_update_log_level} || '\''1'\''; }'
 +
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg hide_everyone '{ ${'\''zarafa-server'\''}{hide_everyone} || '\''yes'\''; }'
 +
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg hide_system '{ ${'\''zarafa-server'\''}{hide_system} || '\''yes'\''; }'
 +
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg search_enabled '{ ${'\''zarafa-server'\''}{search_enabled} || '\''no'\''; }'
 +
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg search_timeout '{ ${'\''zarafa-server'\''}{search_timeout} || '\''10'\''; }'
 +
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg enable_enhanced_ics '{ ${'\''zarafa-server'\''}{enable_enhanced_ics} || '\''yes'\''; }'
 +
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg sync_gab_realtime '{ ${'\''zarafa-server'\''}{sync_gab_realtime} || '\''yes'\''; }'
 +
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg disabled_features '{ ${'\''zarafa-server'\''}{disabled_features}; }'
 +
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg max_deferred_records '{ ${'\''zarafa-server'\''}{max_deferred_records} || '\''0'\''; }'
 +
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg max_deferred_records_folder '{ ${'\''zarafa-server'\''}{max_deferred_records_folder} || '\''20'\''; }'
 +
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg coredump_enabled '{ ${'\''zarafa-server'\''}{coredump_enabled} || '\''yes'\''; }'
 +
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_ssl_enable_v2 '{ ${'\''zarafa-server'\''}{server_ssl_enable_v2} || '\''no'\''; }'
  
  
 
#
 
#
#--- sysconfig config ---
+
#--- dagent config ---
 
#
 
#
 
echo
 
echo
echo "Creating zarafa-sysconfig-configuration-template ..."
+
echo "Creating zarafa-dagent-configuration-template ..."
 
echo
 
echo
mkdir -p /etc/e-smith/templates/etc/sysconfig/zarafa
+
mkdir -p /etc/e-smith/templates/etc/zarafa/dagent.cfg
cat /etc/sysconfig/zarafa | sed -e 's/\r$//g' >  /etc/e-smith/templates/etc/sysconfig/zarafa/zarafa
+
cat /usr/share/doc/zarafa-dagent/example-config/dagent.cfg | sed -e 's/\r$//g' >  /etc/e-smith/templates/etc/zarafa/dagent.cfg/dagent.cfg
replace /etc/e-smith/templates/etc/sysconfig/zarafa/zarafa ZARAFA_LOCALE '"{ ${'\''zarafa'\''}{language} || '\''en_US.UTF-8'\'' ; }"'
+
replace /etc/e-smith/templates/etc/zarafa/dagent.cfg/dagent.cfg log_method '{ ${'\''zarafa-dagent'\''}{log_method} || '\''file'\''; }'
replace /etc/e-smith/templates/etc/sysconfig/zarafa/zarafa ZARAFA_USERSCRIPT_LOCALE '"{ ${'\''zarafa'\''}{language} || '\''en_US.UTF-8'\'' ; }"'
+
replace /etc/e-smith/templates/etc/zarafa/dagent.cfg/dagent.cfg log_level '{ ${'\''zarafa-dagent'\''}{log_level} || '\''2'\''; }'
 
+
replace /etc/e-smith/templates/etc/zarafa/dagent.cfg/dagent.cfg log_timestamp '{ ${'\''zarafa-dagent'\''}{log_timestamp} || '\''1'\''; }'
 
+
replace /etc/e-smith/templates/etc/zarafa/dagent.cfg/dagent.cfg log_raw_message '{ ${'\''zarafa-dagent'\''}{log_raw_message} || '\''no'\''; }'
#
+
replace /etc/e-smith/templates/etc/zarafa/dagent.cfg/dagent.cfg lmtp_port '{ ${'\''zarafa-dagent'\''}{lmtp_port} || '\''2003'\''; }'
#--- licensed config ---
+
replace /etc/e-smith/templates/etc/zarafa/dagent.cfg/dagent.cfg lmtp_max_threads '{ ${'\''zarafa-dagent'\''}{lmtp_max_threads} || '\''20'\''; }'
#
+
replace /etc/e-smith/templates/etc/zarafa/dagent.cfg/dagent.cfg process_model '{ ${'\''zarafa-dagent'\''}{process_model} || '\''fork'\''; }'
echo
+
replace /etc/e-smith/templates/etc/zarafa/dagent.cfg/dagent.cfg spam_header_name '{ ${'\''zarafa-dagent'\''}{spam_header_name} || '\''X-Spam-Status'\''; }'
echo "Creating zarafa-licensed-configuration-template ..."
+
replace /etc/e-smith/templates/etc/zarafa/dagent.cfg/dagent.cfg spam_header_value '{ ${'\''zarafa-dagent'\''}{spam_header_value} || '\''Yes'\''; }'
echo
+
replace /etc/e-smith/templates/etc/zarafa/dagent.cfg/dagent.cfg archive_on_delivery '{ ${'\''zarafa-dagent'\''}{archive_on_delivery} || '\''no'\''; }'
mkdir -p /etc/e-smith/templates/etc/zarafa/licensed.cfg
+
replace /etc/e-smith/templates/etc/zarafa/dagent.cfg/dagent.cfg set_rule_headers '{ ${'\''zarafa-dagent'\''}{set_rule_headers} || '\''yes'\''; }'
cat /usr/share/doc/zarafa-licensed/example-config/licensed.cfg | sed -e 's/\r$//g' /etc/e-smith/templates/etc/zarafa/licensed.cfg/licensed.cfg
+
 
replace /etc/e-smith/templates/etc/zarafa/licensed.cfg/licensed.cfg log_method '{ ${'\''zarafa-licensed'\''}{log_method} || '\''file'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/licensed.cfg/licensed.cfg log_level '{ ${'\''zarafa-licensed'\''}{log_level} || '\''2'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/licensed.cfg/licensed.cfg log_timestamp '{ ${'\''zarafa-licensed'\''}{log_timestamp} || '\''1'\''; }'
 
  
 
#
 
#
#--- server config ---
+
#--- spooler config ---
 
#
 
#
 
echo
 
echo
echo "Creating zarafa-server-configuration-template ..."
+
echo "Creating zarafa-spooler-configuration-template ..."
 
echo
 
echo
mkdir -p /etc/e-smith/templates/etc/zarafa/server.cfg
+
mkdir -p /etc/e-smith/templates/etc/zarafa/spooler.cfg
cat /usr/share/doc/zarafa/example-config/server.cfg | sed -e 's/\r$//g' >  /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg
+
cat /usr/share/doc/zarafa-spooler/example-config/spooler.cfg | sed -e 's/\r$//g' >  /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_tcp_enabled '{ ${'\''zarafa-server'\''}{server_tcp_enabled} || '\''yes'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg smtp_port '{ ${'\''zarafa-spooler'\''}{smtp_port} || '\''25'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_tcp_port '{ ${'\''zarafa-server'\''}{TCPPort} || '\''236'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg log_method '{ ${'\''zarafa-spooler'\''}{log_method} || '\''file'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_pipe_enabled '{ ${'\''zarafa-server'\''}{server_pipe_enabled} || '\''yes'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg log_level '{ ${'\''zarafa-spooler'\''}{log_level} || '\''3'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_name '{ ${'\''zarafa-server'\''}{server_name} || '\''Zarafa'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg log_timestamp '{ ${'\''zarafa-spooler'\''}{log_timestamp} || '\''1'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg database_engine '{ ${'\''zarafa-server'\''}{database_engine} || '\''mysql'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg max_threads '{ ${'\''zarafa-spooler'\''}{max_threads} || '\''5'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg allow_local_users '{ ${'\''zarafa-server'\''}{allow_local_users} || '\''yes'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg fax_domain '{ ${'\''zarafa-spooler'\''}{fax_domain} || '\''fax.local'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg local_admin_users '{ ${'\''zarafa-server'\''}{local_admin_users} || '\''root'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg fax_international '{ ${'\''zarafa-spooler'\''}{fax_international} || '\''00'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg system_email_address '{ ${'\''zarafa-server'\''}{system_email_address} || '\''postmaster@localhost'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg always_send_delegates '{ ${'\''zarafa-spooler'\''}{always_send_delegates} || '\''no'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg session_timeout '{ ${'\''zarafa-server'\''}{session_timeout} || '\''300'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg allow_redirect_spoofing '{ ${'\''zarafa-spooler'\''}{allow_redirect_spoofing} || '\''yes'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg license_timeout '{ ${'\''zarafa-server'\''}{license_timeout} || '\''10'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg copy_delegate_mails '{ ${'\''zarafa-spooler'\''}{copy_delegate_mails} || '\''yes'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg log_method '{ ${'\''zarafa-server'\''}{log_method} || '\''file'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg allow_delegate_meeting_request '{ ${'\''zarafa-spooler'\''}{allow_delegate_meeting_request} || '\''yes'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg log_level '{ ${'\''zarafa-server'\''}{log_level} || '\''2'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg allow_send_to_everyone '{ ${'\''zarafa-spooler'\''}{allow_send_to_everyone} || '\''yes'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg log_timestamp '{ ${'\''zarafa-server'\''}{log_timestamp} || '\''1'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg always_send_tnef '{ ${'\''zarafa-spooler'\''}{always_send_tnef} || '\''no'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg audit_log_enabled '{ ${'\''zarafa-server'\''}{audit_log_enabled} || '\''no'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg always_send_utf8 '{ ${'\''zarafa-spooler'\''}{always_send_utf8} || '\''no'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg audit_log_level '{ ${'\''zarafa-server'\''}{audit_log_level} || '\''1'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg charset_upgrade '{ ${'\''zarafa-spooler'\''}{charset_upgrade} || '\''windows-1252'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg audit_log_timestamp '{ ${'\''zarafa-server'\''}{audit_log_timestamp} || '\''1'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg expand_groups '{ ${'\''zarafa-spooler'\''}{expand_groups} || '\''no'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg mysql_host '{ ${'\''zarafa-server'\''}{mysql_host} || '\''localhost'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg archive_on_send '{ ${'\''zarafa-spooler'\''}{archive_on_send} || '\''no'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg mysql_port '{ ${'\''zarafa-server'\''}{mysql_port} || '\''3306'\''; }'
+
 
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg mysql_user '{ ${'\''zarafa-server'\''}{DbUser} || '\''zarafa'\''; }'
+
 
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg mysql_password '{ ${'\''zarafa-server'\''}{DbPassword}; }'
+
#
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg mysql_database '{ ${'\''zarafa-server'\''}{DbName} || '\''zarafa'\''; }'
+
#--- monitor config ---
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg attachment_storage '{ ${'\''zarafa-server'\''}{attachment_storage} || '\''files'\''; }'
+
#
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg attachment_path '/home/e-smith/files/zarafa'
+
echo
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg attachment_compression '{ ${'\''zarafa-server'\''}{attachment_compression} || '\''6'\''; }'
+
echo "Creating zarafa-monitor-configuration-template ..."
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_ssl_enabled '{ ${'\''zarafa-ssl'\''}{server_ssl_enabled} || '\''yes'\''; }'
+
echo "The monitor program sends quota warning mails to users who are over quota."
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_ssl_port '{ ${'\''zarafa-ssl'\''}{TCPPort} || '\''237'\''; }'
+
echo
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_ssl_key_file '/home/e-smith/ssl.pem/{$SystemName}.{$DomainName}.pem'
+
mkdir -p /etc/e-smith/templates/etc/zarafa/monitor.cfg
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_ssl_key_pass '{ ${'\''zarafa-server'\''}{DbPassword}; }'
+
cat /usr/share/doc/zarafa-monitor/example-config/monitor.cfg | sed -e 's/\r$//g' >  /etc/e-smith/templates/etc/zarafa/monitor.cfg/monitor.cfg
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_ssl_ca_file '/home/e-smith/ssl.crt/{$SystemName}.{$DomainName}.crt'
+
replace /etc/e-smith/templates/etc/zarafa/monitor.cfg/monitor.cfg log_method '{ ${'\''zarafa-monitor'\''}{log_method} || '\''file'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_ssl_ca_path '/home/e-smith/ssl.crt'
+
replace /etc/e-smith/templates/etc/zarafa/monitor.cfg/monitor.cfg log_level '{ ${'\''zarafa-monitor'\''}{log_level} || '\''2'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg sslkeys_path '/home/e-smith/ssl.pem'
+
replace /etc/e-smith/templates/etc/zarafa/monitor.cfg/monitor.cfg log_timestamp '{ ${'\''zarafa-monitor'\''}{log_timestamp} || '\''1'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg threads '{ ${'\''zarafa-server'\''}{threads} || '\''8'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/monitor.cfg/monitor.cfg quota_check_interval '{ ${'\''zarafa-monitor'\''}{quota_check_interval} || '\''15'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg watchdog_frequency '{ ${'\''zarafa-server'\''}{watchdog_frequency} || '\''1'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/monitor.cfg/monitor.cfg mailquota_resend_interval '{ ${'\''zarafa-monitor'\''}{mailquota_resend_interval} || '\''1'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg watchdog_max_age '{ ${'\''zarafa-server'\''}{watchdog_max_age} || '\''500'\''; }'
+
 
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_max_keep_alive_requests '{ ${'\''zarafa-server'\''}{server_max_keep_alive_requests} || '\''100'\''; }'
+
 
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_recv_timeout '{ ${'\''zarafa-server'\''}{server_recv_timeout} || '\''5'\''; }'
+
#
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_read_timeout '{ ${'\''zarafa-server'\''}{server_read_timeout} || '\''60'\''; }'
+
#--- gateway config ---
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_send_timeout '{ ${'\''zarafa-server'\''}{server_send_timeout} || '\''60'\''; }'
+
#
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg softdelete_lifetime '{ ${'\''zarafa-server'\''}{softdelete_lifetime} || '\''30'\''; }'
+
echo
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg sync_lifetime '{ ${'\''zarafa-server'\''}{sync_lifetime} || '\''365'\''; }'
+
echo "Creating zarafa-gateway-configuration-template ..."
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg sync_log_all_changes '{ ${'\''zarafa-server'\''}{sync_log_all_changes} || '\''no'\''; }'
+
echo
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg enable_sso '{ ${'\''zarafa-server'\''}{enable_sso} || '\''no'\''; }'
+
mkdir -p /etc/e-smith/templates/etc/zarafa/gateway.cfg
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg enable_gab '{ ${'\''zarafa-server'\''}{enable_gab} || '\''yes'\''; }'
+
cat /usr/share/doc/zarafa-gateway/example-config/gateway.cfg | sed -e 's/\r$//g' >  /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg auth_method '{ ${'\''zarafa-server'\''}{auth_method} || '\''plugin'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg server_socket 'http://localhost:{${'\''zarafa-server'\''}{TCPPort}||'\''236'\'';}/zarafa'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg pam_service '{ ${'\''zarafa-server'\''}{pam_service} || '\''passwd'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg pop3_enable '{ if (${'\''zarafa-pop3'\''}{status} eq '\''enabled'\'') {'\''yes'\''} else {'\''no'\''}; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg cache_cell_size '{ ${'\''zarafa-server'\''}{cache_cell_size} || '\''268435456'\''; }'  
+
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg pop3_port '{ ${'\''zarafa-pop3'\''}{TCPPort} || '\''8110'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg cache_object_size '{ ${'\''zarafa-server'\''}{cache_object_size} || '\''5242880'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg pop3s_enable '{ if (${'\''zarafa-pop3s'\''}{status} eq '\''enabled'\'') {'\''yes'\''} else {'\''no'\''}; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg cache_indexedobject_size '{ ${'\''zarafa-server'\''}{cache_indexedobject_size} || '\''16777216'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg pop3s_port '{ ${'\''zarafa-pop3s'\''}{TCPPort} || '\''8995'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg cache_quota_size '{ ${'\''zarafa-server'\''}{cache_quota_size} || '\''1048576'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg imap_enable '{ if (${'\''zarafa-imap'\''}{status} eq '\''enabled'\'') {'\''yes'\''} else {'\''no'\''}; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg cache_quota_lifetime '{ ${'\''zarafa-server'\''}{cache_quota_lifetime} || '\''1'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg imap_port '{ ${'\''zarafa-imap'\''}{TCPPort} || '\''8143'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg cache_acl_size '{ ${'\''zarafa-server'\''}{cache_acl_size} || '\''1048576'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg imaps_enable '{ if (${'\''zarafa-imaps'\''}{status} eq '\''enabled'\'') {'\''yes'\''} else {'\''no'\''}; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg cache_store_size '{ ${'\''zarafa-server'\''}{cache_store_size} || '\''1048576'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg imaps_port '{ ${'\''zarafa-imaps'\''}{TCPPort} || '\''8993'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg cache_user_size '{ ${'\''zarafa-server'\''}{cache_user_size} || '\''1048576'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg imap_only_mailfolders '{ ${'\''zarafa-imap'\''}{imap_only_mailfolders} || '\''yes'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg cache_userdetails_size '{ ${'\''zarafa-server'\''}{cache_userdetails_size} || '\''26214400'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg imap_public_folders '{ ${'\''zarafa-imap'\''}{imap_public_folders} || '\''yes'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg cache_userdetails_lifetime '{ ${'\''zarafa-server'\''}{cache_userdetails_lifetime} || '\''5'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg imap_capability_idle '{ ${'\''zarafa-imap'\''}{imap_capability_idle} || '\''yes'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg cache_server_size '{ ${'\''zarafa-server'\''}{cache_server_size} || '\''1048576'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg imap_max_messagesize '{ ${'\''zarafa-imap'\''}{imap_max_messagesize} || '\''134217728'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg cache_server_lifetime '{ ${'\''zarafa-server'\''}{cache_server_lifetime} || '\''30'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg imap_generate_utf8 '{ ${'\''zarafa-imap'\''}{imap_generate_utf8} || '\''no'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg quota_warn '{ ${'\''zarafa-server'\''}{quota_warn} || '\''0'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg imap_expunge_on_delete '{ ${'\''zarafa-imap'\''}{imap_expunge_on_delete} || '\''no'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg quota_soft '{ ${'\''zarafa-server'\''}{quota_soft} || '\''0'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg imap_store_rfc822 '{ ${'\''zarafa-imap'\''}{imap_store_rfc822} || '\''yes'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg quota_hard '{ ${'\''zarafa-server'\''}{quota_hard} || '\''0'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg ssl_private_key_file '/home/e-smith/ssl.key/{$SystemName}.{$DomainName}.key'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg companyquota_warn '{ ${'\''zarafa-server'\''}{companyquota_warn} || '\''0'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg ssl_certificate_file '/home/e-smith/ssl.crt/{$SystemName}.{$DomainName}.crt'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg user_plugin '{ ${'\''zarafa-server'\''}{user_plugin} || '\''db'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg ssl_verify_client '{ ${'\''zarafa-gateway'\''}{ssl_verify_client} || '\''no'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg user_plugin_config '{ ${'\''zarafa-server'\''}{user_plugin_config}; }'
+
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg process_model '{ ${'\''zarafa-gateway'\''}{process_model} || '\''fork'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg user_safe_mode '{ ${'\''zarafa-server'\''}{user_safe_mode} || '\''no'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg log_method '{ ${'\''zarafa-gateway'\''}{log_method} || '\''file'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg thread_stacksize '{ ${'\''zarafa-server'\''}{thread_stacksize} || '\''512'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg log_level '{ ${'\''zarafa-gateway'\''}{log_level} || '\''2'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg enable_hosted_zarafa '{ ${'\''zarafa-server'\''}{enable_hosted_zarafa} || '\''false'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg log_timestamp '{ ${'\''zarafa-gateway'\''}{log_timestamp} || '\''1'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg enable_distributed_zarafa '{ ${'\''zarafa-server'\''}{enable_distributed_zarafa} || '\''false'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg ssl_enable_v2 '{ ${'\''zarafa-gateway'\''}{ssl_enable_v2} || '\''no'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg storename_format '{ ${'\''zarafa-server'\''}{storename_format} || '\''%f'\''; }'
+
 
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg loginname_format '{ ${'\''zarafa-server'\''}{loginname_format} || '\''%u'\''; }'
+
 
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg client_update_enabled '{ ${'\''zarafa-server'\''}{client_update_enabled} || '\''false'\''; }'
+
#
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg client_update_path '{ ${'\''zarafa-server'\''}{client_update_path} || '\''/var/lib/zarafa/client'\''; }'
+
#--- ical config ---
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg client_update_log_level '{ ${'\''zarafa-server'\''}{client_update_log_level} || '\''1'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg hide_everyone '{ ${'\''zarafa-server'\''}{hide_everyone} || '\''yes'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg hide_system '{ ${'\''zarafa-server'\''}{hide_system} || '\''yes'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg index_services_enabled '{ ${'\''zarafa-server'\''}{index_services_enabled} || '\''no'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg index_services_search_timeout '{ ${'\''zarafa-server'\''}{index_services_search_timeout} || '\''10'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg index_services_prefix_chars '{ ${'\''zarafa-server'\''}{index_services_prefix_chars} || '\''3'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg enable_enhanced_ics '{ ${'\''zarafa-server'\''}{enable_enhanced_ics} || '\''yes'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg sync_gab_realtime '{ ${'\''zarafa-server'\''}{sync_gab_realtime} || '\''yes'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg disabled_features '{ ${'\''zarafa-server'\''}{disabled_features}; }'
 
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg max_deferred_records '{ ${'\''zarafa-server'\''}{max_deferred_records} || '\''0'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg max_deferred_records_folder '{ ${'\''zarafa-server'\''}{max_deferred_records_folder} || '\''20'\''; }'
 
 
 
 
 
#
 
#--- dagent config ---
 
 
#
 
#
 
echo
 
echo
echo "Creating zarafa-dagent-configuration-template ..."
+
echo "Creating zarafa-ical-configuration-template ..."
 
echo
 
echo
mkdir -p /etc/e-smith/templates/etc/zarafa/dagent.cfg
+
mkdir -p /etc/e-smith/templates/etc/zarafa/ical.cfg
cat /usr/share/doc/zarafa-dagent/example-config/dagent.cfg | sed -e 's/\r$//g' >  /etc/e-smith/templates/etc/zarafa/dagent.cfg/dagent.cfg
+
cat /usr/share/doc/zarafa-ical/example-config/ical.cfg | sed -e 's/\r$//g' >  /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg
replace /etc/e-smith/templates/etc/zarafa/dagent.cfg/dagent.cfg log_method '{ ${'\''zarafa-dagent'\''}{log_method} || '\''file'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg ical_enable '{ if (${'\''zarafa-ical'\''}{status} eq '\''enabled'\'') {'\''yes'\''} else {'\''no'\''}; }'
replace /etc/e-smith/templates/etc/zarafa/dagent.cfg/dagent.cfg log_level '{ ${'\''zarafa-dagent'\''}{log_level} || '\''2'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg ical_port '{ ${'\''zarafa-ical'\''}{TCPPort} || '\''8088'\''; }'
replace /etc/e-smith/templates/etc/zarafa/dagent.cfg/dagent.cfg log_timestamp '{ ${'\''zarafa-dagent'\''}{log_timestamp} || '\''1'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg icals_enable '{ if (${'\''zarafa-icals'\''}{status} eq '\''enabled'\'') {'\''yes'\''} else {'\''no'\''}; }'
replace /etc/e-smith/templates/etc/zarafa/dagent.cfg/dagent.cfg log_raw_message '{ ${'\''zarafa-dagent'\''}{log_raw_message} || '\''no'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg icals_port '{ ${'\''zarafa-icals'\''}{TCPPort} || '\''8089'\''; }'
replace /etc/e-smith/templates/etc/zarafa/dagent.cfg/dagent.cfg lmtp_port '{ ${'\''zarafa-dagent'\''}{lmtp_port} || '\''2003'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg server_socket 'http://localhost:{${'\''zarafa-server'\''}{TCPPort}||'\''236'\'';}/zarafa'
replace /etc/e-smith/templates/etc/zarafa/dagent.cfg/dagent.cfg lmtp_max_threads '{ ${'\''zarafa-dagent'\''}{lmtp_max_threads} || '\''20'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg process_model '{ ${'\''zarafa-ical'\''}{process_model} || '\''fork'\''; }'
replace /etc/e-smith/templates/etc/zarafa/dagent.cfg/dagent.cfg process_model '{ ${'\''zarafa-dagent'\''}{process_model} || '\''fork'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg log_method '{ ${'\''zarafa-ical'\''}{log_method} || '\''file'\''; }'
replace /etc/e-smith/templates/etc/zarafa/dagent.cfg/dagent.cfg spam_header_name '{ ${'\''zarafa-dagent'\''}{spam_header_name} || '\''X-Spam-Status'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg log_level '{ ${'\''zarafa-ical'\''}{log_level} || '\''2'\''; }'
replace /etc/e-smith/templates/etc/zarafa/dagent.cfg/dagent.cfg spam_header_value '{ ${'\''zarafa-dagent'\''}{spam_header_value} || '\''Yes'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg log_timestamp '{ ${'\''zarafa-ical'\''}{log_timestamp} || '\''1'\''; }'
replace /etc/e-smith/templates/etc/zarafa/dagent.cfg/dagent.cfg archive_on_delivery '{ ${'\''zarafa-dagent'\''}{archive_on_delivery} || '\''no'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg ssl_private_key_file '/home/e-smith/ssl.key/{$SystemName}.{$DomainName}.key'
replace /etc/e-smith/templates/etc/zarafa/dagent.cfg/dagent.cfg set_rule_headers '{ ${'\''zarafa-dagent'\''}{set_rule_headers} || '\''yes'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg ssl_certificate_file '/home/e-smith/ssl.crt/{$SystemName}.{$DomainName}.crt'
 +
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg ssl_verify_client '{ ${'\''zarafa-ical'\''}{ssl_verify_client} || '\''no'\''; }'
 +
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg server_timezone '{$TimeZone}'
 +
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg default_charset '{ ${'\''zarafa-ical'\''}{default_charset} || '\''utf-8'\''; }'
 +
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg enable_ical_get '{ ${'\''zarafa-ical'\''}{enable_ical_get} || '\''yes'\''; }'
 +
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg ssl_enable_v2 '{ ${'\''zarafa-ical'\''}{ssl_enable_v2} || '\''no'\''; }'
  
  
 
#
 
#
#--- spooler config ---
+
#--- search config ---
 
#
 
#
 
echo
 
echo
echo "Creating zarafa-spooler-configuration-template ..."
+
echo "Creating zarafa-search-configuration-template ..."
 
echo
 
echo
mkdir -p /etc/e-smith/templates/etc/zarafa/spooler.cfg
+
mkdir -p /etc/e-smith/templates/etc/zarafa/search.cfg
cat /usr/share/doc/zarafa-spooler/example-config/spooler.cfg | sed -e 's/\r$//g' >  /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg
+
cat /usr/share/doc/zarafa-search/example-config/search.cfg | sed -e 's/\r$//g' >  /etc/e-smith/templates/etc/zarafa/search.cfg/search.cfg
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg smtp_port '{ ${'\''zarafa-spooler'\''}{smtp_port} || '\''25'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/search.cfg/search.cfg coredump_enabled '{ ${'\''zarafa-search'\''}{coredump_enabled} || '\''no'\''; }'
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg log_method '{ ${'\''zarafa-spooler'\''}{log_method} || '\''file'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/search.cfg/search.cfg limit_results '{ ${'\''zarafa-search'\''}{limit_results} || '\''0'\''; }'
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg log_level '{ ${'\''zarafa-spooler'\''}{log_level} || '\''3'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/search.cfg/search.cfg log_method '{ ${'\''zarafa-search'\''}{log_method} || '\''file'\''; }'
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg log_timestamp '{ ${'\''zarafa-spooler'\''}{log_timestamp} || '\''1'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/search.cfg/search.cfg log_level '{ ${'\''zarafa-search'\''}{log_level} || '\''2'\''; }'
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg max_threads '{ ${'\''zarafa-spooler'\''}{max_threads} || '\''5'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/search.cfg/search.cfg log_timestamp '{ ${'\''zarafa-search'\''}{log_timestamp} || '\''1'\''; }'
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg fax_domain '{ ${'\''zarafa-spooler'\''}{fax_domain} || '\''fax.local'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/search.cfg/search.cfg term_cache_size '{ ${'\''zarafa-search'\''}{term_cache_size} || '\''64M'\''; }'
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg fax_international '{ ${'\''zarafa-spooler'\''}{fax_international} || '\''00'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/search.cfg/search.cfg optimize_start '{ ${'\''zarafa-search'\''}{optimize_start} || '\''2'\''; }'
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg always_send_delegates '{ ${'\''zarafa-spooler'\''}{always_send_delegates} || '\''no'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/search.cfg/search.cfg optimize_stop '{ ${'\''zarafa-search'\''}{optimize_stop} || '\''5'\''; }'
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg allow_redirect_spoofing '{ ${'\''zarafa-spooler'\''}{allow_redirect_spoofing} || '\''yes'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/search.cfg/search.cfg optimize_age '{ ${'\''zarafa-search'\''}{optimize_age} || '\''7'\''; }'
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg copy_delegate_mails '{ ${'\''zarafa-spooler'\''}{copy_delegate_mails} || '\''yes'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/search.cfg/search.cfg index_attachments '{ ${'\''zarafa-search'\''}{index_attachments} || '\''no'\''; }'
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg allow_delegate_meeting_request '{ ${'\''zarafa-spooler'\''}{allow_delegate_meeting_request} || '\''yes'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/search.cfg/search.cfg index_attachment_max_size '{ ${'\''zarafa-search'\''}{index_attachment_max_size} || '\''5M'\''; }'
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg allow_send_to_everyone '{ ${'\''zarafa-spooler'\''}{allow_send_to_everyone} || '\''yes'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/search.cfg/search.cfg index_attachment_parser_max_memory '{ ${'\''zarafa-search'\''}{index_attachment_parser_max_memory} || '\''0'\''; }'
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg always_send_tnef '{ ${'\''zarafa-spooler'\''}{always_send_tnef} || '\''no'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/search.cfg/search.cfg index_attachment_parser_max_cputime '{ ${'\''zarafa-search'\''}{index_attachment_parser_max_cputime} || '\''0'\''; }'
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg always_send_utf8 '{ ${'\''zarafa-spooler'\''}{always_send_utf8} || '\''no'\''; }'
+
 
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg charset_upgrade '{ ${'\''zarafa-spooler'\''}{charset_upgrade} || '\''windows-1252'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg expand_groups '{ ${'\''zarafa-spooler'\''}{expand_groups} || '\''no'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg archive_on_send '{ ${'\''zarafa-spooler'\''}{archive_on_send} || '\''no'\''; }'
 
  
 +
######################################
 +
# Configuring SME-events : Templates to expand
 +
######################################
  
#
+
/bin/echo  
#--- monitor config ---
+
/bin/echo "Configuring SME-events : Templates2expand"
#
+
/bin/echo  
echo
+
mkdir -p /etc/e-smith/events/email-update/templates2expand/etc/zarafa
echo "Creating zarafa-monitor-configuration-template ..."
+
touch /etc/e-smith/events/email-update/templates2expand/etc/zarafa/gateway.cfg
echo "The monitor program sends quota warning mails to users who are over quota."
+
touch /etc/e-smith/events/email-update/templates2expand/etc/zarafa/ical.cfg
echo
+
touch /etc/e-smith/events/email-update/templates2expand/etc/zarafa/server.cfg
mkdir -p /etc/e-smith/templates/etc/zarafa/monitor.cfg
+
touch /etc/e-smith/events/email-update/templates2expand/etc/zarafa/unix.cfg
cat /usr/share/doc/zarafa-monitor/example-config/monitor.cfg | sed -e 's/\r$//g' >  /etc/e-smith/templates/etc/zarafa/monitor.cfg/monitor.cfg
+
touch /etc/e-smith/events/email-update/templates2expand/etc/zarafa/spooler.cfg
replace /etc/e-smith/templates/etc/zarafa/monitor.cfg/monitor.cfg log_method '{ ${'\''zarafa-monitor'\''}{log_method} || '\''file'\''; }'
+
touch /etc/e-smith/events/email-update/templates2expand/etc/zarafa/licensed.cfg
replace /etc/e-smith/templates/etc/zarafa/monitor.cfg/monitor.cfg log_level '{ ${'\''zarafa-monitor'\''}{log_level} || '\''2'\''; }'
+
touch /etc/e-smith/events/email-update/templates2expand/etc/zarafa/monitor.cfg
replace /etc/e-smith/templates/etc/zarafa/monitor.cfg/monitor.cfg log_timestamp '{ ${'\''zarafa-monitor'\''}{log_timestamp} || '\''1'\''; }'
+
touch /etc/e-smith/events/email-update/templates2expand/etc/zarafa/dagent.cfg
replace /etc/e-smith/templates/etc/zarafa/monitor.cfg/monitor.cfg quota_check_interval '{ ${'\''zarafa-monitor'\''}{quota_check_interval} || '\''15'\''; }'
+
 
replace /etc/e-smith/templates/etc/zarafa/monitor.cfg/monitor.cfg mailquota_resend_interval '{ ${'\''zarafa-monitor'\''}{mailquota_resend_interval} || '\''1'\''; }'
+
mkdir -p /etc/e-smith/events/group-create/templates2expand/etc/zarafa
 +
touch /etc/e-smith/events/group-create/templates2expand/etc/zarafa/unix.cfg
  
 +
mkdir -p /etc/e-smith/events/group-delete/templates2expand/etc/zarafa
 +
touch /etc/e-smith/events/group-delete/templates2expand/etc/zarafa/unix.cfg
  
#
+
mkdir -p /etc/e-smith/events/group-modify/templates2expand/etc/zarafa
#--- gateway config ---
+
touch /etc/e-smith/events/group-modify/templates2expand/etc/zarafa/unix.cfg
#
+
 
echo
+
mkdir -p /etc/e-smith/events/user-create/templates2expand/etc/zarafa
echo "Creating zarafa-gateway-configuration-template ..."
+
touch /etc/e-smith/events/user-create/templates2expand/etc/zarafa/unix.cfg
echo
+
 
mkdir -p /etc/e-smith/templates/etc/zarafa/gateway.cfg
+
mkdir -p /etc/e-smith/events/user-delete/templates2expand/etc/zarafa
cat /usr/share/doc/zarafa-gateway/example-config/gateway.cfg | sed -e 's/\r$//g' >  /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg
+
touch /etc/e-smith/events/user-delete/templates2expand/etc/zarafa/unix.cfg
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg server_socket 'http://localhost:{${'\''zarafa-server'\''}{TCPPort}||'\''236'\'';}/zarafa'
+
 
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg pop3_enable '{ if (${'\''zarafa-pop3'\''}{status} eq '\''enabled'\'') {'\''yes'\''} else {'\''no'\''}; }'
+
mkdir -p /etc/e-smith/events/user-modify/templates2expand/etc/zarafa
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg pop3_port '{ ${'\''zarafa-pop3'\''}{TCPPort} || '\''8110'\''; }'
+
touch /etc/e-smith/events/user-modify/templates2expand/etc/zarafa/unix.cfg
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg pop3s_enable '{ if (${'\''zarafa-pop3s'\''}{status} eq '\''enabled'\'') {'\''yes'\''} else {'\''no'\''}; }'
+
 
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg pop3s_port '{ ${'\''zarafa-pop3s'\''}{TCPPort} || '\''8995'\''; }'
+
mkdir -p /etc/e-smith/events/ibay-create/templates2expand/etc/zarafa
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg imap_enable '{ if (${'\''zarafa-imap'\''}{status} eq '\''enabled'\'') {'\''yes'\''} else {'\''no'\''}; }'
+
touch /etc/e-smith/events/ibay-create/templates2expand/etc/zarafa/unix.cfg
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg imap_port '{ ${'\''zarafa-imap'\''}{TCPPort} || '\''8143'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg imaps_enable '{ if (${'\''zarafa-imaps'\''}{status} eq '\''enabled'\'') {'\''yes'\''} else {'\''no'\''}; }'
 
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg imaps_port '{ ${'\''zarafa-imaps'\''}{TCPPort} || '\''8993'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg imap_only_mailfolders '{ ${'\''zarafa-imap'\''}{imap_only_mailfolders} || '\''yes'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg imap_public_folders '{ ${'\''zarafa-imap'\''}{imap_public_folders} || '\''yes'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg imap_capability_idle '{ ${'\''zarafa-imap'\''}{imap_capability_idle} || '\''yes'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg imap_max_messagesize '{ ${'\''zarafa-imap'\''}{imap_max_messagesize} || '\''134217728'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg imap_generate_utf8 '{ ${'\''zarafa-imap'\''}{imap_generate_utf8} || '\''no'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg imap_expunge_on_delete '{ ${'\''zarafa-imap'\''}{imap_expunge_on_delete} || '\''no'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg imap_store_rfc822 '{ ${'\''zarafa-imap'\''}{imap_store_rfc822} || '\''yes'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg ssl_private_key_file '/home/e-smith/ssl.key/{$SystemName}.{$DomainName}.key'
 
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg ssl_certificate_file '/home/e-smith/ssl.crt/{$SystemName}.{$DomainName}.crt'
 
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg ssl_verify_client '{ ${'\''zarafa-gateway'\''}{ssl_verify_client} || '\''no'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg process_model '{ ${'\''zarafa-gateway'\''}{process_model} || '\''fork'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg log_method '{ ${'\''zarafa-gateway'\''}{log_method} || '\''file'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg log_level '{ ${'\''zarafa-gateway'\''}{log_level} || '\''2'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg log_timestamp '{ ${'\''zarafa-gateway'\''}{log_timestamp} || '\''1'\''; }'
 
  
 +
mkdir -p /etc/e-smith/events/machine-account-create/templates2expand/etc/zarafa
 +
touch /etc/e-smith/events/machine-account-create/templates2expand/etc/zarafa/unix.cfg
  
#
+
mkdir -p /etc/e-smith/events/post-upgrade/templates2expand/etc/zarafa
#--- ical config ---
+
touch /etc/e-smith/events/post-upgrade/templates2expand/etc/e-smith/sql/init/80zarafa
#
+
touch /etc/e-smith/events/post-upgrade/templates2expand/etc/zarafa/gateway.cfg
echo
+
touch /etc/e-smith/events/post-upgrade/templates2expand/etc/zarafa/ical.cfg
echo "Creating zarafa-ical-configuration-template ..."
+
touch /etc/e-smith/events/post-upgrade/templates2expand/etc/zarafa/server.cfg
echo
+
touch /etc/e-smith/events/post-upgrade/templates2expand/etc/zarafa/unix.cfg
mkdir -p /etc/e-smith/templates/etc/zarafa/ical.cfg
+
touch /etc/e-smith/events/post-upgrade/templates2expand/etc/zarafa/spooler.cfg
cat /usr/share/doc/zarafa-ical/example-config/ical.cfg | sed -e 's/\r$//g' >  /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg
+
touch /etc/e-smith/events/post-upgrade/templates2expand/etc/zarafa/licensed.cfg
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg ical_enable '{ if (${'\''zarafa-ical'\''}{status} eq '\''enabled'\'') {'\''yes'\''} else {'\''no'\''}; }'
+
touch /etc/e-smith/events/post-upgrade/templates2expand/etc/zarafa/monitor.cfg
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg ical_port '{ ${'\''zarafa-ical'\''}{TCPPort} || '\''8088'\''; }'
+
touch /etc/e-smith/events/post-upgrade/templates2expand/etc/zarafa/dagent.cfg
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg icals_enable '{ if (${'\''zarafa-icals'\''}{status} eq '\''enabled'\'') {'\''yes'\''} else {'\''no'\''}; }'
 
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg icals_port '{ ${'\''zarafa-icals'\''}{TCPPort} || '\''8089'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg server_socket 'http://localhost:{${'\''zarafa-server'\''}{TCPPort}||'\''236'\'';}/zarafa'
 
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg process_model '{ ${'\''zarafa-ical'\''}{process_model} || '\''fork'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg log_method '{ ${'\''zarafa-ical'\''}{log_method} || '\''file'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg log_level '{ ${'\''zarafa-ical'\''}{log_level} || '\''2'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg log_timestamp '{ ${'\''zarafa-ical'\''}{log_timestamp} || '\''1'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg ssl_private_key_file '/home/e-smith/ssl.key/{$SystemName}.{$DomainName}.key'
 
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg ssl_certificate_file '/home/e-smith/ssl.crt/{$SystemName}.{$DomainName}.crt'
 
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg ssl_verify_client '{ ${'\''zarafa-ical'\''}{ssl_verify_client} || '\''no'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg server_timezone '{$TimeZone}'
 
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg default_charset '{ ${'\''zarafa-ical'\''}{default_charset} || '\''utf-8'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg enable_ical_get '{ ${'\''zarafa-ical'\''}{enable_ical_get} || '\''yes'\''; }'
 
  
  
#
+
######################################
#--- indexer config ---
+
# Configuring SME-events : Services to adjust
#
+
######################################
echo
+
 
echo "Creating zarafa-indexer-configuration-template ..."
+
/bin/echo  
echo
+
/bin/echo "Configuring SME-events : Services2adjust"
mkdir -p /etc/e-smith/templates/etc/zarafa/indexer.cfg
+
/bin/echo  
cat /usr/share/doc/zarafa-indexer/example-config/indexer.cfg | sed -e 's/\r$//g' >  /etc/e-smith/templates/etc/zarafa/indexer.cfg/indexer.cfg
+
mkdir -p /etc/e-smith/events/machine-account-create/services2adjust
replace /etc/e-smith/templates/etc/zarafa/indexer.cfg/indexer.cfg cleanup_lockfiles '{ ${'\''zarafa-indexer'\''}{cleanup_lockfiles} || '\''no'\''; }'
+
ln -s reload /etc/e-smith/events/group-create/services2adjust/zarafa-server
replace /etc/e-smith/templates/etc/zarafa/indexer.cfg/indexer.cfg limit_results '{ ${'\''zarafa-indexer'\''}{limit_results} || '\''0'\''; }'
+
ln -s reload /etc/e-smith/events/group-delete/services2adjust/zarafa-server
replace /etc/e-smith/templates/etc/zarafa/indexer.cfg/indexer.cfg log_method '{ ${'\''zarafa-indexer'\''}{log_method} || '\''file'\''; }'
+
ln -s reload /etc/e-smith/events/group-modify/services2adjust/zarafa-server
replace /etc/e-smith/templates/etc/zarafa/indexer.cfg/indexer.cfg log_level '{ ${'\''zarafa-indexer'\''}{log_level} || '\''2'\''; }'
+
ln -s reload /etc/e-smith/events/user-create/services2adjust/zarafa-server
replace /etc/e-smith/templates/etc/zarafa/indexer.cfg/indexer.cfg log_timestamp '{ ${'\''zarafa-indexer'\''}{log_timestamp} || '\''1'\''; }'
+
ln -s reload /etc/e-smith/events/user-delete/services2adjust/zarafa-server
replace /etc/e-smith/templates/etc/zarafa/indexer.cfg/indexer.cfg index_interval '{ ${'\''zarafa-indexer'\''}{index_interval} || '\''5'\''; }'
+
ln -s reload /etc/e-smith/events/user-modify/services2adjust/zarafa-server
replace /etc/e-smith/templates/etc/zarafa/indexer.cfg/indexer.cfg index_threads '{ ${'\''zarafa-indexer'\''}{index_threads} || '\''1'\''; }'
+
ln -s reload /etc/e-smith/events/ibay-create/services2adjust/zarafa-server
replace /etc/e-smith/templates/etc/zarafa/indexer.cfg/indexer.cfg index_max_field_length '{ ${'\''zarafa-indexer'\''}{index_max_field_length} || '\''10000'\''; }'
+
ln -s reload /etc/e-smith/events/machine-account-create/services2adjust/zarafa-server
replace /etc/e-smith/templates/etc/zarafa/indexer.cfg/indexer.cfg index_merge_factor '{ ${'\''zarafa-indexer'\''}{index_merge_factor} || '\''10'\''; }'
+
ln -s reload /etc/e-smith/events/timezone-update/services2adjust/zarafa-server
replace /etc/e-smith/templates/etc/zarafa/indexer.cfg/indexer.cfg index_max_buffered_docs '{ ${'\''zarafa-indexer'\''}{index_max_buffered_docs} || '\''10'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/indexer.cfg/indexer.cfg index_min_merge_docs '{ ${'\''zarafa-indexer'\''}{index_min_merge_docs} || '\''10'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/indexer.cfg/indexer.cfg index_max_merge_docs '{ ${'\''zarafa-indexer'\''}{index_max_merge_docs} || '\''2147483647'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/indexer.cfg/indexer.cfg index_term_interval '{ ${'\''zarafa-indexer'\''}{index_term_interval} || '\''128'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/indexer.cfg/indexer.cfg index_cache_timeout '{ ${'\''zarafa-indexer'\''}{index_cache_timeout} || '\''0'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/indexer.cfg/indexer.cfg index_attachments '{ ${'\''zarafa-indexer'\''}{index_attachments} || '\''no'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/indexer.cfg/indexer.cfg index_attachment_max_size '{ ${'\''zarafa-indexer'\''}{index_attachment_max_size} || '\''5120'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/indexer.cfg/indexer.cfg index_attachment_parser_max_memory '{ ${'\''zarafa-indexer'\''}{index_attachment_parser_max_memory} || '\''0'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/indexer.cfg/indexer.cfg index_attachment_parser_max_cputime '{ ${'\''zarafa-indexer'\''}{index_attachment_parser_max_cputime} || '\''0'\''; }'
 
  
  
 
######################################
 
######################################
# Configuring SME-events : Templates to expand
+
# Setting up SME-db-entries
 
######################################
 
######################################
  
 
/bin/echo  
 
/bin/echo  
/bin/echo "Configuring SME-events : Templates2expand"
+
/bin/echo "Enter the language of your choice for your zarafa-mailboxes and public store(s)."
 +
/bin/echo "Values: en_US.UTF-8, en_GB.UTF-8, nl_NL.UTF-8, fr_FR.UTF-8, de_DE.UTF-8, ..."
 
/bin/echo  
 
/bin/echo  
mkdir -p /etc/e-smith/events/email-update/templates2expand/etc/zarafa
+
read ZARAFALANGUAGE
touch /etc/e-smith/events/email-update/templates2expand/etc/zarafa/gateway.cfg
+
/sbin/e-smith/config set zarafa service status enabled language $ZARAFALANGUAGE
touch /etc/e-smith/events/email-update/templates2expand/etc/zarafa/ical.cfg
+
/sbin/e-smith/expand-template /etc/sysconfig/zarafa
touch /etc/e-smith/events/email-update/templates2expand/etc/zarafa/server.cfg
 
touch /etc/e-smith/events/email-update/templates2expand/etc/zarafa/unix.cfg
 
touch /etc/e-smith/events/email-update/templates2expand/etc/zarafa/spooler.cfg
 
touch /etc/e-smith/events/email-update/templates2expand/etc/zarafa/licensed.cfg
 
touch /etc/e-smith/events/email-update/templates2expand/etc/zarafa/monitor.cfg
 
touch /etc/e-smith/events/email-update/templates2expand/etc/zarafa/dagent.cfg
 
  
mkdir -p /etc/e-smith/events/group-create/templates2expand/etc/zarafa
+
/bin/echo
touch /etc/e-smith/events/group-create/templates2expand/etc/zarafa/unix.cfg
+
/bin/echo "Initialize-default-databases"
 +
/bin/echo
 +
/etc/e-smith/events/actions/initialize-default-databases
  
mkdir -p /etc/e-smith/events/group-delete/templates2expand/etc/zarafa
+
/bin/echo
touch /etc/e-smith/events/group-delete/templates2expand/etc/zarafa/unix.cfg
+
/bin/echo "Setting up db-entries for Zarafa"
 +
/bin/echo
 +
/sbin/e-smith/db configuration setprop mysqld InnoDB enabled
 +
/sbin/e-smith/db configuration setprop smtpd tnef2mime disabled
 +
/sbin/e-smith/db configuration setprop zarafa-server access private status enabled TCPPort 236 search_enabled yes
 +
/bin/echo
 +
/bin/echo "Enter your user plugin."
 +
/bin/echo "Values: unix or db (ldap is not supported, multicompany-support only with db-plugin)."
 +
/bin/echo
 +
read USERPLUGIN
 +
/sbin/e-smith/db configuration setprop zarafa-server user_plugin $USERPLUGIN
  
mkdir -p /etc/e-smith/events/group-modify/templates2expand/etc/zarafa
+
if [ "$USERPLUGIN" == unix ]; then
touch /etc/e-smith/events/group-modify/templates2expand/etc/zarafa/unix.cfg
+
/sbin/e-smith/db configuration setprop zarafa-server user_plugin_config /etc/zarafa/unix.cfg
 +
fi
  
mkdir -p /etc/e-smith/events/user-create/templates2expand/etc/zarafa
+
if [ "$USERPLUGIN" == db ]; then
touch /etc/e-smith/events/user-create/templates2expand/etc/zarafa/unix.cfg
+
/bin/echo
 +
/bin/echo "Do you want to set up a multicompany-environment ?"
 +
/bin/echo "Values: yes or no."
 +
/bin/echo
 +
read MULTICOMPANY
 +
/sbin/e-smith/db configuration setprop zarafa-server Multicompany $MULTICOMPANY
 +
/sbin/e-smith/db configuration delprop zarafa-server user_plugin_config
 +
if [ "$MULTICOMPANY" == yes ]; then
 +
/sbin/e-smith/db configuration setprop zarafa-server enable_hosted_zarafa true
 +
/sbin/e-smith/db configuration setprop zarafa-server loginname_format %u.%c
 +
else
 +
/sbin/e-smith/db configuration setprop zarafa-server enable_hosted_zarafa false
 +
/sbin/e-smith/db configuration setprop zarafa-server loginname_format %u
 +
fi
 +
fi
  
mkdir -p /etc/e-smith/events/user-delete/templates2expand/etc/zarafa
+
/sbin/e-smith/db configuration setprop zarafa access SSL
touch /etc/e-smith/events/user-delete/templates2expand/etc/zarafa/unix.cfg
+
/sbin/e-smith/db configuration set zarafa-ical service access private status enabled TCPPort 8088
 +
/sbin/e-smith/db configuration set zarafa-icals service access public status enabled TCPPort 8089
 +
/sbin/e-smith/db configuration set zarafa-imap service access private status enabled TCPPort 8143
 +
/sbin/e-smith/db configuration set zarafa-imaps service access public status enabled TCPPort 8993
 +
/sbin/e-smith/db configuration set zarafa-pop3 service access private status enabled TCPPort 8110
 +
/sbin/e-smith/db configuration set zarafa-pop3s service access public status enabled TCPPort 8995
 +
/sbin/e-smith/db configuration set zarafa-ssl service access public status enabled TCPPort 237
 +
/sbin/e-smith/db configuration set zarafa-gateway service status enabled
 +
/sbin/e-smith/db configuration set zarafa-spooler service status enabled
 +
/sbin/e-smith/db configuration set zarafa-monitor service status enabled
 +
/sbin/e-smith/db configuration set zarafa-search service status enabled
 +
/sbin/e-smith/db configuration set zarafa-licensed service status enabled
 +
/sbin/e-smith/db configuration set zarafa-dagent service status enabled
  
mkdir -p /etc/e-smith/events/user-modify/templates2expand/etc/zarafa
 
touch /etc/e-smith/events/user-modify/templates2expand/etc/zarafa/unix.cfg
 
  
mkdir -p /etc/e-smith/events/ibay-create/templates2expand/etc/zarafa
+
######################################
touch /etc/e-smith/events/ibay-create/templates2expand/etc/zarafa/unix.cfg
+
# Setting up the Zarafa-db
 +
######################################
  
mkdir -p /etc/e-smith/events/machine-account-create/templates2expand/etc/zarafa
+
/bin/echo
touch /etc/e-smith/events/machine-account-create/templates2expand/etc/zarafa/unix.cfg
+
/bin/echo "Expanding the my.cnf-template"
 +
/bin/echo
 +
/sbin/e-smith/expand-template /etc/my.cnf
  
mkdir -p /etc/e-smith/events/post-upgrade/templates2expand/etc/zarafa
+
/bin/echo
touch /etc/e-smith/events/post-upgrade/templates2expand/etc/e-smith/sql/init/80zarafa
+
/bin/echo "Restarting mysqld"
touch /etc/e-smith/events/post-upgrade/templates2expand/etc/zarafa/gateway.cfg
+
/bin/echo
touch /etc/e-smith/events/post-upgrade/templates2expand/etc/zarafa/ical.cfg
+
/usr/bin/sv t /service/mysqld
touch /etc/e-smith/events/post-upgrade/templates2expand/etc/zarafa/server.cfg
+
 
touch /etc/e-smith/events/post-upgrade/templates2expand/etc/zarafa/unix.cfg
+
/bin/echo
touch /etc/e-smith/events/post-upgrade/templates2expand/etc/zarafa/spooler.cfg
+
/bin/echo "Signal-event remoteaccess-update"
touch /etc/e-smith/events/post-upgrade/templates2expand/etc/zarafa/licensed.cfg
+
/bin/echo
touch /etc/e-smith/events/post-upgrade/templates2expand/etc/zarafa/monitor.cfg
+
/sbin/e-smith/signal-event remoteaccess-update
touch /etc/e-smith/events/post-upgrade/templates2expand/etc/zarafa/dagent.cfg
+
 
 +
/bin/echo
 +
/bin/echo "Creating the Zarafa-database"
 +
/bin/echo
 +
/sbin/e-smith/expand-template /etc/e-smith/sql/init/80zarafa
 +
/etc/rc.d/init.d/mysql.init start
  
  
 
######################################
 
######################################
# Configuring SME-events : Services to adjust
+
# Expanding the Zarafa-configuration-templates
 
######################################
 
######################################
  
/bin/echo  
+
/bin/echo
/bin/echo "Configuring SME-events : Services2adjust"
+
/bin/echo "Expanding the Zarafa-configuration-templates"
/bin/echo  
+
/bin/echo
mkdir -p /etc/e-smith/events/machine-account-create/services2adjust
+
/etc/e-smith/events/actions/zarafa-expand-templates
ln -s reload /etc/e-smith/events/group-create/services2adjust/zarafa-server
 
ln -s reload /etc/e-smith/events/group-delete/services2adjust/zarafa-server
 
ln -s reload /etc/e-smith/events/group-modify/services2adjust/zarafa-server
 
ln -s reload /etc/e-smith/events/user-create/services2adjust/zarafa-server
 
ln -s reload /etc/e-smith/events/user-delete/services2adjust/zarafa-server
 
ln -s reload /etc/e-smith/events/user-modify/services2adjust/zarafa-server
 
ln -s reload /etc/e-smith/events/ibay-create/services2adjust/zarafa-server
 
ln -s reload /etc/e-smith/events/machine-account-create/services2adjust/zarafa-server
 
ln -s reload /etc/e-smith/events/timezone-update/services2adjust/zarafa-server
 
  
  
 
######################################
 
######################################
# Setting up SME-db-entries
+
# Configuration of the Webaccess
 
######################################
 
######################################
  
/bin/echo  
+
/bin/echo
/bin/echo "Enter the language of your choice for your zarafa-mailboxes and public store(s)."
+
/bin/echo "Configuration of the Webaccess"
/bin/echo "Values: en_US.UTF-8, en_GB.UTF-8, nl_NL.UTF-8, fr_FR.UTF-8, de_DE.UTF-8, ..."
+
/bin/echo
/bin/echo
+
/bin/chown -R www:www /var/lib/zarafa-webaccess/tmp
read ZARAFALANGUAGE
+
/bin/chown -R www:www /var/lib/zarafa-webapp/tmp
/sbin/e-smith/config set zarafa service status enabled language $ZARAFALANGUAGE
+
FILE=/etc/httpd/conf.d/zarafa-webaccess.conf; if [ -a $FILE ]; then /bin/rm -f $FILE; fi
/sbin/e-smith/expand-template /etc/sysconfig/zarafa
+
FILE=/etc/httpd/conf.d/zarafa-webapp.conf; if [ -a $FILE ]; then /bin/rm -f $FILE; fi
  
/bin/echo  
+
/bin/echo
/bin/echo "Initialize-default-databases"
+
/bin/echo "Expanding http.conf-template"
/bin/echo  
+
/bin/echo
/etc/e-smith/events/actions/initialize-default-databases
+
/sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf
  
/bin/echo  
+
/bin/echo
/bin/echo "Setting up db-entries for Zarafa"
+
/bin/echo "Restarting httpd"
/bin/echo  
+
/bin/echo
/sbin/e-smith/db configuration setprop mysqld InnoDB enabled
+
/usr/bin/sv restart /service/httpd-e-smith
/sbin/e-smith/db configuration setprop smtpd tnef2mime disabled
 
/sbin/e-smith/db configuration setprop zarafa-server access private status enabled TCPPort 236 index_services_enabled yes
 
/bin/echo
 
/bin/echo "Enter your user plugin."
 
/bin/echo "Values: unix or db (ldap is not supported, multicompany-support only with db-plugin)."
 
/bin/echo
 
read USERPLUGIN
 
/sbin/e-smith/db configuration setprop zarafa-server user_plugin $USERPLUGIN
 
  
if [ "$USERPLUGIN" == unix ]; then
 
/sbin/e-smith/db configuration setprop zarafa-server user_plugin_config /etc/zarafa/unix.cfg
 
fi
 
  
if [ "$USERPLUGIN" == db ]; then
+
######################################
 +
# Setting up more symbolic links
 +
######################################
 +
 
 
/bin/echo
 
/bin/echo
/bin/echo "Do you want to set up a multicompany-environment ?"
+
/bin/echo "Setting up more symbolic links"
/bin/echo "Values: yes or no."
 
 
/bin/echo
 
/bin/echo
read MULTICOMPANY
+
if [ `getconf LONG_BIT` = "64" ]; then
/sbin/e-smith/db configuration setprop zarafa-server Multicompany $MULTICOMPANY
+
ln -s /usr/lib64/zarafa /usr/lib/zarafa
/sbin/e-smith/db configuration delprop zarafa-server user_plugin_config
+
ln -s /lib64/libcrypto.so.0.9.8e /usr/lib/libcrypto.so.0.9.8
if [ "$MULTICOMPANY" == yes ]; then
+
ln -s /lib64/libssl.so.0.9.8e /usr/lib/libssl.so.0.9.8
/sbin/e-smith/db configuration setprop zarafa-server enable_hosted_zarafa true
 
/sbin/e-smith/db configuration setprop zarafa-server loginname_format %u.%c
 
 
else
 
else
/sbin/e-smith/db configuration setprop zarafa-server enable_hosted_zarafa false
+
ln -s /lib/libcrypto.so.0.9.8e /usr/lib/libcrypto.so.0.9.8
/sbin/e-smith/db configuration setprop zarafa-server loginname_format %u
+
ln -s /lib/libssl.so.0.9.8e /usr/lib/libssl.so.0.9.8
fi
 
 
fi
 
fi
 +
ln -s /etc/rc.d/init.d/e-smith-service /etc/rc.d/rc7.d/S99zarafa-dagent
 +
ln -s /etc/rc.d/init.d/e-smith-service /etc/rc.d/rc7.d/S99zarafa-gateway
 +
ln -s /etc/rc.d/init.d/e-smith-service /etc/rc.d/rc7.d/S99zarafa-search
 +
ln -s /etc/rc.d/init.d/e-smith-service /etc/rc.d/rc7.d/S99zarafa-licensed
 +
ln -s /etc/rc.d/init.d/e-smith-service /etc/rc.d/rc7.d/S99zarafa-monitor
 +
ln -s /etc/rc.d/init.d/e-smith-service /etc/rc.d/rc7.d/S99zarafa-spooler
 +
ln -s /etc/rc.d/init.d/e-smith-service /etc/rc.d/rc7.d/S99zarafa-ical
 +
ln -s /etc/rc.d/init.d/e-smith-service /etc/rc.d/rc7.d/S99zarafa-server
 +
  
/sbin/e-smith/db configuration setprop zarafa access SSL
+
#######################################
/sbin/e-smith/db configuration set zarafa-ical service access private status enabled TCPPort 8088
+
# Installing a license-key
/sbin/e-smith/db configuration set zarafa-icals service access public status enabled TCPPort 8089
+
#######################################
/sbin/e-smith/db configuration set zarafa-imap service access private status enabled TCPPort 8143
 
/sbin/e-smith/db configuration set zarafa-imaps service access public status enabled TCPPort 8993
 
/sbin/e-smith/db configuration set zarafa-pop3 service access private status enabled TCPPort 8110
 
/sbin/e-smith/db configuration set zarafa-pop3s service access public status enabled TCPPort 8995
 
/sbin/e-smith/db configuration set zarafa-ssl service access public status enabled TCPPort 237
 
/sbin/e-smith/db configuration set zarafa-gateway service status enabled
 
/sbin/e-smith/db configuration set zarafa-spooler service status enabled
 
/sbin/e-smith/db configuration set zarafa-monitor service status enabled
 
/sbin/e-smith/db configuration set zarafa-indexer service status enabled
 
/sbin/e-smith/db configuration set zarafa-licensed service status enabled
 
/sbin/e-smith/db configuration set zarafa-dagent service status enabled
 
  
 +
/bin/echo
 +
/bin/echo "Installing a license-key"
 +
/bin/echo
 +
if [ -x /usr/bin/zarafa-licensed ]; then
 +
if [ ! -f /etc/zarafa/license/base ]; then
 +
mkdir -p /etc/zarafa/license
 +
SERIAL="0"
 +
while [ ${#SERIAL} -ne 25 -a ${#SERIAL} -ne 0 ]; do
 +
if [ -n "$SERIAL" ]; then
 +
echo "Serial number must be 25 characters or empty"
 +
fi
 +
echo -ne "Server serial number (leave empty for none) []\t\t: "
 +
read SERIAL
 +
done
 +
SERIAL=`echo $SERIAL | tr [a-z] [A-Z]`
 +
echo $SERIAL > /etc/zarafa/license/base
 +
echo
 +
echo "The correctness of the serial will be checked when the Zarafa-server starts."
 +
echo
 +
fi
 +
fi
  
######################################
 
# Setting up the Zarafa-db
 
######################################
 
 
/bin/echo
 
/bin/echo "Expanding the my.cnf-template"
 
/bin/echo
 
/sbin/e-smith/expand-template /etc/my.cnf
 
 
/bin/echo
 
/bin/echo "Restarting mysqld"
 
/bin/echo
 
/usr/bin/sv t /service/mysqld
 
  
/bin/echo
+
#######################################
/bin/echo "Signal-event remoteaccess-update"
+
# Starting Zarafa
/bin/echo
+
#######################################
/sbin/e-smith/signal-event remoteaccess-update
+
 
 +
/bin/echo  
 +
/bin/echo "Starting Zarafa-services"
 +
/bin/echo  
 +
/etc/e-smith/events/actions/zarafa-services start
  
 
/bin/echo
 
/bin/echo
/bin/echo "Creating the Zarafa-database"
+
/bin/echo "Setting permissions on files"
 
/bin/echo
 
/bin/echo
/sbin/e-smith/expand-template /etc/e-smith/sql/init/80zarafa
+
FILE=/var/log/zarafa/dagent.log; if [ -a $FILE ]; then /bin/chmod 666 $FILE; fi
/etc/rc.d/init.d/mysql.init start
+
/bin/chmod 554 /etc/e-smith/events/actions/zarafa-update
  
  
######################################
+
#######################################
# Expanding the Zarafa-configuration-templates
+
# Creating public store(s)
######################################
+
#######################################
  
 +
if [ "$USERPLUGIN" == unix ]; then
 
/bin/echo
 
/bin/echo
/bin/echo "Expanding the Zarafa-configuration-templates"
+
/bin/echo "creating Public store"
 
/bin/echo
 
/bin/echo
/etc/e-smith/events/actions/zarafa-expand-templates
+
/usr/bin/zarafa-admin --utf8 -s
 
+
fi
 
 
######################################
 
# Configuration of the Webaccess
 
######################################
 
  
 +
if [ "$USERPLUGIN" == db ]; then
 +
if [ "$MULTICOMPANY" == no ]; then
 
/bin/echo
 
/bin/echo
/bin/echo "Configuration of the Webaccess and Z-push"
+
/bin/echo "creating Public store"
 
/bin/echo
 
/bin/echo
/bin/chown -R www:www /var/lib/zarafa-webaccess/tmp
+
/usr/bin/zarafa-admin --utf8 -s
/bin/chown -R www:www /var/lib/zarafa-webapp/tmp
+
fi
FILE=/etc/httpd/conf.d/zarafa-webaccess.conf; if [ -a $FILE ]; then /bin/rm -f $FILE; fi
+
fi
FILE=/etc/httpd/conf.d/zarafa-webapp.conf; if [ -a $FILE ]; then /bin/rm -f $FILE; fi
 
  
/bin/echo
+
if [ "$USERPLUGIN" == db ]; then
/bin/echo "Expanding http.conf-template"
+
if [ "$MULTICOMPANY" == yes ]; then
/bin/echo
+
/bin/echo
/sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf
+
/bin/echo "Make your first company. Enter your first companyname :"
 
+
/bin/echo
/bin/echo
+
read COMPANYNAME
/bin/echo "Restarting httpd"
+
/usr/bin/zarafa-admin --create-company "$COMPANYNAME"
/bin/echo
+
/bin/echo
/usr/bin/sv restart /service/httpd-e-smith
+
/bin/echo "!!! REMEMBER !!! : for a multicompany-environment the username-format of the SME-user and the ZARAFA-user,"
 +
/bin/echo "has to be : [username].[companyname] !!!"
 +
/bin/echo
 +
fi
 +
fi
 +
</nowiki>
 +
 
 +
===== To save : =====
 +
CTRL + X
 +
yes
 +
<ENTER>
  
 +
==== UPGRADESCRIPT ====
  
######################################
+
===== Only if you are upgrading from zcp 7.0.x to 7.1.x -> Uninstall zarafa-indexer and remove templates, db-entries and links for zarafa-indexer : =====
# Setting up more symbolic links
 
######################################
 
  
/bin/echo
+
rpm -e zarafa-indexer --nodeps
/bin/echo "Setting up more symbolic links"
+
rm -rf /etc/e-smith/templates/etc/zarafa/indexer.cfg
/bin/echo
+
db configuration delete zarafa-indexer
ln -s /lib/libcrypto.so.0.9.8e /usr/lib/libcrypto.so.0.9.8
+
rm -f /etc/rc.d/rc7.d/S99zarafa-indexer
ln -s /lib/libssl.so.0.9.8e /usr/lib/libssl.so.0.9.8
 
ln -s /etc/rc.d/init.d/e-smith-service /etc/rc.d/rc7.d/S99zarafa-dagent
 
ln -s /etc/rc.d/init.d/e-smith-service /etc/rc.d/rc7.d/S99zarafa-gateway
 
ln -s /etc/rc.d/init.d/e-smith-service /etc/rc.d/rc7.d/S99zarafa-indexer
 
ln -s /etc/rc.d/init.d/e-smith-service /etc/rc.d/rc7.d/S99zarafa-licensed
 
ln -s /etc/rc.d/init.d/e-smith-service /etc/rc.d/rc7.d/S99zarafa-monitor
 
ln -s /etc/rc.d/init.d/e-smith-service /etc/rc.d/rc7.d/S99zarafa-spooler
 
ln -s /etc/rc.d/init.d/e-smith-service /etc/rc.d/rc7.d/S99zarafa-ical
 
ln -s /etc/rc.d/init.d/e-smith-service /etc/rc.d/rc7.d/S99zarafa-server
 
  
 +
===== Only if you are upgrading from zcp 7.0.x  to 7.1.x -> Delete the old update-script for zcp 7.0.x : =====
  
#######################################
+
rm -f /etc/e-smith/events/actions/zarafa-update
# Installing a license-key
 
#######################################
 
  
/bin/echo
+
===== nano -w /etc/e-smith/events/actions/zarafa-update =====
/bin/echo "Installing a license-key"
 
/bin/echo
 
if [ -x /usr/bin/zarafa-licensed ]; then
 
if [ ! -f /etc/zarafa/license/base ]; then
 
mkdir -p /etc/zarafa/license
 
SERIAL="0"
 
while [ ${#SERIAL} -ne 25 -a ${#SERIAL} -ne 0 ]; do
 
if [ -n "$SERIAL" ]; then
 
echo "Serial number must be 25 characters or empty"
 
fi
 
echo -ne "Server serial number (leave empty for none) []\t\t: "
 
read SERIAL
 
done
 
SERIAL=`echo $SERIAL | tr [a-z] [A-Z]`
 
echo $SERIAL > /etc/zarafa/license/base
 
echo
 
echo "The correctness of the serial will be checked when the Zarafa-server starts."
 
echo
 
fi
 
fi
 
  
 +
<nowiki>
 +
#!/bin/sh
  
#######################################
+
/bin/echo "Stopping the Zarafa-services"
# Starting Zarafa
+
/etc/e-smith/events/actions/zarafa-services stop
#######################################
 
  
/bin/echo  
+
#
/bin/echo "Starting Zarafa-services"
+
#--- zarafa-configuration-helper-action ---
/bin/echo  
+
#
/etc/e-smith/events/actions/zarafa-services start
+
echo
 +
echo "Creating zarafa-configuration-helper-action ..."
 +
echo
 +
cat <<HERE1 > /etc/e-smith/events/actions/helpers.inc
 +
# -*- Mode: sh -*-
 +
replace() {
 +
file=\$1
 +
option=\$2
 +
value=\$3
 +
 +
# escape &-signs, and % for sed
 +
value=\`echo \$value | sed -e 's/\&/\\\\\&/g' -e 's/\%/\\\\\%/g'\`
 +
sed -i -e "s%\([[:space:]]*\$option[[:space:]]*=[[:space:]]*\).*%\1\$value%" \$file
  
/bin/echo
+
}
/bin/echo "Setting permissions on files"
+
HERE1
/bin/echo
 
FILE=/var/log/zarafa/dagent.log; if [ -a $FILE ]; then /bin/chmod 666 $FILE; fi
 
/bin/chmod 554 /etc/e-smith/events/actions/zarafa-update
 
  
 +
. /etc/e-smith/events/actions/helpers.inc
  
#######################################
+
#
# Creating public store(s)
+
#--- sysconfig config ---
#######################################
+
#
 +
echo
 +
echo "Creating zarafa-sysconfig-configuration-template ..."
 +
echo
 +
mkdir -p /etc/e-smith/templates/etc/sysconfig/zarafa
 +
cat /etc/sysconfig/zarafa | sed -e 's/\r$//g' >  /etc/e-smith/templates/etc/sysconfig/zarafa/zarafa
 +
replace /etc/e-smith/templates/etc/sysconfig/zarafa/zarafa ZARAFA_LOCALE '"{ ${'\''zarafa'\''}{language} || '\''en_US.UTF-8'\'' ; }"'
 +
replace /etc/e-smith/templates/etc/sysconfig/zarafa/zarafa ZARAFA_USERSCRIPT_LOCALE '"{ ${'\''zarafa'\''}{language} || '\''en_US.UTF-8'\'' ; }"'
  
if [ "$USERPLUGIN" == unix ]; then
 
/bin/echo
 
/bin/echo "creating Public store"
 
/bin/echo
 
/usr/bin/zarafa-admin --utf8 -s
 
fi
 
  
if [ "$USERPLUGIN" == db ]; then
+
#
if [ "$MULTICOMPANY" == no ]; then
+
#--- licensed config ---
/bin/echo
+
#
/bin/echo "creating Public store"
+
echo
/bin/echo
+
echo "Creating zarafa-licensed-configuration-template ..."
/usr/bin/zarafa-admin --utf8 -s
+
echo
fi
+
mkdir -p /etc/e-smith/templates/etc/zarafa/licensed.cfg
fi
+
cat /usr/share/doc/zarafa-licensed/example-config/licensed.cfg | sed -e 's/\r$//g' >  /etc/e-smith/templates/etc/zarafa/licensed.cfg/licensed.cfg
 +
replace /etc/e-smith/templates/etc/zarafa/licensed.cfg/licensed.cfg log_method '{ ${'\''zarafa-licensed'\''}{log_method} || '\''file'\''; }'
 +
replace /etc/e-smith/templates/etc/zarafa/licensed.cfg/licensed.cfg log_level '{ ${'\''zarafa-licensed'\''}{log_level} || '\''2'\''; }'
 +
replace /etc/e-smith/templates/etc/zarafa/licensed.cfg/licensed.cfg log_timestamp '{ ${'\''zarafa-licensed'\''}{log_timestamp} || '\''1'\''; }'
  
if [ "$USERPLUGIN" == db ]; then
+
#
if [ "$MULTICOMPANY" == yes ]; then
+
#--- server config ---
/bin/echo
+
#
/bin/echo "Make your first company. Enter your first companyname :"
+
echo
/bin/echo
+
echo "Creating zarafa-server-configuration-template ..."
read COMPANYNAME
+
echo
/usr/bin/zarafa-admin --create-company "$COMPANYNAME"
+
mkdir -p /etc/e-smith/templates/etc/zarafa/server.cfg
/bin/echo
+
cat /usr/share/doc/zarafa/example-config/server.cfg | sed -e 's/\r$//g' >  /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg
/bin/echo "!!! REMEMBER !!! : for a multicompany-environment the username-format of the SME-user and the ZARAFA-user,"
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_tcp_enabled '{ ${'\''zarafa-server'\''}{server_tcp_enabled} || '\''yes'\''; }'
/bin/echo "has to be : [username].[companyname] !!!"
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_tcp_port '{ ${'\''zarafa-server'\''}{TCPPort} || '\''236'\''; }'
/bin/echo
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_pipe_enabled '{ ${'\''zarafa-server'\''}{server_pipe_enabled} || '\''yes'\''; }'
fi
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_name '{ ${'\''zarafa-server'\''}{server_name} || '\''Zarafa'\''; }'
fi
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg database_engine '{ ${'\''zarafa-server'\''}{database_engine} || '\''mysql'\''; }'
</nowiki>
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg allow_local_users '{ ${'\''zarafa-server'\''}{allow_local_users} || '\''yes'\''; }'
 
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg local_admin_users '{ ${'\''zarafa-server'\''}{local_admin_users} || '\''root'\''; }'
=== To save : ===
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg system_email_address '{ ${'\''zarafa-server'\''}{system_email_address} || '\''postmaster@localhost'\''; }'
CTRL + X
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg session_timeout '{ ${'\''zarafa-server'\''}{session_timeout} || '\''300'\''; }'
yes
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg license_timeout '{ ${'\''zarafa-server'\''}{license_timeout} || '\''10'\''; }'
<ENTER>
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg log_method '{ ${'\''zarafa-server'\''}{log_method} || '\''file'\''; }'
 
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg log_level '{ ${'\''zarafa-server'\''}{log_level} || '\''2'\''; }'
=== nano -w /etc/e-smith/events/actions/zarafa-update ===
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg log_timestamp '{ ${'\''zarafa-server'\''}{log_timestamp} || '\''1'\''; }'
 
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg audit_log_enabled '{ ${'\''zarafa-server'\''}{audit_log_enabled} || '\''no'\''; }'
<nowiki>
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg audit_log_level '{ ${'\''zarafa-server'\''}{audit_log_level} || '\''1'\''; }'
#!/bin/sh
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg audit_log_timestamp '{ ${'\''zarafa-server'\''}{audit_log_timestamp} || '\''1'\''; }'
 
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg mysql_host '{ ${'\''zarafa-server'\''}{mysql_host} || '\''localhost'\''; }'
/bin/echo "Stopping the Zarafa-services"
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg mysql_port '{ ${'\''zarafa-server'\''}{mysql_port} || '\''3306'\''; }'
/etc/e-smith/events/actions/zarafa-services stop
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg mysql_user '{ ${'\''zarafa-server'\''}{DbUser} || '\''zarafa'\''; }'
 
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg mysql_password '{ ${'\''zarafa-server'\''}{DbPassword}; }'
#
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg mysql_database '{ ${'\''zarafa-server'\''}{DbName} || '\''zarafa'\''; }'
#--- zarafa-configuration-helper-action ---
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg attachment_storage '{ ${'\''zarafa-server'\''}{attachment_storage} || '\''files'\''; }'
#
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg attachment_path '/home/e-smith/files/zarafa'
echo
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg attachment_compression '{ ${'\''zarafa-server'\''}{attachment_compression} || '\''6'\''; }'
echo "Creating zarafa-configuration-helper-action ..."
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_ssl_enabled '{ ${'\''zarafa-ssl'\''}{server_ssl_enabled} || '\''yes'\''; }'
echo
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_ssl_port '{ ${'\''zarafa-ssl'\''}{TCPPort} || '\''237'\''; }'
cat <<HERE1 > /etc/e-smith/events/actions/helpers.inc
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_ssl_key_file '/home/e-smith/ssl.pem/{$SystemName}.{$DomainName}.pem'
# -*- Mode: sh -*-
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_ssl_key_pass '{ ${'\''zarafa-server'\''}{DbPassword}; }'
replace() {
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_ssl_ca_file '/home/e-smith/ssl.crt/{$SystemName}.{$DomainName}.crt'
file=\$1
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_ssl_ca_path '/home/e-smith/ssl.crt'
option=\$2
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg sslkeys_path '/home/e-smith/ssl.pem'
value=\$3
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg threads '{ ${'\''zarafa-server'\''}{threads} || '\''8'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg watchdog_frequency '{ ${'\''zarafa-server'\''}{watchdog_frequency} || '\''1'\''; }'
# escape &-signs, and % for sed
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg watchdog_max_age '{ ${'\''zarafa-server'\''}{watchdog_max_age} || '\''500'\''; }'
value=\`echo \$value | sed -e 's/\&/\\\\\&/g' -e 's/\%/\\\\\%/g'\`
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_max_keep_alive_requests '{ ${'\''zarafa-server'\''}{server_max_keep_alive_requests} || '\''100'\''; }'
sed -i -e "s%\([[:space:]]*\$option[[:space:]]*=[[:space:]]*\).*%\1\$value%" \$file
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_recv_timeout '{ ${'\''zarafa-server'\''}{server_recv_timeout} || '\''5'\''; }'
 
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_read_timeout '{ ${'\''zarafa-server'\''}{server_read_timeout} || '\''60'\''; }'
}
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_send_timeout '{ ${'\''zarafa-server'\''}{server_send_timeout} || '\''60'\''; }'
HERE1
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg softdelete_lifetime '{ ${'\''zarafa-server'\''}{softdelete_lifetime} || '\''30'\''; }'
 
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg sync_lifetime '{ ${'\''zarafa-server'\''}{sync_lifetime} || '\''365'\''; }'
. /etc/e-smith/events/actions/helpers.inc
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg sync_log_all_changes '{ ${'\''zarafa-server'\''}{sync_log_all_changes} || '\''no'\''; }'
 
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg enable_sso '{ ${'\''zarafa-server'\''}{enable_sso} || '\''no'\''; }'
#
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg enable_gab '{ ${'\''zarafa-server'\''}{enable_gab} || '\''yes'\''; }'
#--- sysconfig config ---
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg auth_method '{ ${'\''zarafa-server'\''}{auth_method} || '\''plugin'\''; }'
#
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg pam_service '{ ${'\''zarafa-server'\''}{pam_service} || '\''passwd'\''; }'
echo
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg cache_cell_size '{ ${'\''zarafa-server'\''}{cache_cell_size} || '\''268435456'\''; }'
echo "Creating zarafa-sysconfig-configuration-template ..."
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg cache_object_size '{ ${'\''zarafa-server'\''}{cache_object_size} || '\''5242880'\''; }'
echo
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg cache_indexedobject_size '{ ${'\''zarafa-server'\''}{cache_indexedobject_size} || '\''16777216'\''; }'
mkdir -p /etc/e-smith/templates/etc/sysconfig/zarafa
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg cache_quota_size '{ ${'\''zarafa-server'\''}{cache_quota_size} || '\''1048576'\''; }'
cat /etc/sysconfig/zarafa | sed -e 's/\r$//g' /etc/e-smith/templates/etc/sysconfig/zarafa/zarafa
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg cache_quota_lifetime '{ ${'\''zarafa-server'\''}{cache_quota_lifetime} || '\''1'\''; }'
replace /etc/e-smith/templates/etc/sysconfig/zarafa/zarafa ZARAFA_LOCALE '"{ ${'\''zarafa'\''}{language} || '\''en_US.UTF-8'\'' ; }"'
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg cache_acl_size '{ ${'\''zarafa-server'\''}{cache_acl_size} || '\''1048576'\''; }'
replace /etc/e-smith/templates/etc/sysconfig/zarafa/zarafa ZARAFA_USERSCRIPT_LOCALE '"{ ${'\''zarafa'\''}{language} || '\''en_US.UTF-8'\'' ; }"'
+
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg cache_store_size '{ ${'\''zarafa-server'\''}{cache_store_size} || '\''1048576'\''; }'
 +
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg cache_user_size '{ ${'\''zarafa-server'\''}{cache_user_size} || '\''1048576'\''; }'
 +
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg cache_userdetails_size '{ ${'\''zarafa-server'\''}{cache_userdetails_size} || '\''26214400'\''; }'
 +
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg cache_userdetails_lifetime '{ ${'\''zarafa-server'\''}{cache_userdetails_lifetime} || '\''5'\''; }'
 +
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg cache_server_size '{ ${'\''zarafa-server'\''}{cache_server_size} || '\''1048576'\''; }'
 +
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg cache_server_lifetime '{ ${'\''zarafa-server'\''}{cache_server_lifetime} || '\''30'\''; }'
 +
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg quota_warn '{ ${'\''zarafa-server'\''}{quota_warn} || '\''0'\''; }'
 +
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg quota_soft '{ ${'\''zarafa-server'\''}{quota_soft} || '\''0'\''; }'
 +
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg quota_hard '{ ${'\''zarafa-server'\''}{quota_hard} || '\''0'\''; }'
 +
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg companyquota_warn '{ ${'\''zarafa-server'\''}{companyquota_warn} || '\''0'\''; }'
 +
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg user_plugin '{ ${'\''zarafa-server'\''}{user_plugin} || '\''db'\''; }'
 +
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg user_plugin_config '{ ${'\''zarafa-server'\''}{user_plugin_config}; }'
 +
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg user_safe_mode '{ ${'\''zarafa-server'\''}{user_safe_mode} || '\''no'\''; }'
 +
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg thread_stacksize '{ ${'\''zarafa-server'\''}{thread_stacksize} || '\''512'\''; }'
 +
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg enable_hosted_zarafa '{ ${'\''zarafa-server'\''}{enable_hosted_zarafa} || '\''false'\''; }'
 +
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg enable_distributed_zarafa '{ ${'\''zarafa-server'\''}{enable_distributed_zarafa} || '\''false'\''; }'
 +
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg storename_format '{ ${'\''zarafa-server'\''}{storename_format} || '\''%f'\''; }'
 +
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg loginname_format '{ ${'\''zarafa-server'\''}{loginname_format} || '\''%u'\''; }'
 +
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg client_update_enabled '{ ${'\''zarafa-server'\''}{client_update_enabled} || '\''false'\''; }'
 +
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg client_update_path '{ ${'\''zarafa-server'\''}{client_update_path} || '\''/var/lib/zarafa/client'\''; }'
 +
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg client_update_log_level '{ ${'\''zarafa-server'\''}{client_update_log_level} || '\''1'\''; }'
 +
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg hide_everyone '{ ${'\''zarafa-server'\''}{hide_everyone} || '\''yes'\''; }'
 +
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg hide_system '{ ${'\''zarafa-server'\''}{hide_system} || '\''yes'\''; }'
 +
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg search_enabled '{ ${'\''zarafa-server'\''}{search_enabled} || '\''no'\''; }'
 +
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg search_timeout '{ ${'\''zarafa-server'\''}{search_timeout} || '\''10'\''; }'
 +
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg enable_enhanced_ics '{ ${'\''zarafa-server'\''}{enable_enhanced_ics} || '\''yes'\''; }'
 +
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg sync_gab_realtime '{ ${'\''zarafa-server'\''}{sync_gab_realtime} || '\''yes'\''; }'
 +
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg disabled_features '{ ${'\''zarafa-server'\''}{disabled_features}; }'
 +
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg max_deferred_records '{ ${'\''zarafa-server'\''}{max_deferred_records} || '\''0'\''; }'
 +
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg max_deferred_records_folder '{ ${'\''zarafa-server'\''}{max_deferred_records_folder} || '\''20'\''; }'
 +
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg coredump_enabled '{ ${'\''zarafa-server'\''}{coredump_enabled} || '\''yes'\''; }'
 +
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_ssl_enable_v2 '{ ${'\''zarafa-server'\''}{server_ssl_enable_v2} || '\''no'\''; }'
  
  
 
#
 
#
#--- licensed config ---
+
#--- dagent config ---
 
#
 
#
 
echo
 
echo
echo "Creating zarafa-licensed-configuration-template ..."
+
echo "Creating zarafa-dagent-configuration-template ..."
 
echo
 
echo
mkdir -p /etc/e-smith/templates/etc/zarafa/licensed.cfg
+
mkdir -p /etc/e-smith/templates/etc/zarafa/dagent.cfg
cat /usr/share/doc/zarafa-licensed/example-config/licensed.cfg | sed -e 's/\r$//g' >  /etc/e-smith/templates/etc/zarafa/licensed.cfg/licensed.cfg
+
cat /usr/share/doc/zarafa-dagent/example-config/dagent.cfg | sed -e 's/\r$//g' >  /etc/e-smith/templates/etc/zarafa/dagent.cfg/dagent.cfg
replace /etc/e-smith/templates/etc/zarafa/licensed.cfg/licensed.cfg log_method '{ ${'\''zarafa-licensed'\''}{log_method} || '\''file'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/dagent.cfg/dagent.cfg log_method '{ ${'\''zarafa-dagent'\''}{log_method} || '\''file'\''; }'
replace /etc/e-smith/templates/etc/zarafa/licensed.cfg/licensed.cfg log_level '{ ${'\''zarafa-licensed'\''}{log_level} || '\''2'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/dagent.cfg/dagent.cfg log_level '{ ${'\''zarafa-dagent'\''}{log_level} || '\''2'\''; }'
replace /etc/e-smith/templates/etc/zarafa/licensed.cfg/licensed.cfg log_timestamp '{ ${'\''zarafa-licensed'\''}{log_timestamp} || '\''1'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/dagent.cfg/dagent.cfg log_timestamp '{ ${'\''zarafa-dagent'\''}{log_timestamp} || '\''1'\''; }'
 +
replace /etc/e-smith/templates/etc/zarafa/dagent.cfg/dagent.cfg log_raw_message '{ ${'\''zarafa-dagent'\''}{log_raw_message} || '\''no'\''; }'
 +
replace /etc/e-smith/templates/etc/zarafa/dagent.cfg/dagent.cfg lmtp_port '{ ${'\''zarafa-dagent'\''}{lmtp_port} || '\''2003'\''; }'
 +
replace /etc/e-smith/templates/etc/zarafa/dagent.cfg/dagent.cfg lmtp_max_threads '{ ${'\''zarafa-dagent'\''}{lmtp_max_threads} || '\''20'\''; }'
 +
replace /etc/e-smith/templates/etc/zarafa/dagent.cfg/dagent.cfg process_model '{ ${'\''zarafa-dagent'\''}{process_model} || '\''fork'\''; }'
 +
replace /etc/e-smith/templates/etc/zarafa/dagent.cfg/dagent.cfg spam_header_name '{ ${'\''zarafa-dagent'\''}{spam_header_name} || '\''X-Spam-Status'\''; }'
 +
replace /etc/e-smith/templates/etc/zarafa/dagent.cfg/dagent.cfg spam_header_value '{ ${'\''zarafa-dagent'\''}{spam_header_value} || '\''Yes'\''; }'
 +
replace /etc/e-smith/templates/etc/zarafa/dagent.cfg/dagent.cfg archive_on_delivery '{ ${'\''zarafa-dagent'\''}{archive_on_delivery} || '\''no'\''; }'
 +
replace /etc/e-smith/templates/etc/zarafa/dagent.cfg/dagent.cfg set_rule_headers '{ ${'\''zarafa-dagent'\''}{set_rule_headers} || '\''yes'\''; }'
 +
 
  
 
#
 
#
#--- server config ---
+
#--- spooler config ---
 
#
 
#
 
echo
 
echo
echo "Creating zarafa-server-configuration-template ..."
+
echo "Creating zarafa-spooler-configuration-template ..."
 
echo
 
echo
mkdir -p /etc/e-smith/templates/etc/zarafa/server.cfg
+
mkdir -p /etc/e-smith/templates/etc/zarafa/spooler.cfg
cat /usr/share/doc/zarafa/example-config/server.cfg | sed -e 's/\r$//g' >  /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg
+
cat /usr/share/doc/zarafa-spooler/example-config/spooler.cfg | sed -e 's/\r$//g' >  /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_tcp_enabled '{ ${'\''zarafa-server'\''}{server_tcp_enabled} || '\''yes'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg smtp_port '{ ${'\''zarafa-spooler'\''}{smtp_port} || '\''25'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_tcp_port '{ ${'\''zarafa-server'\''}{TCPPort} || '\''236'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg log_method '{ ${'\''zarafa-spooler'\''}{log_method} || '\''file'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_pipe_enabled '{ ${'\''zarafa-server'\''}{server_pipe_enabled} || '\''yes'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg log_level '{ ${'\''zarafa-spooler'\''}{log_level} || '\''3'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_name '{ ${'\''zarafa-server'\''}{server_name} || '\''Zarafa'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg log_timestamp '{ ${'\''zarafa-spooler'\''}{log_timestamp} || '\''1'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg database_engine '{ ${'\''zarafa-server'\''}{database_engine} || '\''mysql'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg max_threads '{ ${'\''zarafa-spooler'\''}{max_threads} || '\''5'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg allow_local_users '{ ${'\''zarafa-server'\''}{allow_local_users} || '\''yes'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg fax_domain '{ ${'\''zarafa-spooler'\''}{fax_domain} || '\''fax.local'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg local_admin_users '{ ${'\''zarafa-server'\''}{local_admin_users} || '\''root'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg fax_international '{ ${'\''zarafa-spooler'\''}{fax_international} || '\''00'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg system_email_address '{ ${'\''zarafa-server'\''}{system_email_address} || '\''postmaster@localhost'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg always_send_delegates '{ ${'\''zarafa-spooler'\''}{always_send_delegates} || '\''no'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg session_timeout '{ ${'\''zarafa-server'\''}{session_timeout} || '\''300'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg allow_redirect_spoofing '{ ${'\''zarafa-spooler'\''}{allow_redirect_spoofing} || '\''yes'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg license_timeout '{ ${'\''zarafa-server'\''}{license_timeout} || '\''10'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg copy_delegate_mails '{ ${'\''zarafa-spooler'\''}{copy_delegate_mails} || '\''yes'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg log_method '{ ${'\''zarafa-server'\''}{log_method} || '\''file'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg allow_delegate_meeting_request '{ ${'\''zarafa-spooler'\''}{allow_delegate_meeting_request} || '\''yes'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg log_level '{ ${'\''zarafa-server'\''}{log_level} || '\''2'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg allow_send_to_everyone '{ ${'\''zarafa-spooler'\''}{allow_send_to_everyone} || '\''yes'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg log_timestamp '{ ${'\''zarafa-server'\''}{log_timestamp} || '\''1'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg always_send_tnef '{ ${'\''zarafa-spooler'\''}{always_send_tnef} || '\''no'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg audit_log_enabled '{ ${'\''zarafa-server'\''}{audit_log_enabled} || '\''no'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg always_send_utf8 '{ ${'\''zarafa-spooler'\''}{always_send_utf8} || '\''no'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg audit_log_level '{ ${'\''zarafa-server'\''}{audit_log_level} || '\''1'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg charset_upgrade '{ ${'\''zarafa-spooler'\''}{charset_upgrade} || '\''windows-1252'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg audit_log_timestamp '{ ${'\''zarafa-server'\''}{audit_log_timestamp} || '\''1'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg expand_groups '{ ${'\''zarafa-spooler'\''}{expand_groups} || '\''no'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg mysql_host '{ ${'\''zarafa-server'\''}{mysql_host} || '\''localhost'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg archive_on_send '{ ${'\''zarafa-spooler'\''}{archive_on_send} || '\''no'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg mysql_port '{ ${'\''zarafa-server'\''}{mysql_port} || '\''3306'\''; }'
+
 
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg mysql_user '{ ${'\''zarafa-server'\''}{DbUser} || '\''zarafa'\''; }'
+
 
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg mysql_password '{ ${'\''zarafa-server'\''}{DbPassword}; }'
+
#
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg mysql_database '{ ${'\''zarafa-server'\''}{DbName} || '\''zarafa'\''; }'
+
#--- monitor config ---
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg attachment_storage '{ ${'\''zarafa-server'\''}{attachment_storage} || '\''files'\''; }'
+
#
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg attachment_path '/home/e-smith/files/zarafa'
+
echo
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg attachment_compression '{ ${'\''zarafa-server'\''}{attachment_compression} || '\''6'\''; }'
+
echo "Creating zarafa-monitor-configuration-template ..."
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_ssl_enabled '{ ${'\''zarafa-ssl'\''}{server_ssl_enabled} || '\''yes'\''; }'
+
echo "The monitor program sends quota warning mails to users who are over quota."
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_ssl_port '{ ${'\''zarafa-ssl'\''}{TCPPort} || '\''237'\''; }'
+
echo
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_ssl_key_file '/home/e-smith/ssl.pem/{$SystemName}.{$DomainName}.pem'
+
mkdir -p /etc/e-smith/templates/etc/zarafa/monitor.cfg
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_ssl_key_pass '{ ${'\''zarafa-server'\''}{DbPassword}; }'
+
cat /usr/share/doc/zarafa-monitor/example-config/monitor.cfg | sed -e 's/\r$//g' >  /etc/e-smith/templates/etc/zarafa/monitor.cfg/monitor.cfg
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_ssl_ca_file '/home/e-smith/ssl.crt/{$SystemName}.{$DomainName}.crt'
+
replace /etc/e-smith/templates/etc/zarafa/monitor.cfg/monitor.cfg log_method '{ ${'\''zarafa-monitor'\''}{log_method} || '\''file'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_ssl_ca_path '/home/e-smith/ssl.crt'
+
replace /etc/e-smith/templates/etc/zarafa/monitor.cfg/monitor.cfg log_level '{ ${'\''zarafa-monitor'\''}{log_level} || '\''2'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg sslkeys_path '/home/e-smith/ssl.pem'
+
replace /etc/e-smith/templates/etc/zarafa/monitor.cfg/monitor.cfg log_timestamp '{ ${'\''zarafa-monitor'\''}{log_timestamp} || '\''1'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg threads '{ ${'\''zarafa-server'\''}{threads} || '\''8'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/monitor.cfg/monitor.cfg quota_check_interval '{ ${'\''zarafa-monitor'\''}{quota_check_interval} || '\''15'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg watchdog_frequency '{ ${'\''zarafa-server'\''}{watchdog_frequency} || '\''1'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/monitor.cfg/monitor.cfg mailquota_resend_interval '{ ${'\''zarafa-monitor'\''}{mailquota_resend_interval} || '\''1'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg watchdog_max_age '{ ${'\''zarafa-server'\''}{watchdog_max_age} || '\''500'\''; }'
+
 
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_max_keep_alive_requests '{ ${'\''zarafa-server'\''}{server_max_keep_alive_requests} || '\''100'\''; }'
+
 
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_recv_timeout '{ ${'\''zarafa-server'\''}{server_recv_timeout} || '\''5'\''; }'
+
#
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_read_timeout '{ ${'\''zarafa-server'\''}{server_read_timeout} || '\''60'\''; }'
+
#--- gateway config ---
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_send_timeout '{ ${'\''zarafa-server'\''}{server_send_timeout} || '\''60'\''; }'
+
#
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg softdelete_lifetime '{ ${'\''zarafa-server'\''}{softdelete_lifetime} || '\''30'\''; }'
+
echo
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg sync_lifetime '{ ${'\''zarafa-server'\''}{sync_lifetime} || '\''365'\''; }'
+
echo "Creating zarafa-gateway-configuration-template ..."
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg sync_log_all_changes '{ ${'\''zarafa-server'\''}{sync_log_all_changes} || '\''no'\''; }'
+
echo
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg enable_sso '{ ${'\''zarafa-server'\''}{enable_sso} || '\''no'\''; }'
+
mkdir -p /etc/e-smith/templates/etc/zarafa/gateway.cfg
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg enable_gab '{ ${'\''zarafa-server'\''}{enable_gab} || '\''yes'\''; }'
+
cat /usr/share/doc/zarafa-gateway/example-config/gateway.cfg | sed -e 's/\r$//g' >  /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg auth_method '{ ${'\''zarafa-server'\''}{auth_method} || '\''plugin'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg server_socket 'http://localhost:{${'\''zarafa-server'\''}{TCPPort}||'\''236'\'';}/zarafa'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg pam_service '{ ${'\''zarafa-server'\''}{pam_service} || '\''passwd'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg pop3_enable '{ if (${'\''zarafa-pop3'\''}{status} eq '\''enabled'\'') {'\''yes'\''} else {'\''no'\''}; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg cache_cell_size '{ ${'\''zarafa-server'\''}{cache_cell_size} || '\''268435456'\''; }'  
+
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg pop3_port '{ ${'\''zarafa-pop3'\''}{TCPPort} || '\''8110'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg cache_object_size '{ ${'\''zarafa-server'\''}{cache_object_size} || '\''5242880'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg pop3s_enable '{ if (${'\''zarafa-pop3s'\''}{status} eq '\''enabled'\'') {'\''yes'\''} else {'\''no'\''}; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg cache_indexedobject_size '{ ${'\''zarafa-server'\''}{cache_indexedobject_size} || '\''16777216'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg pop3s_port '{ ${'\''zarafa-pop3s'\''}{TCPPort} || '\''8995'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg cache_quota_size '{ ${'\''zarafa-server'\''}{cache_quota_size} || '\''1048576'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg imap_enable '{ if (${'\''zarafa-imap'\''}{status} eq '\''enabled'\'') {'\''yes'\''} else {'\''no'\''}; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg cache_quota_lifetime '{ ${'\''zarafa-server'\''}{cache_quota_lifetime} || '\''1'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg imap_port '{ ${'\''zarafa-imap'\''}{TCPPort} || '\''8143'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg cache_acl_size '{ ${'\''zarafa-server'\''}{cache_acl_size} || '\''1048576'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg imaps_enable '{ if (${'\''zarafa-imaps'\''}{status} eq '\''enabled'\'') {'\''yes'\''} else {'\''no'\''}; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg cache_store_size '{ ${'\''zarafa-server'\''}{cache_store_size} || '\''1048576'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg imaps_port '{ ${'\''zarafa-imaps'\''}{TCPPort} || '\''8993'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg cache_user_size '{ ${'\''zarafa-server'\''}{cache_user_size} || '\''1048576'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg imap_only_mailfolders '{ ${'\''zarafa-imap'\''}{imap_only_mailfolders} || '\''yes'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg cache_userdetails_size '{ ${'\''zarafa-server'\''}{cache_userdetails_size} || '\''26214400'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg imap_public_folders '{ ${'\''zarafa-imap'\''}{imap_public_folders} || '\''yes'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg cache_userdetails_lifetime '{ ${'\''zarafa-server'\''}{cache_userdetails_lifetime} || '\''5'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg imap_capability_idle '{ ${'\''zarafa-imap'\''}{imap_capability_idle} || '\''yes'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg cache_server_size '{ ${'\''zarafa-server'\''}{cache_server_size} || '\''1048576'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg imap_max_messagesize '{ ${'\''zarafa-imap'\''}{imap_max_messagesize} || '\''134217728'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg cache_server_lifetime '{ ${'\''zarafa-server'\''}{cache_server_lifetime} || '\''30'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg imap_generate_utf8 '{ ${'\''zarafa-imap'\''}{imap_generate_utf8} || '\''no'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg quota_warn '{ ${'\''zarafa-server'\''}{quota_warn} || '\''0'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg imap_expunge_on_delete '{ ${'\''zarafa-imap'\''}{imap_expunge_on_delete} || '\''no'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg quota_soft '{ ${'\''zarafa-server'\''}{quota_soft} || '\''0'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg imap_store_rfc822 '{ ${'\''zarafa-imap'\''}{imap_store_rfc822} || '\''yes'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg quota_hard '{ ${'\''zarafa-server'\''}{quota_hard} || '\''0'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg ssl_private_key_file '/home/e-smith/ssl.key/{$SystemName}.{$DomainName}.key'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg companyquota_warn '{ ${'\''zarafa-server'\''}{companyquota_warn} || '\''0'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg ssl_certificate_file '/home/e-smith/ssl.crt/{$SystemName}.{$DomainName}.crt'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg user_plugin '{ ${'\''zarafa-server'\''}{user_plugin} || '\''db'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg ssl_verify_client '{ ${'\''zarafa-gateway'\''}{ssl_verify_client} || '\''no'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg user_plugin_config '{ ${'\''zarafa-server'\''}{user_plugin_config}; }'
+
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg process_model '{ ${'\''zarafa-gateway'\''}{process_model} || '\''fork'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg user_safe_mode '{ ${'\''zarafa-server'\''}{user_safe_mode} || '\''no'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg log_method '{ ${'\''zarafa-gateway'\''}{log_method} || '\''file'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg thread_stacksize '{ ${'\''zarafa-server'\''}{thread_stacksize} || '\''512'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg log_level '{ ${'\''zarafa-gateway'\''}{log_level} || '\''2'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg enable_hosted_zarafa '{ ${'\''zarafa-server'\''}{enable_hosted_zarafa} || '\''false'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg log_timestamp '{ ${'\''zarafa-gateway'\''}{log_timestamp} || '\''1'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg enable_distributed_zarafa '{ ${'\''zarafa-server'\''}{enable_distributed_zarafa} || '\''false'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg ssl_enable_v2 '{ ${'\''zarafa-gateway'\''}{ssl_enable_v2} || '\''no'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg storename_format '{ ${'\''zarafa-server'\''}{storename_format} || '\''%f'\''; }'
+
 
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg loginname_format '{ ${'\''zarafa-server'\''}{loginname_format} || '\''%u'\''; }'
+
 
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg client_update_enabled '{ ${'\''zarafa-server'\''}{client_update_enabled} || '\''false'\''; }'
+
#
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg client_update_path '{ ${'\''zarafa-server'\''}{client_update_path} || '\''/var/lib/zarafa/client'\''; }'
+
#--- ical config ---
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg client_update_log_level '{ ${'\''zarafa-server'\''}{client_update_log_level} || '\''1'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg hide_everyone '{ ${'\''zarafa-server'\''}{hide_everyone} || '\''yes'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg hide_system '{ ${'\''zarafa-server'\''}{hide_system} || '\''yes'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg index_services_enabled '{ ${'\''zarafa-server'\''}{index_services_enabled} || '\''no'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg index_services_search_timeout '{ ${'\''zarafa-server'\''}{index_services_search_timeout} || '\''10'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg index_services_prefix_chars '{ ${'\''zarafa-server'\''}{index_services_prefix_chars} || '\''3'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg enable_enhanced_ics '{ ${'\''zarafa-server'\''}{enable_enhanced_ics} || '\''yes'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg sync_gab_realtime '{ ${'\''zarafa-server'\''}{sync_gab_realtime} || '\''yes'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg disabled_features '{ ${'\''zarafa-server'\''}{disabled_features}; }'
 
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg max_deferred_records '{ ${'\''zarafa-server'\''}{max_deferred_records} || '\''0'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg max_deferred_records_folder '{ ${'\''zarafa-server'\''}{max_deferred_records_folder} || '\''20'\''; }'
 
 
 
 
 
#
 
#--- dagent config ---
 
 
#
 
#
 
echo
 
echo
echo "Creating zarafa-dagent-configuration-template ..."
+
echo "Creating zarafa-ical-configuration-template ..."
 
echo
 
echo
mkdir -p /etc/e-smith/templates/etc/zarafa/dagent.cfg
+
mkdir -p /etc/e-smith/templates/etc/zarafa/ical.cfg
cat /usr/share/doc/zarafa-dagent/example-config/dagent.cfg | sed -e 's/\r$//g' >  /etc/e-smith/templates/etc/zarafa/dagent.cfg/dagent.cfg
+
cat /usr/share/doc/zarafa-ical/example-config/ical.cfg | sed -e 's/\r$//g' >  /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg
replace /etc/e-smith/templates/etc/zarafa/dagent.cfg/dagent.cfg log_method '{ ${'\''zarafa-dagent'\''}{log_method} || '\''file'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg ical_enable '{ if (${'\''zarafa-ical'\''}{status} eq '\''enabled'\'') {'\''yes'\''} else {'\''no'\''}; }'
replace /etc/e-smith/templates/etc/zarafa/dagent.cfg/dagent.cfg log_level '{ ${'\''zarafa-dagent'\''}{log_level} || '\''2'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg ical_port '{ ${'\''zarafa-ical'\''}{TCPPort} || '\''8088'\''; }'
replace /etc/e-smith/templates/etc/zarafa/dagent.cfg/dagent.cfg log_timestamp '{ ${'\''zarafa-dagent'\''}{log_timestamp} || '\''1'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg icals_enable '{ if (${'\''zarafa-icals'\''}{status} eq '\''enabled'\'') {'\''yes'\''} else {'\''no'\''}; }'
replace /etc/e-smith/templates/etc/zarafa/dagent.cfg/dagent.cfg log_raw_message '{ ${'\''zarafa-dagent'\''}{log_raw_message} || '\''no'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg icals_port '{ ${'\''zarafa-icals'\''}{TCPPort} || '\''8089'\''; }'
replace /etc/e-smith/templates/etc/zarafa/dagent.cfg/dagent.cfg lmtp_port '{ ${'\''zarafa-dagent'\''}{lmtp_port} || '\''2003'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg server_socket 'http://localhost:{${'\''zarafa-server'\''}{TCPPort}||'\''236'\'';}/zarafa'
replace /etc/e-smith/templates/etc/zarafa/dagent.cfg/dagent.cfg lmtp_max_threads '{ ${'\''zarafa-dagent'\''}{lmtp_max_threads} || '\''20'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg process_model '{ ${'\''zarafa-ical'\''}{process_model} || '\''fork'\''; }'
replace /etc/e-smith/templates/etc/zarafa/dagent.cfg/dagent.cfg process_model '{ ${'\''zarafa-dagent'\''}{process_model} || '\''fork'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg log_method '{ ${'\''zarafa-ical'\''}{log_method} || '\''file'\''; }'
replace /etc/e-smith/templates/etc/zarafa/dagent.cfg/dagent.cfg spam_header_name '{ ${'\''zarafa-dagent'\''}{spam_header_name} || '\''X-Spam-Status'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg log_level '{ ${'\''zarafa-ical'\''}{log_level} || '\''2'\''; }'
replace /etc/e-smith/templates/etc/zarafa/dagent.cfg/dagent.cfg spam_header_value '{ ${'\''zarafa-dagent'\''}{spam_header_value} || '\''Yes'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg log_timestamp '{ ${'\''zarafa-ical'\''}{log_timestamp} || '\''1'\''; }'
replace /etc/e-smith/templates/etc/zarafa/dagent.cfg/dagent.cfg archive_on_delivery '{ ${'\''zarafa-dagent'\''}{archive_on_delivery} || '\''no'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg ssl_private_key_file '/home/e-smith/ssl.key/{$SystemName}.{$DomainName}.key'
replace /etc/e-smith/templates/etc/zarafa/dagent.cfg/dagent.cfg set_rule_headers '{ ${'\''zarafa-dagent'\''}{set_rule_headers} || '\''yes'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg ssl_certificate_file '/home/e-smith/ssl.crt/{$SystemName}.{$DomainName}.crt'
 +
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg ssl_verify_client '{ ${'\''zarafa-ical'\''}{ssl_verify_client} || '\''no'\''; }'
 +
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg server_timezone '{$TimeZone}'
 +
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg default_charset '{ ${'\''zarafa-ical'\''}{default_charset} || '\''utf-8'\''; }'
 +
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg enable_ical_get '{ ${'\''zarafa-ical'\''}{enable_ical_get} || '\''yes'\''; }'
 +
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg ssl_enable_v2 '{ ${'\''zarafa-ical'\''}{ssl_enable_v2} || '\''no'\''; }'
  
  
 
#
 
#
#--- spooler config ---
+
#--- search config ---
 
#
 
#
 
echo
 
echo
echo "Creating zarafa-spooler-configuration-template ..."
+
echo "Creating zarafa-search-configuration-template ..."
 
echo
 
echo
mkdir -p /etc/e-smith/templates/etc/zarafa/spooler.cfg
+
mkdir -p /etc/e-smith/templates/etc/zarafa/search.cfg
cat /usr/share/doc/zarafa-spooler/example-config/spooler.cfg | sed -e 's/\r$//g' >  /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg
+
cat /usr/share/doc/zarafa-search/example-config/search.cfg | sed -e 's/\r$//g' >  /etc/e-smith/templates/etc/zarafa/search.cfg/search.cfg
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg smtp_port '{ ${'\''zarafa-spooler'\''}{smtp_port} || '\''25'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/search.cfg/search.cfg coredump_enabled '{ ${'\''zarafa-search'\''}{coredump_enabled} || '\''no'\''; }'
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg log_method '{ ${'\''zarafa-spooler'\''}{log_method} || '\''file'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/search.cfg/search.cfg limit_results '{ ${'\''zarafa-search'\''}{limit_results} || '\''0'\''; }'
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg log_level '{ ${'\''zarafa-spooler'\''}{log_level} || '\''3'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/search.cfg/search.cfg log_method '{ ${'\''zarafa-search'\''}{log_method} || '\''file'\''; }'
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg log_timestamp '{ ${'\''zarafa-spooler'\''}{log_timestamp} || '\''1'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/search.cfg/search.cfg log_level '{ ${'\''zarafa-search'\''}{log_level} || '\''2'\''; }'
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg max_threads '{ ${'\''zarafa-spooler'\''}{max_threads} || '\''5'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/search.cfg/search.cfg log_timestamp '{ ${'\''zarafa-search'\''}{log_timestamp} || '\''1'\''; }'
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg fax_domain '{ ${'\''zarafa-spooler'\''}{fax_domain} || '\''fax.local'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/search.cfg/search.cfg term_cache_size '{ ${'\''zarafa-search'\''}{term_cache_size} || '\''64M'\''; }'
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg fax_international '{ ${'\''zarafa-spooler'\''}{fax_international} || '\''00'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/search.cfg/search.cfg optimize_start '{ ${'\''zarafa-search'\''}{optimize_start} || '\''2'\''; }'
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg always_send_delegates '{ ${'\''zarafa-spooler'\''}{always_send_delegates} || '\''no'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/search.cfg/search.cfg optimize_stop '{ ${'\''zarafa-search'\''}{optimize_stop} || '\''5'\''; }'
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg allow_redirect_spoofing '{ ${'\''zarafa-spooler'\''}{allow_redirect_spoofing} || '\''yes'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/search.cfg/search.cfg optimize_age '{ ${'\''zarafa-search'\''}{optimize_age} || '\''7'\''; }'
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg copy_delegate_mails '{ ${'\''zarafa-spooler'\''}{copy_delegate_mails} || '\''yes'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/search.cfg/search.cfg index_attachments '{ ${'\''zarafa-search'\''}{index_attachments} || '\''no'\''; }'
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg allow_delegate_meeting_request '{ ${'\''zarafa-spooler'\''}{allow_delegate_meeting_request} || '\''yes'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/search.cfg/search.cfg index_attachment_max_size '{ ${'\''zarafa-search'\''}{index_attachment_max_size} || '\''5M'\''; }'
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg allow_send_to_everyone '{ ${'\''zarafa-spooler'\''}{allow_send_to_everyone} || '\''yes'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/search.cfg/search.cfg index_attachment_parser_max_memory '{ ${'\''zarafa-search'\''}{index_attachment_parser_max_memory} || '\''0'\''; }'
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg always_send_tnef '{ ${'\''zarafa-spooler'\''}{always_send_tnef} || '\''no'\''; }'
+
replace /etc/e-smith/templates/etc/zarafa/search.cfg/search.cfg index_attachment_parser_max_cputime '{ ${'\''zarafa-search'\''}{index_attachment_parser_max_cputime} || '\''0'\''; }'
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg always_send_utf8 '{ ${'\''zarafa-spooler'\''}{always_send_utf8} || '\''no'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg charset_upgrade '{ ${'\''zarafa-spooler'\''}{charset_upgrade} || '\''windows-1252'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg expand_groups '{ ${'\''zarafa-spooler'\''}{expand_groups} || '\''no'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg archive_on_send '{ ${'\''zarafa-spooler'\''}{archive_on_send} || '\''no'\''; }'
 
  
  
#
+
/bin/echo "webaccess config"
#--- monitor config ---
+
/bin/chown -R www:www /var/lib/zarafa-webaccess/tmp
#
+
/bin/chown -R www:www /var/lib/zarafa-webapp/tmp
echo
+
FILE=/etc/httpd/conf.d/zarafa-webaccess.conf; if [ -a $FILE ]; then /bin/rm -f $FILE; fi
echo "Creating zarafa-monitor-configuration-template ..."
+
FILE=/etc/httpd/conf.d/zarafa-webapp.conf; if [ -a $FILE ]; then /bin/rm -f $FILE; fi
echo "The monitor program sends quota warning mails to users who are over quota."
+
 
echo
+
 
mkdir -p /etc/e-smith/templates/etc/zarafa/monitor.cfg
+
/bin/echo "Expanding Zarafa-templates"
cat /usr/share/doc/zarafa-monitor/example-config/monitor.cfg | sed -e 's/\r$//g' >  /etc/e-smith/templates/etc/zarafa/monitor.cfg/monitor.cfg
+
/etc/e-smith/events/actions/zarafa-expand-templates
replace /etc/e-smith/templates/etc/zarafa/monitor.cfg/monitor.cfg log_method '{ ${'\''zarafa-monitor'\''}{log_method} || '\''file'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/monitor.cfg/monitor.cfg log_level '{ ${'\''zarafa-monitor'\''}{log_level} || '\''2'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/monitor.cfg/monitor.cfg log_timestamp '{ ${'\''zarafa-monitor'\''}{log_timestamp} || '\''1'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/monitor.cfg/monitor.cfg quota_check_interval '{ ${'\''zarafa-monitor'\''}{quota_check_interval} || '\''15'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/monitor.cfg/monitor.cfg mailquota_resend_interval '{ ${'\''zarafa-monitor'\''}{mailquota_resend_interval} || '\''1'\''; }'
 
  
 +
/bin/echo "Expanding http.conf-template"
 +
/sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf
  
#
+
/bin/echo "Restarting httpd"
#--- gateway config ---
+
/usr/bin/sv restart /service/httpd-e-smith
#
 
echo
 
echo "Creating zarafa-gateway-configuration-template ..."
 
echo
 
mkdir -p /etc/e-smith/templates/etc/zarafa/gateway.cfg
 
cat /usr/share/doc/zarafa-gateway/example-config/gateway.cfg | sed -e 's/\r$//g' >  /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg
 
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg server_socket 'http://localhost:{${'\''zarafa-server'\''}{TCPPort}||'\''236'\'';}/zarafa'
 
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg pop3_enable '{ if (${'\''zarafa-pop3'\''}{status} eq '\''enabled'\'') {'\''yes'\''} else {'\''no'\''}; }'
 
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg pop3_port '{ ${'\''zarafa-pop3'\''}{TCPPort} || '\''8110'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg pop3s_enable '{ if (${'\''zarafa-pop3s'\''}{status} eq '\''enabled'\'') {'\''yes'\''} else {'\''no'\''}; }'
 
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg pop3s_port '{ ${'\''zarafa-pop3s'\''}{TCPPort} || '\''8995'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg imap_enable '{ if (${'\''zarafa-imap'\''}{status} eq '\''enabled'\'') {'\''yes'\''} else {'\''no'\''}; }'
 
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg imap_port '{ ${'\''zarafa-imap'\''}{TCPPort} || '\''8143'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg imaps_enable '{ if (${'\''zarafa-imaps'\''}{status} eq '\''enabled'\'') {'\''yes'\''} else {'\''no'\''}; }'
 
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg imaps_port '{ ${'\''zarafa-imaps'\''}{TCPPort} || '\''8993'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg imap_only_mailfolders '{ ${'\''zarafa-imap'\''}{imap_only_mailfolders} || '\''yes'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg imap_public_folders '{ ${'\''zarafa-imap'\''}{imap_public_folders} || '\''yes'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg imap_capability_idle '{ ${'\''zarafa-imap'\''}{imap_capability_idle} || '\''yes'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg imap_max_messagesize '{ ${'\''zarafa-imap'\''}{imap_max_messagesize} || '\''134217728'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg imap_generate_utf8 '{ ${'\''zarafa-imap'\''}{imap_generate_utf8} || '\''no'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg imap_expunge_on_delete '{ ${'\''zarafa-imap'\''}{imap_expunge_on_delete} || '\''no'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg imap_store_rfc822 '{ ${'\''zarafa-imap'\''}{imap_store_rfc822} || '\''yes'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg ssl_private_key_file '/home/e-smith/ssl.key/{$SystemName}.{$DomainName}.key'
 
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg ssl_certificate_file '/home/e-smith/ssl.crt/{$SystemName}.{$DomainName}.crt'
 
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg ssl_verify_client '{ ${'\''zarafa-gateway'\''}{ssl_verify_client} || '\''no'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg process_model '{ ${'\''zarafa-gateway'\''}{process_model} || '\''fork'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg log_method '{ ${'\''zarafa-gateway'\''}{log_method} || '\''file'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg log_level '{ ${'\''zarafa-gateway'\''}{log_level} || '\''2'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg log_timestamp '{ ${'\''zarafa-gateway'\''}{log_timestamp} || '\''1'\''; }'
 
  
 +
/bin/echo "Starting Zarafa-services"
 +
/etc/e-smith/events/actions/zarafa-services start
  
#
+
/bin/echo "Setting permissions on files"
#--- ical config ---
+
FILE=/var/log/zarafa/dagent.log; if [ -a $FILE ]; then /bin/chmod 666 $FILE; fi
#
+
</nowiki>
echo
 
echo "Creating zarafa-ical-configuration-template ..."
 
echo
 
mkdir -p /etc/e-smith/templates/etc/zarafa/ical.cfg
 
cat /usr/share/doc/zarafa-ical/example-config/ical.cfg | sed -e 's/\r$//g' >  /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg
 
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg ical_enable '{ if (${'\''zarafa-ical'\''}{status} eq '\''enabled'\'') {'\''yes'\''} else {'\''no'\''}; }'
 
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg ical_port '{ ${'\''zarafa-ical'\''}{TCPPort} || '\''8088'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg icals_enable '{ if (${'\''zarafa-icals'\''}{status} eq '\''enabled'\'') {'\''yes'\''} else {'\''no'\''}; }'
 
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg icals_port '{ ${'\''zarafa-icals'\''}{TCPPort} || '\''8089'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg server_socket 'http://localhost:{${'\''zarafa-server'\''}{TCPPort}||'\''236'\'';}/zarafa'
 
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg process_model '{ ${'\''zarafa-ical'\''}{process_model} || '\''fork'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg log_method '{ ${'\''zarafa-ical'\''}{log_method} || '\''file'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg log_level '{ ${'\''zarafa-ical'\''}{log_level} || '\''2'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg log_timestamp '{ ${'\''zarafa-ical'\''}{log_timestamp} || '\''1'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg ssl_private_key_file '/home/e-smith/ssl.key/{$SystemName}.{$DomainName}.key'
 
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg ssl_certificate_file '/home/e-smith/ssl.crt/{$SystemName}.{$DomainName}.crt'
 
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg ssl_verify_client '{ ${'\''zarafa-ical'\''}{ssl_verify_client} || '\''no'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg server_timezone '{$TimeZone}'
 
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg default_charset '{ ${'\''zarafa-ical'\''}{default_charset} || '\''utf-8'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg enable_ical_get '{ ${'\''zarafa-ical'\''}{enable_ical_get} || '\''yes'\''; }'
 
  
 +
===== To save : =====
 +
CTRL + X
 +
yes
 +
<ENTER>
  
#
+
===== Execute zarafa-update =====
#--- indexer config ---
 
#
 
echo
 
echo "Creating zarafa-indexer-configuration-template ..."
 
echo
 
mkdir -p /etc/e-smith/templates/etc/zarafa/indexer.cfg
 
cat /usr/share/doc/zarafa-indexer/example-config/indexer.cfg | sed -e 's/\r$//g' >  /etc/e-smith/templates/etc/zarafa/indexer.cfg/indexer.cfg
 
replace /etc/e-smith/templates/etc/zarafa/indexer.cfg/indexer.cfg cleanup_lockfiles '{ ${'\''zarafa-indexer'\''}{cleanup_lockfiles} || '\''no'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/indexer.cfg/indexer.cfg limit_results '{ ${'\''zarafa-indexer'\''}{limit_results} || '\''0'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/indexer.cfg/indexer.cfg log_method '{ ${'\''zarafa-indexer'\''}{log_method} || '\''file'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/indexer.cfg/indexer.cfg log_level '{ ${'\''zarafa-indexer'\''}{log_level} || '\''2'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/indexer.cfg/indexer.cfg log_timestamp '{ ${'\''zarafa-indexer'\''}{log_timestamp} || '\''1'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/indexer.cfg/indexer.cfg index_interval '{ ${'\''zarafa-indexer'\''}{index_interval} || '\''5'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/indexer.cfg/indexer.cfg index_threads '{ ${'\''zarafa-indexer'\''}{index_threads} || '\''1'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/indexer.cfg/indexer.cfg index_max_field_length '{ ${'\''zarafa-indexer'\''}{index_max_field_length} || '\''10000'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/indexer.cfg/indexer.cfg index_merge_factor '{ ${'\''zarafa-indexer'\''}{index_merge_factor} || '\''10'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/indexer.cfg/indexer.cfg index_max_buffered_docs '{ ${'\''zarafa-indexer'\''}{index_max_buffered_docs} || '\''10'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/indexer.cfg/indexer.cfg index_min_merge_docs '{ ${'\''zarafa-indexer'\''}{index_min_merge_docs} || '\''10'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/indexer.cfg/indexer.cfg index_max_merge_docs '{ ${'\''zarafa-indexer'\''}{index_max_merge_docs} || '\''2147483647'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/indexer.cfg/indexer.cfg index_term_interval '{ ${'\''zarafa-indexer'\''}{index_term_interval} || '\''128'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/indexer.cfg/indexer.cfg index_cache_timeout '{ ${'\''zarafa-indexer'\''}{index_cache_timeout} || '\''0'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/indexer.cfg/indexer.cfg index_attachments '{ ${'\''zarafa-indexer'\''}{index_attachments} || '\''no'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/indexer.cfg/indexer.cfg index_attachment_max_size '{ ${'\''zarafa-indexer'\''}{index_attachment_max_size} || '\''5120'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/indexer.cfg/indexer.cfg index_attachment_parser_max_memory '{ ${'\''zarafa-indexer'\''}{index_attachment_parser_max_memory} || '\''0'\''; }'
 
replace /etc/e-smith/templates/etc/zarafa/indexer.cfg/indexer.cfg index_attachment_parser_max_cputime '{ ${'\''zarafa-indexer'\''}{index_attachment_parser_max_cputime} || '\''0'\''; }'
 
  
 +
cd /etc/e-smith/events/actions/
  
/bin/echo "webaccess config"
+
./zarafa-update
/bin/chown -R www:www /var/lib/zarafa-webaccess/tmp
 
/bin/chown -R www:www /var/lib/zarafa-webapp/tmp
 
FILE=/etc/httpd/conf.d/zarafa-webaccess.conf; if [ -a $FILE ]; then /bin/rm -f $FILE; fi
 
FILE=/etc/httpd/conf.d/zarafa-webapp.conf; if [ -a $FILE ]; then /bin/rm -f $FILE; fi
 
  
 +
===== Only if you are upgrading from zcp 7.0.x to 7.1.x -> nano -w /etc/e-smith/events/actions/zarafa-update-to71 : =====
 +
<nowiki>
 +
#!/usr/bin/env bash
 +
clear
  
/bin/echo "Expanding Zarafa-templates"
+
/bin/echo "Stopping the Zarafa-services"
/etc/e-smith/events/actions/zarafa-expand-templates
+
/etc/e-smith/events/actions/zarafa-services stop
  
/bin/echo "Expanding http.conf-template"
+
if [ `whoami` != "root" ]; then
/sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf
+
echo "This installation must be run as user root."
 +
echo "Become root, and run this script again."
 +
echo
 +
exit 1
 +
fi
  
/bin/echo "Restarting httpd"
+
##########################################
/usr/bin/sv restart /service/httpd-e-smith
+
# Creating some Zarafa-actions
 +
##########################################
  
/bin/echo "Starting Zarafa-services"
+
#
/etc/e-smith/events/actions/zarafa-services start
+
#--- zarafa-expand-templates ---
 +
#
 +
echo
 +
echo "Creating zarafa-expand-templates-action ..."
 +
echo
 +
cat <<HERE1 > /etc/e-smith/events/actions/zarafa-expand-templates
 +
#!/bin/sh
 +
/sbin/e-smith/expand-template /etc/zarafa/gateway.cfg
 +
/sbin/e-smith/expand-template /etc/zarafa/ical.cfg
 +
/sbin/e-smith/expand-template /etc/zarafa/server.cfg
 +
/sbin/e-smith/expand-template /etc/zarafa/unix.cfg
 +
/sbin/e-smith/expand-template /etc/zarafa/monitor.cfg
 +
/sbin/e-smith/expand-template /etc/zarafa/search.cfg
 +
/sbin/e-smith/expand-template /etc/zarafa/spooler.cfg
 +
/sbin/e-smith/expand-template /etc/zarafa/dagent.cfg
 +
/sbin/e-smith/expand-template /etc/zarafa/licensed.cfg
 +
/etc/e-smith/events/actions/qmail-update-user
 +
HERE1
  
/bin/echo "Setting permissions on files"
 
FILE=/var/log/zarafa/dagent.log; if [ -a $FILE ]; then /bin/chmod 666 $FILE; fi
 
</nowiki>
 
  
=== To save : ===
+
#
CTRL + X
+
#--- zarafa-services ---
yes
+
#
<ENTER>
+
echo
 
+
echo "Creating zarafa-services-action ..."
== Execute zarafa-install (see script above) ==
+
echo
 
+
cat <<HERE2 > /etc/e-smith/events/actions/zarafa-services
/bin/chmod 554 /etc/e-smith/events/actions/zarafa-install
+
#!/bin/sh
 
+
FILE=/etc/rc.d/init.d/zarafa-licensed
  cd /etc/e-smith/events/actions/
+
if [ "\$1" == start ]; then
 
+
  /etc/rc.d/init.d/zarafa-dagent start
  ./zarafa-install
+
/etc/rc.d/init.d/zarafa-gateway start
 
+
  /etc/rc.d/init.d/zarafa-ical start
  signal-event post-upgrade; signal-event reboot
+
  if [ -a \$FILE ]; then \$FILE start; fi
 
+
/etc/rc.d/init.d/zarafa-monitor start
= UPGRADING of Zarafa (7.0.x -> 7.0.x) =
+
/etc/rc.d/init.d/zarafa-spooler start
== Download via the Zarafawebsite the package for ZCP corresponding with the newest php53-mapi.rpm (cf. version above) ==
+
/etc/rc.d/init.d/zarafa-search start
 
+
/etc/rc.d/init.d/zarafa-server start
cd /to an installdirectory, ex. : /root/InstallZarafa
+
exit 0
 
+
fi
  wget http://download.zarafa.com/community/final/7.0/[version]/zcp-[version]-rhel-5-[cpu-arch]-free.tar.gz
+
if [ "\$1" == stop ]; then
 
+
/etc/rc.d/init.d/zarafa-dagent stop
== Unpack the corresponding package for ZCP :==
+
  /etc/rc.d/init.d/zarafa-gateway stop
 
+
/etc/rc.d/init.d/zarafa-ical stop
Go (cd /...) to the installdirectory (if you haven't done this yet) :
+
if [ -a \$FILE ]; then \$FILE stop; fi
 
+
/etc/rc.d/init.d/zarafa-search stop
  cd /to the installdirectory
+
/etc/rc.d/init.d/zarafa-spooler stop
 
+
/etc/rc.d/init.d/zarafa-server stop
And unpack :
+
  /etc/rc.d/init.d/zarafa-monitor stop 
 
+
  exit 0
  tar -zxvf zcp-*
+
fi
 
+
if [ "\$1" == restart ]; then
== Go (cd ./zcp-...) to the created subdirectory (zcp-...) :==
+
  /etc/rc.d/init.d/zarafa-dagent stop
 
+
/etc/rc.d/init.d/zarafa-gateway stop
  cd ./zcp- ...
+
/etc/rc.d/init.d/zarafa-ical stop
 
+
if [ -a \$FILE ]; then \$FILE stop; fi
  '''Remove the devel packages'''
+
  /etc/rc.d/init.d/zarafa-monitor stop
  '''Move the windows-directory to an installshare in your network'''
+
/etc/rc.d/init.d/zarafa-search stop
 
+
  /etc/rc.d/init.d/zarafa-spooler stop
== Download the latest webapp.rpm too in the same subdirectory :==
+
  /etc/rc.d/init.d/zarafa-server stop
 
+
/etc/rc.d/init.d/zarafa-dagent start
  wget http://download.zarafa.com/community/final/WebApp/[version]/rhel/[zarafa-webapp-version.noarch.rpm]
+
  /etc/rc.d/init.d/zarafa-gateway start
 
+
/etc/rc.d/init.d/zarafa-ical start
== Remove the existing php53-mapi.rpm first : ==
+
if [ -a \$FILE ]; then \$FILE start; fi
 
+
/etc/rc.d/init.d/zarafa-monitor start
  rpm -e php53-mapi --nodeps
+
/etc/rc.d/init.d/zarafa-server start
 
+
  /etc/rc.d/init.d/zarafa-spooler start
== Install all rpm's in the unpacked package of ZCP and the webapp.rpm too :==
+
/etc/rc.d/init.d/zarafa-search start
 
+
  exit 0
  yum localinstall *.rpm
+
fi
 
+
if [ "\$1" == enabled ]; then
All packages have dependencies that cannot be resolved if you install only part of the rpm's.
+
config setprop zarafa-gateway status enabled
 
+
  config setprop zarafa-ical status enabled
If you only want to upgrade one package (ex. the Webapp) :
+
  if [ -a \$FILE ]; then config setprop zarafa-licensed status enabled; fi
 
+
config setprop zarafa-monitor status enabled
  cd /to the new Webapp.rpm
+
config setprop zarafa-server status enabled
  rpm -Uvh --force zarafa-webapp-[version].noarch
+
config setprop zarafa-spooler status enabled
 
+
config setprop zarafa-search status enabled
== Remove the default php-mapi.rpm ==
+
config setprop zarafa-dagent status enabled
 
+
  exit 0
We have to remove the installation of the default php-mapi (because it's not built for php 5.3).
+
fi
 
+
if [ "\$1" == disabled ]; then
  rpm -e php-mapi --nodeps
+
config setprop zarafa-gateway status disabled
 
+
config setprop zarafa-ical status disabled
== Install the php53-mapi.rpm ==
+
if [ -a \$FILE ]; then config setprop zarafa-licensed status disabled; fi
 
+
config setprop zarafa-monitor status disabled
Install the php53-mapi.rpm of the EPEL-repository :
+
config setprop zarafa-server status disabled
 
+
config setprop zarafa-spooler status disabled
-If you downloaded the rpm :
+
  config setprop zarafa-search status disabled
 
+
config setprop zarafa-dagent status disabled
  rpm -Uvh --force php53-mapi
+
exit 0
 
+
fi
-If you did set the EPEL-repository :
+
echo "Usage: start|stop|restart|enabled|disabled"
 
+
exit 0
yum install php53-mapi --enablerepo=epel --enablerepo=epel-testing
+
HERE2
  
== Execute zarafa-update (see script above !!!!) ==
+
/bin/chmod 554 /etc/e-smith/events/actions/zarafa-expand-templates
 +
/bin/chmod 554 /etc/e-smith/events/actions/zarafa-services
  
cd /etc/e-smith/events/actions/
+
######################################
 +
# Setting up SME-db-entries
 +
######################################
  
./zarafa-update
+
/sbin/e-smith/db configuration set zarafa-search service status enabled
  
OPTIONAL : Search in the Zarafa-releasenotes for new keys/options in the config-files and adjust the values of these new keys/options in the zarafa-config-templates :
+
######################################
 +
# Setting up more symbolic links
 +
######################################
  
http://doc.zarafa.com/7.0/Release_Notes/en-US/html-single/
+
/bin/echo
 +
/bin/echo "Setting up more symbolic links"
 +
/bin/echo
  
signal-event post-upgrade; signal-event reboot
+
ln -s /etc/rc.d/init.d/e-smith-service /etc/rc.d/rc7.d/S99zarafa-search
  
= INSTALLATION of Z-push (1.5.x or 2.0.x) =
+
/bin/echo "Expanding Zarafa-templates"
== VERSION 1.5 ==
+
/etc/e-smith/events/actions/zarafa-expand-templates
=== Download the Z-push-package (version 1.5 !!)===
 
  
wget http://zarafa-deutschland.de/z-push-download/final/1.5/[z-push-latest version]
+
/bin/echo "Expanding http.conf-template"
 +
/sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf
  
Save in an installdirectory, ex. : root/InstallZPush
+
/bin/echo "Restarting httpd"
 +
/usr/bin/sv restart /service/httpd-e-smith
  
=== Unpack the package for Z-push :===
+
/bin/echo "Starting Zarafa-services"
 +
/etc/e-smith/events/actions/zarafa-services start
 +
</nowiki>
  
Go (cd /...) to the installdirectory (if you haven't done this yet) :  
+
===== To save : =====
 +
<nowiki>
  
cd /to the installdirectory
+
  CTRL + X
 
+
  yes
And unpack :
 
 
 
tar -zxvf z-push-[latest version] -C /var/www/html
 
 
 
=== Change the name of the created z-push-directory in /var/www/html to 'z-push'===
 
 
 
=== nano -w /etc/e-smith/events/actions/z-push-install ===
 
<nowiki>
 
#!/bin/sh
 
 
 
#
 
#--- /etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/29ZarafaAliases ---
 
#
 
echo
 
echo "Creating /etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/29ZarafaAliases ..."
 
echo
 
cat <<HERE1 > /etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/29ZarafaAliases
 
{
 
    # vim: ft=perl:
 
 
 
    \$haveSSL = (exists \${modSSL}{status} and \${modSSL}{status} eq "enabled") ?  'yes' : 'no';
 
    my \$zwebmailStatus = \$zarafa{'status'} || "disabled";
 
    my \$zwebmailAccessType = \$zarafa{'access'} || "SSL";
 
 
 
    my \$dirs;
 
    \$dirs{zarafa} = '/usr/share/zarafa-webaccess';
 
    \$dirs{webaccess} = '/usr/share/zarafa-webaccess';
 
    \$dirs{webmail} = '/usr/share/zarafa-webaccess';
 
    if (\$imp{'status'} eq 'enabled') {\$dirs{webmail} = ''};
 
    \$dirs{webapp} = '/usr/share/zarafa-webapp';
 
    \$dirs{'Microsoft-Server-ActiveSync'} = '/var/www/html/z-push/index.php';
 
 
 
    return "    # Zarafa is disabled in this VirtualHost\n"
 
                unless \$zwebmailStatus eq 'enabled';
 
 
 
    foreach \$place ('zarafa','webmail','webaccess','webapp','Microsoft-Server-ActiveSync')
 
    {
 
        if ((\$port eq "80") && (\$haveSSL eq 'yes') && (\$zwebmailAccessType eq 'SSL'))
 
        {
 
            \$OUT .= "    RewriteRule ^/\$place(/.*|\\$)    https://%{HTTP_HOST}/\$place\\\$1 [L,R]\n";
 
        } else {
 
            if ((\$dirs{\$place}) ne '') {\$OUT .= "    Alias /\$place  \$dirs{\$place}\n"};
 
        }
 
    }
 
}
 
HERE1
 
 
 
#
 
#--- /etc/e-smith/templates/etc/httpd/conf/httpd.conf/86ZarafaAlias ---
 
#
 
echo
 
echo "Creating /etc/e-smith/templates/etc/httpd/conf/httpd.conf/86ZarafaAlias ..."
 
echo
 
cat <<HERE2 > /etc/e-smith/templates/etc/httpd/conf/httpd.conf/86ZarafaAlias
 
{
 
    my \$zstatus = \$zarafa{'status'};
 
 
 
    if (defined \$zstatus && \$zstatus eq 'enabled')
 
    {
 
        \$OUT .= qq(
 
#--------------------------------------------------------------------
 
# Zarafa specific configuration files.
 
#--------------------------------------------------------------------
 
 
 
Alias /zarafa /usr/share/zarafa-webaccess/
 
<Directory /usr/share/zarafa-webaccess/>
 
  Options -Indexes
 
  AllowOverride All
 
  order allow,deny
 
  allow from all
 
  AddType application/x-httpd-php .php
 
  php_flag magic_quotes_gpc off
 
  php_flag track_vars on
 
</Directory>
 
 
 
Alias /webapp /usr/share/zarafa-webapp/
 
<Directory /usr/share/zarafa-webapp/>
 
  Options -Indexes
 
  AllowOverride All
 
  order allow,deny
 
  allow from all
 
  AddType application/x-httpd-php .php
 
  php_flag magic_quotes_gpc off
 
  php_flag track_vars on
 
</Directory>
 
   
 
<Directory /var/www/html/>
 
    Options -Indexes
 
    AllowOverride All
 
    order allow,deny
 
    allow from all
 
    AddType application/x-httpd-php .php .php3
 
    php_flag  magic_quotes_gpc  off
 
</Directory>
 
 
 
<Directory /var/www/html/z-push/>
 
  Options -Indexes
 
  AllowOverride All
 
  order allow,deny
 
  allow from all
 
  AddType application/x-httpd-php .php
 
  php_flag magic_quotes_gpc off
 
  php_flag register_globals off
 
  php_flag magic_quotes_runtime off
 
  php_flag short_open_tag on
 
</Directory>
 
 
 
);
 
    }   
 
    else
 
    {
 
      \$OUT .= "# Zarafa Webmail is not configured as it is disabled in the config db";
 
    }
 
}
 
HERE2
 
 
 
######################################
 
# Configuration of Z-push
 
######################################
 
 
 
/bin/echo
 
/bin/echo "Configuration of Z-push"
 
/bin/echo
 
FILE=/var/www/html/z-push/state; if [ -d $FILE ]; then /bin/chown -R www:www $FILE; fi
 
FILE=/var/www/html/z-push/state; if [ -d $FILE ]; then /bin/chmod 755 $FILE; fi
 
 
 
/bin/echo
 
/bin/echo "Need to debug Z-push ?"
 
/bin/echo "Values: yes or no."
 
/bin/echo
 
read DEBUGZPUSH
 
if [ "$DEBUGZPUSH" == yes ]; then
 
FILE=/var/www/html/z-push/state; if [ -d $FILE ]; then /bin/touch /var/www/html/z-push/debug.txt; fi
 
FILE=/var/www/html/z-push/state; if [ -d $FILE ]; then /bin/chown www:www /var/www/html/z-push/debug.txt; fi
 
FILE=/var/www/html/z-push/state; if [ -d $FILE ]; then /bin/chmod 755 /var/www/html/z-push/debug.txt; fi
 
else
 
rm -f /var/www/html/z-push/debug.txt
 
fi
 
 
 
/bin/echo
 
/bin/echo "Expanding http.conf-template"
 
/bin/echo
 
/sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf
 
 
 
/bin/echo
 
/bin/echo "Restarting httpd"
 
/bin/echo
 
/usr/bin/sv restart /service/httpd-e-smith
 
 
 
</nowiki>
 
 
 
=== To save : ===
 
CTRL + X
 
yes
 
<ENTER>
 
 
 
=== nano -w /etc/e-smith/events/actions/z-push-update ===
 
<nowiki>
 
#!/bin/sh
 
 
 
######################################
 
# Configuration of Z-push
 
######################################
 
 
 
/bin/echo
 
/bin/echo "Configuration of Z-push"
 
/bin/echo
 
FILE=/var/www/html/z-push/state; if [ -d $FILE ]; then /bin/chown -R www:www $FILE; fi
 
FILE=/var/www/html/z-push/state; if [ -d $FILE ]; then /bin/chmod 755 $FILE; fi
 
 
 
/bin/echo
 
/bin/echo "Need to debug Z-push ?"
 
/bin/echo "Values: yes or no."
 
/bin/echo
 
read DEBUGZPUSH
 
if [ "$DEBUGZPUSH" == yes ]; then
 
FILE=/var/www/html/z-push/state; if [ -d $FILE ]; then /bin/touch /var/www/html/z-push/debug.txt; fi
 
FILE=/var/www/html/z-push/state; if [ -d $FILE ]; then /bin/chown www:www /var/www/html/z-push/debug.txt; fi
 
FILE=/var/www/html/z-push/state; if [ -d $FILE ]; then /bin/chmod 755 /var/www/html/z-push/debug.txt; fi
 
else
 
rm -f /var/www/html/z-push/debug.txt
 
fi
 
 
 
/bin/echo
 
/bin/echo "Expanding http.conf-template"
 
/bin/echo
 
/sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf
 
 
 
/bin/echo
 
/bin/echo "Restarting httpd"
 
/bin/echo
 
/usr/bin/sv restart /service/httpd-e-smith
 
 
 
</nowiki>
 
 
 
=== To save : ===
 
CTRL + X
 
yes
 
<ENTER>
 
 
 
=== See further : "Any version" ===
 
 
 
== VERSION 2.0 ==
 
=== Download the Z-push-package (version 2.0 !!)===
 
wget http://zarafa-deutschland.de/z-push-download/final/2.0/[z-push-latest version]
 
 
 
Save in an installdirectory, ex. : root/InstallZPush
 
 
 
=== Unpack the package for Z-push :===
 
Go (cd /...) to the installdirectory (if you haven't done this yet) :
 
 
 
cd /to the installdirectory
 
 
 
And unpack :
 
 
 
tar -zxvf z-push-[latest version] -C /usr/share
 
 
 
=== Change the name of the created z-push-directory in /usr/share to 'z-push' ===
 
 
 
=== nano -w /etc/e-smith/events/actions/z-push-install ===
 
<nowiki>
 
#!/bin/sh
 
 
 
#
 
#--- /etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/29ZarafaAliases ---
 
#
 
echo
 
echo "Creating /etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/29ZarafaAliases ..."
 
echo
 
cat <<HERE1 > /etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/29ZarafaAliases
 
{
 
    # vim: ft=perl:
 
 
 
    \$haveSSL = (exists \${modSSL}{status} and \${modSSL}{status} eq "enabled") ?  'yes' : 'no';
 
    my \$zwebmailStatus = \$zarafa{'status'} || "disabled";
 
    my \$zwebmailAccessType = \$zarafa{'access'} || "SSL";
 
 
 
    my \$dirs;
 
    \$dirs{zarafa} = '/usr/share/zarafa-webaccess';
 
    \$dirs{webaccess} = '/usr/share/zarafa-webaccess';
 
    \$dirs{webmail} = '/usr/share/zarafa-webaccess';
 
    if (\$imp{'status'} eq 'enabled') {\$dirs{webmail} = ''};
 
    \$dirs{webapp} = '/usr/share/zarafa-webapp';
 
    \$dirs{'Microsoft-Server-ActiveSync'} = '/usr/share/z-push/index.php';
 
 
 
    return "    # Zarafa is disabled in this VirtualHost\n"
 
                unless \$zwebmailStatus eq 'enabled';
 
 
 
    foreach \$place ('zarafa','webmail','webaccess','webapp','Microsoft-Server-ActiveSync')
 
    {
 
        if ((\$port eq "80") && (\$haveSSL eq 'yes') && (\$zwebmailAccessType eq 'SSL'))
 
        {
 
            \$OUT .= "    RewriteRule ^/\$place(/.*|\\$)    https://%{HTTP_HOST}/\$place\\\$1 [L,R]\n";
 
        } else {
 
            if ((\$dirs{\$place}) ne '') {\$OUT .= "    Alias /\$place  \$dirs{\$place}\n"};
 
        }
 
    }
 
}
 
HERE1
 
 
 
#
 
#--- /etc/e-smith/templates/etc/httpd/conf/httpd.conf/86ZarafaAlias ---
 
#
 
echo
 
echo "Creating /etc/e-smith/templates/etc/httpd/conf/httpd.conf/86ZarafaAlias ..."
 
echo
 
cat <<HERE2 > /etc/e-smith/templates/etc/httpd/conf/httpd.conf/86ZarafaAlias
 
{
 
    my \$zstatus = \$zarafa{'status'};
 
 
 
    if (defined \$zstatus && \$zstatus eq 'enabled')
 
    {
 
        \$OUT .= qq(
 
#--------------------------------------------------------------------
 
# Zarafa specific configuration files.
 
#--------------------------------------------------------------------
 
 
 
Alias /zarafa /usr/share/zarafa-webaccess/
 
<Directory /usr/share/zarafa-webaccess/>
 
  Options -Indexes
 
  AllowOverride All
 
  order allow,deny
 
  allow from all
 
  AddType application/x-httpd-php .php
 
  php_flag magic_quotes_gpc off
 
  php_flag track_vars on
 
</Directory>
 
 
 
Alias /webapp /usr/share/zarafa-webapp/
 
<Directory /usr/share/zarafa-webapp/>
 
  Options -Indexes
 
  AllowOverride All
 
  order allow,deny
 
  allow from all
 
  AddType application/x-httpd-php .php
 
  php_flag magic_quotes_gpc off
 
  php_flag track_vars on
 
</Directory>
 
 
 
<Directory /usr/share/z-push/>
 
  Options -Indexes
 
  AllowOverride All
 
  order allow,deny
 
  allow from all
 
  AddType application/x-httpd-php .php .php3
 
  php_flag magic_quotes_gpc off
 
  php_flag register_globals off
 
  php_flag magic_quotes_runtime off
 
  php_flag short_open_tag on
 
</Directory>
 
 
 
);
 
    }   
 
    else
 
    {
 
      \$OUT .= "# Zarafa Webmail is not configured as it is disabled in the config db";
 
    }
 
}
 
HERE2
 
 
 
######################################
 
# Configuration of Z-push
 
######################################
 
 
 
/bin/echo
 
/bin/echo "Configuration of Z-push"
 
/bin/echo
 
mkdir -p /var/lib/z-push
 
mkdir -p /var/log/z-push
 
FILE=/var/lib/z-push; if [ -d $FILE ]; then /bin/chown -R www:www $FILE; fi
 
FILE=/var/lib/z-push; if [ -d $FILE ]; then /bin/chmod 755 $FILE; fi
 
FILE=/var/log/z-push; if [ -d $FILE ]; then /bin/chown -R www:www $FILE; fi
 
FILE=/var/log/z-push; if [ -d $FILE ]; then /bin/chmod 755 $FILE; fi
 
 
 
/bin/echo
 
/bin/echo "Expanding http.conf-template"
 
/bin/echo
 
/sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf
 
 
 
/bin/echo
 
/bin/echo "Restarting httpd"
 
/bin/echo
 
/usr/bin/sv restart /service/httpd-e-smith
 
 
 
</nowiki>
 
 
 
=== To save : ===
 
  CTRL + X
 
  yes
 
 
  <ENTER>
 
  <ENTER>
 +
</nowiki>
  
=== nano -w /etc/e-smith/events/actions/z-push-update ===
+
===== Execute zarafa-update-to71 =====
<nowiki>
 
#!/bin/sh
 
 
 
######################################
 
# Configuration of Z-push
 
######################################
 
 
 
/bin/echo
 
/bin/echo "Configuration of Z-push"
 
/bin/echo
 
mkdir -p /var/lib/z-push
 
mkdir -p /var/log/z-push
 
FILE=/var/lib/z-push; if [ -d $FILE ]; then /bin/chown -R www:www $FILE; fi
 
FILE=/var/lib/z-push; if [ -d $FILE ]; then /bin/chmod 755 $FILE; fi
 
FILE=/var/log/z-push; if [ -d $FILE ]; then /bin/chown -R www:www $FILE; fi
 
FILE=/var/log/z-push; if [ -d $FILE ]; then /bin/chmod 755 $FILE; fi
 
 
 
/bin/echo
 
/bin/echo "Expanding http.conf-template"
 
/bin/echo
 
/sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf
 
 
 
/bin/echo
 
/bin/echo "Restarting httpd"
 
/bin/echo
 
/usr/bin/sv restart /service/httpd-e-smith
 
 
 
</nowiki>
 
 
 
=== To save : ===
 
CTRL + X
 
yes
 
<ENTER>
 
 
 
=== See further : "Any version" ===
 
 
 
== ANY VERSION (1.5 or 2.0)==
 
=== Edit the config.php file in the Z-Push directory to fit your needs. ===
 
ex. Set your timezone in the config.php file.
 
 
 
=== Execute z-push-install (see script above !!!!) ===
 
  
  /bin/chmod 554 /etc/e-smith/events/actions/z-push-install
+
  /bin/chmod 554 /etc/e-smith/events/actions/zarafa-update-to71
  
 
  cd /etc/e-smith/events/actions/
 
  cd /etc/e-smith/events/actions/
  
  ./z-push-install
+
  ./zarafa-update-to71
  
= UPGRADING of Z-push =
+
  signal-event post-upgrade; signal-event reboot
== VERSION 1.5 (1.5.x -> 1.5.x)==
 
=== Download the Z-push-package (version 1.5 !!)===
 
 
 
wget http://zarafa-deutschland.de/z-push-download/final/1.5/[z-push-latest version]
 
 
 
Save in an installdirectory, ex. : root/InstallZPush
 
 
 
=== Unpack the corresponding package for ZCP and the package for Z-push :===
 
 
 
Go (cd /...) to the installdirectory (if you haven't done this yet) :
 
 
 
cd /to the installdirectory
 
 
 
And unpack :
 
 
 
tar -zxvf z-push-[latest version] -C /var/www/html
 
 
 
=== Change the name of the created z-push-directory in /var/www/html to 'z-push'===
 
=== See further : "Any version" ===
 
== VERSION 2.0 (2.0.x -> 2.0.x)==
 
=== Download the Z-push-package (version 2.0 !!)===
 
 
 
wget http://zarafa-deutschland.de/z-push-download/final/2.0/[z-push-latest version]
 
 
 
Save in an installdirectory, ex. : root/InstallZPush
 
 
 
 
 
=== Unpack the package for Z-push :===
 
 
 
Go (cd /...) to the installdirectory (if you haven't done this yet) :
 
 
 
  cd /to the installdirectory
 
 
 
And unpack :
 
 
 
tar -zxvf z-push-[latest version] -C /usr/share
 
 
 
=== Change the name of the created z-push-directory in /usr/share to 'z-push'===
 
=== See further : "Any version" ===
 
== VERSION 1.5 -> 2.0 ==
 
 
 
The easiest way to upgrade is to follow the steps for a new installation of version 2.0. The states of Z-Push 1.X are not compatible and there is no upgrade path, but as this version implements a fully automatic resynchronisation of devices it should not affect the users and work without the user interaction
 
 
 
== ANY VERSION ==
 
=== Edit the config.php file in the Z-Push directory to fit your needs. ===
 
ex. Set your timezone in the config.php file.
 
 
 
=== Execute z-push-update (see script above !!!!) ===
 
 
 
/bin/chmod 554 /etc/e-smith/events/actions/z-push-update
 
 
 
cd /etc/e-smith/events/actions/
 
 
 
./z-push-update
 

Latest revision as of 00:40, 23 April 2014

  • The first if-statement below from the "Creating SME-QMAIL-user-templates" section from the 'Zarafa Install Script' does not correctly handle the situation where GlobalForward is enabled but an account has the zarafa property set to disabled ...
{
   my \$zarafa = \$user->prop('zarafa') || 'disabled';
   my \$zarafa2 = \${'zarafa-server'}{GlobalForward} || 'disabled';

   if (\$zarafa eq 'enabled' || \$zarafa2 eq 'enabled')
   { return "| /usr/bin/zarafa-dagent -q \$USERNAME ; if [ \\$\\? -ne 0 ] ; then exit -1; else exit 99; fi;"
   }
}

Maybe this could work:

{
   my \$zarafa = \$user->prop('zarafa') || ' ';
   my \$zarafa2 = \${'zarafa-server'}{GlobalForward} || 'disabled';

   if ((\$zarafa ne 'disabled' && \$zarafa2 eq 'enabled') || (\$zarafa eq 'enabled' && \$zarafa2 eq 'disabled'))
   { return "| /usr/bin/zarafa-dagent -q \$USERNAME ; if [ \\$\\? -ne 0 ] ; then exit -1; else exit 99; fi;"
   }
}


  • On 64-bit systems there are a few symbolic links and path not correct after installation
if [ `getconf LONG_BIT` = "64" ]
then
   echo "64-bit, creating symbolic link"
   ln -s /usr/lib64/zarafa /usr/lib/zarafa
fi

and

/usr/lib/libcrypto.so.0.9.8
/usr/lib/libsssl.so.0.9.8

both link to /lib but should be /lib64

Installing 7.1.x (works for me. Please test in your environment)

This script takes the example-config-files of ZCP to make a SME-template from it (cf 'replace'-actions refering to SME-db)
7.1.x needs a few changes in server.cfg and a new search.cfg-template to replace the indexer.cfg-template : [1]

INSTALLSCRIPT (7.1.x)

nano -w /etc/e-smith/events/actions/zarafa-install
#!/usr/bin/env bash
clear

if [ `whoami` != "root" ]; then
	echo "This installation must be run as user root."
	echo "Become root, and run this script again."
	echo
	exit 1
fi

##########################################
# Creating some Zarafa-actions
##########################################

#
#--- zarafa-expand-templates ---
#
echo
echo "Creating zarafa-expand-templates-action ..."
echo
cat <<HERE1 > /etc/e-smith/events/actions/zarafa-expand-templates
#!/bin/sh
/sbin/e-smith/expand-template /etc/zarafa/gateway.cfg
/sbin/e-smith/expand-template /etc/zarafa/ical.cfg
/sbin/e-smith/expand-template /etc/zarafa/server.cfg
/sbin/e-smith/expand-template /etc/zarafa/unix.cfg
/sbin/e-smith/expand-template /etc/zarafa/monitor.cfg
/sbin/e-smith/expand-template /etc/zarafa/search.cfg
/sbin/e-smith/expand-template /etc/zarafa/spooler.cfg
/sbin/e-smith/expand-template /etc/zarafa/dagent.cfg
/sbin/e-smith/expand-template /etc/zarafa/licensed.cfg
/etc/e-smith/events/actions/qmail-update-user
HERE1


#
#--- zarafa-services ---
#
echo
echo "Creating zarafa-services-action ..."
echo
cat <<HERE2 > /etc/e-smith/events/actions/zarafa-services
#!/bin/sh
FILE=/etc/rc.d/init.d/zarafa-licensed
if [ "\$1" == start ]; then
 /etc/rc.d/init.d/zarafa-dagent start
 /etc/rc.d/init.d/zarafa-gateway start
 /etc/rc.d/init.d/zarafa-ical start
 if [ -a \$FILE ]; then \$FILE start; fi
 /etc/rc.d/init.d/zarafa-monitor start
 /etc/rc.d/init.d/zarafa-spooler start
 /etc/rc.d/init.d/zarafa-search start
 /etc/rc.d/init.d/zarafa-server start
 exit 0
fi
if [ "\$1" == stop ]; then
 /etc/rc.d/init.d/zarafa-dagent stop
 /etc/rc.d/init.d/zarafa-gateway stop
 /etc/rc.d/init.d/zarafa-ical stop
 if [ -a \$FILE ]; then \$FILE stop; fi
 /etc/rc.d/init.d/zarafa-search stop
 /etc/rc.d/init.d/zarafa-spooler stop
 /etc/rc.d/init.d/zarafa-server stop
 /etc/rc.d/init.d/zarafa-monitor stop  
 exit 0
fi
if [ "\$1" == restart ]; then
 /etc/rc.d/init.d/zarafa-dagent stop
 /etc/rc.d/init.d/zarafa-gateway stop
 /etc/rc.d/init.d/zarafa-ical stop
 if [ -a \$FILE ]; then \$FILE stop; fi
 /etc/rc.d/init.d/zarafa-monitor stop
 /etc/rc.d/init.d/zarafa-search stop
 /etc/rc.d/init.d/zarafa-spooler stop
 /etc/rc.d/init.d/zarafa-server stop
 /etc/rc.d/init.d/zarafa-dagent start
 /etc/rc.d/init.d/zarafa-gateway start
 /etc/rc.d/init.d/zarafa-ical start
 if [ -a \$FILE ]; then \$FILE start; fi
 /etc/rc.d/init.d/zarafa-monitor start
 /etc/rc.d/init.d/zarafa-server start
 /etc/rc.d/init.d/zarafa-spooler start
 /etc/rc.d/init.d/zarafa-search start
 exit 0
fi
if [ "\$1" == enabled ]; then
 config setprop zarafa-gateway status enabled
 config setprop zarafa-ical status enabled
 if [ -a \$FILE ]; then config setprop zarafa-licensed status enabled; fi
 config setprop zarafa-monitor status enabled
 config setprop zarafa-server status enabled
 config setprop zarafa-spooler status enabled
 config setprop zarafa-search status enabled
 config setprop zarafa-dagent status enabled
 exit 0
fi
if [ "\$1" == disabled ]; then
 config setprop zarafa-gateway status disabled
 config setprop zarafa-ical status disabled
 if [ -a \$FILE ]; then config setprop zarafa-licensed status disabled; fi
 config setprop zarafa-monitor status disabled
 config setprop zarafa-server status disabled
 config setprop zarafa-spooler status disabled
 config setprop zarafa-search status disabled
 config setprop zarafa-dagent status disabled
 exit 0
fi
echo "Usage: start|stop|restart|enabled|disabled"
exit 0
HERE2


#
#--- zarafa-create-user-action ---
#
echo
echo "Creating zarafa-create-user-action ..."
echo
cat <<HERE3 > /etc/e-smith/events/actions/zarafa-create-user
#!/bin/sh
clear
/bin/echo "Enter the username of the ZARAFA-user"
/bin/echo "If you have a multicompany-setup, format of the SME-username and the ZARAFA-username"
/bin/echo "has to be [username].[companyname] !!!"
read USERNAME
/bin/echo "Enter password:"
read PASSWORD
/bin/echo "Enter e-mail address:"
read EMAIL
/bin/echo "Enter full name:"
read FULLNAME
/bin/echo "Executing..."
/usr/bin/zarafa-admin -c "\$USERNAME" -p "\$PASSWORD" -e "\$EMAIL" -f "\$FULLNAME"
/usr/bin/zarafa-admin -l
/sbin/e-smith/db accounts setprop \$USERNAME zarafa enabled 
/etc/e-smith/events/actions/qmail-update-user
HERE3


#
#--- zarafa-create-company-action ---
#
echo
echo "Creating zarafa-create-company-action ..."
echo
cat <<HERE4 > /etc/e-smith/events/actions/zarafa-create-company
#!/bin/sh
clear
/bin/echo "Enter the companyname :"
read COMPANYNAME
/bin/echo "Executing..."
/usr/bin/zarafa-admin --create-company "\$COMPANYNAME"
HERE4


/bin/chmod 554 /etc/e-smith/events/actions/zarafa-expand-templates
/bin/chmod 554 /etc/e-smith/events/actions/zarafa-services
/bin/chmod 554 /etc/e-smith/events/actions/zarafa-create-user
/bin/chmod 554 /etc/e-smith/events/actions/zarafa-create-company

#
#--- zarafa-configuration-helper-action ---
#
echo
echo "Creating zarafa-configuration-helper-action ..."
echo
cat <<HERE5 > /etc/e-smith/events/actions/helpers.inc
# -*- Mode: sh -*-
replace() {
	file=\$1
	option=\$2
	value=\$3
	
	# escape &-signs, and % for sed
	value=\`echo \$value | sed -e 's/\&/\\\\\&/g' -e 's/\%/\\\\\%/g'\`
	sed -i -e "s%\([[:space:]]*\$option[[:space:]]*=[[:space:]]*\).*%\1\$value%" \$file

}
HERE5

. /etc/e-smith/events/actions/helpers.inc

##########################################
# Creating zarafa-db-creation-templates
##########################################

#
#--- /etc/e-smith/db/configuration/migrate/80zarafa ---
#
echo
echo "Creating /etc/e-smith/db/configuration/migrate/80zarafa ..."
echo
cat <<HERE6 > /etc/e-smith/db/configuration/migrate/80zarafa
{
    use MIME::Base64 qw(encode_base64);

    my \$rec = \$DB->get('zarafa-server') || \$DB->new_record('zarafa-server', {type => 'service'});

    my \$pw = \$rec->prop('DbPassword');
    return "" if \$pw;

    \$rec->set_prop('DbPassword', sprintf("%15.0f", int( (1000000000000000) * rand() )));
}
HERE6

#
#--- /etc/e-smith/templates/etc/e-smith/sql/init/80zarafa ---
#
echo
echo "Creating /etc/e-smith/templates/etc/e-smith/sql/init/80zarafa ..."
echo
cat <<HERE7 > /etc/e-smith/templates/etc/e-smith/sql/init/80zarafa
{
    my \$db = \${'zarafa-server'}{DbName} || 'zarafa';
    my \$user = \${'zarafa-server'}{DbUser} || 'zarafa';
    my \$pass = \${'zarafa-server'}{DbPassword} || 'changeme';
    \$OUT .= <<END
#! /bin/sh
    if [ -d /var/lib/mysql/\$db ]; then
      exit
    fi
    /usr/bin/mysql <<EOF
    CREATE DATABASE \$db DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
    use \$db;
 
    use mysql;
    GRANT ALL PRIVILEGES ON \$db.* TO \$user\@localhost
            IDENTIFIED BY '\$pass';
    flush privileges;
EOF
END
}
HERE7

#
#--- /etc/e-smith/templates.metadata/etc/e-smith/sql/init/80zarafa ---
#
echo
echo "Creating /etc/e-smith/templates.metadata/etc/e-smith/sql/init/80zarafa ..."
echo
cat <<HERE8 > /etc/e-smith/templates.metadata/etc/e-smith/sql/init/80zarafa
PERMS=0750
HERE8

##########################################
# Creating SME-HTTPD-templates
##########################################

#
#--- /etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/29ZarafaAliases ---
#
echo
echo "Creating /etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/29ZarafaAliases ..."
echo
cat <<HERE9 > /etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/29ZarafaAliases
{
    # vim: ft=perl:

    \$haveSSL = (exists \${modSSL}{status} and \${modSSL}{status} eq "enabled") ?  'yes' : 'no';
    my \$zwebmailStatus = \$zarafa{'status'} || "disabled";
    my \$zwebmailAccessType = \$zarafa{'access'} || "SSL";

    my \$dirs;
    \$dirs{zarafa} = '/usr/share/zarafa-webaccess';
    \$dirs{webaccess} = '/usr/share/zarafa-webaccess';
    \$dirs{webmail} = '/usr/share/zarafa-webaccess';
    if (\$imp{'status'} eq 'enabled') {\$dirs{webmail} = ''};
    \$dirs{webapp} = '/usr/share/zarafa-webapp';
   
    return "    # Zarafa is disabled in this VirtualHost\n"
                unless \$zwebmailStatus eq 'enabled';

    foreach \$place ('zarafa','webmail','webaccess','webapp')
    {
        if ((\$port eq "80") && (\$haveSSL eq 'yes') && (\$zwebmailAccessType eq 'SSL'))
        {
            \$OUT .= "    RewriteRule ^/\$place(/.*|\\$)    https://%{HTTP_HOST}/\$place\\\$1 [L,R]\n";
        } else {
            if ((\$dirs{\$place}) ne '') {\$OUT .= "    Alias	 /\$place   \$dirs{\$place}\n"};
        }
    }																		
}
HERE9

#
#--- /etc/e-smith/templates/etc/httpd/conf/httpd.conf/86ZarafaAlias ---
#
echo
echo "Creating /etc/e-smith/templates/etc/httpd/conf/httpd.conf/86ZarafaAlias ..."
echo
cat <<HERE10 > /etc/e-smith/templates/etc/httpd/conf/httpd.conf/86ZarafaAlias
{
    my \$zstatus = \$zarafa{'status'};

    if (defined \$zstatus && \$zstatus eq 'enabled')
    {
        \$OUT .= qq(
#--------------------------------------------------------------------
# Zarafa specific configuration files.
#--------------------------------------------------------------------

Alias /zarafa /usr/share/zarafa-webaccess/
 <Directory /usr/share/zarafa-webaccess/>
  Options -Indexes
  AllowOverride All
  order allow,deny
  allow from all
  AddType application/x-httpd-php .php
  php_flag magic_quotes_gpc off
  php_flag track_vars on
 </Directory>

Alias /webapp /usr/share/zarafa-webapp/
 <Directory /usr/share/zarafa-webapp/>
  Options -Indexes
  AllowOverride All
  order allow,deny
  allow from all
  AddType application/x-httpd-php .php
  php_flag magic_quotes_gpc off
  php_flag track_vars on
 </Directory>
	    
);
    }    
    else
    {
       \$OUT .= "# Zarafa Webmail is not configured as it is disabled in the config db";
    }
}
HERE10

##########################################
# Creating SME-QMAIL-user-templates
##########################################

#
#--- /etc/e-smith/templates-user/.qmail/80Zarafa ---
#
echo
echo "Creating /etc/e-smith/templates-user/.qmail/80Zarafa ..."
echo
cat <<HERE11 > /etc/e-smith/templates-user/.qmail/80Zarafa
{
   my \$zarafa = \$user->prop('zarafa') || 'disabled';
   my \$zarafa2 = \${'zarafa-server'}{GlobalForward} || 'disabled';

   if (\$zarafa eq 'enabled' || \$zarafa2 eq 'enabled')
   { return "| /usr/bin/zarafa-dagent -q \$USERNAME ; if [ \\$\\? -ne 0 ] ; then exit -1; else exit 99; fi;"
   }
}
HERE11

#
#--- /etc/e-smith/templates-user/.qmail-junkmail/01Zarafa ---
#
echo
echo "Creating /etc/e-smith/templates-user/.qmail-junkmail/01Zarafa ..."
echo
cat <<HERE12 > /etc/e-smith/templates-user/.qmail-junkmail/01Zarafa
{
    # vim: ft=perl:
    die "USERNAME not set." unless defined (\$USERNAME);

    use esmith::AccountsDB;
    \$adb = esmith::AccountsDB->open_ro or die "Couldn't open AccountsDB";

    \$user = \$adb->get(\$USERNAME) or die "No user \$USERNAME in AccountsDB";

    my \$zarafa = \$user->prop('zarafa') || 'disabled';
    my \$zarafa2 = \${'zarafa-server'}{GlobalForward} || 'disabled';
    return "| /usr/bin/zarafa-dagent -qj \$USERNAME ; if [ \\$\\? -ne 0 ] ; then exit -1; else exit 99; fi;"
           if (\$zarafa eq 'enabled' || \$zarafa2 eq 'enabled');
}
HERE12


##########################################
# Creating Zarafa-configuration-templates
##########################################

#
#--- unix config ---
#
echo
echo "Creating zarafa-unix-configuration-template ..."
echo
mkdir -p /etc/e-smith/templates/etc/zarafa/unix.cfg
cat <<HERE13 > /etc/e-smith/templates/etc/zarafa/unix.cfg/unix.cfg
{
use esmith::AccountsDB
}
##############################################################
#  UNIX USER PLUGIN SETTINGS
#
# Any of these directives that are required, are only required if the
# userplugin parameter is set to unix.

# Charset used in /etc/passwd for the fullname of a user. Normally this
# is us-ascii, but this can differ according to your setup.
# The charset specified here must be supported by your iconv(1)
# setup. See iconv -l for all charsets.
fullname_charset = iso-8859-15

# Default email domain for constructing new users
# Required, no default
default_domain = { \${'zarafa-server'}{DomainName} || \$DomainName; }

# The lowest user id that is considered a regular user
# Optional, default = 1000
min_user_uid = 101

# The highest user id that is considered a regular user
# Optional, default = 10000
max_user_uid = 10000

# A list of user ids that are not considered to be regular users
# Optional, default = empty
# except_user_uids =
except_user_uids = {
\$accounts = esmith::AccountsDB->open_ro or die "Could not open AccountsDB";
{
while ((\$name, \$passwd, \$uid, \$gid, \$quota,
    \$comment, \$gcos, \$dir, \$shell) = getpwent())
{
\$user = \$accounts->get(\$name);
    
\$OUT .= "\$uid "
    unless \$uid <= 101 or (defined \$user and \$user->prop('type') eq "user");
}
}
}

# The lowest group id that is considered a regular group
# Optional, default = 1000
min_group_gid = 5000

# The highest group id that is considered a regular group
# Optional, default = 10000
max_group_gid = 10000

# A list of group ids that are not considered to be regular groups
# Optional, default = empty
# except_group_gids =
except_group_gids = {
setpwent();
while ((\$name, \$passwd, \$uid, \$gid, \$quota,
    \$comment, \$gcos, \$dir, \$shell) = getpwent())
{
\$group = \$accounts->get(\$name);
    
\$OUT .= "\$gid "
    unless \$gid < 5000 or (defined \$group and \$group->prop('type') eq "group");
}
endpwent();
}

# Create a user as non-active when it has this unix shell
non_login_shell = /bin/false
HERE13


#
#--- sysconfig config ---
#
echo
echo "Creating zarafa-sysconfig-configuration-template ..."
echo
mkdir -p /etc/e-smith/templates/etc/sysconfig/zarafa
cat /etc/sysconfig/zarafa | sed -e 's/\r$//g' >  /etc/e-smith/templates/etc/sysconfig/zarafa/zarafa
replace /etc/e-smith/templates/etc/sysconfig/zarafa/zarafa ZARAFA_LOCALE '"{ ${'\''zarafa'\''}{language} || '\''en_US.UTF-8'\'' ; }"'
replace /etc/e-smith/templates/etc/sysconfig/zarafa/zarafa ZARAFA_USERSCRIPT_LOCALE '"{ ${'\''zarafa'\''}{language} || '\''en_US.UTF-8'\'' ; }"'


#
#--- licensed config ---
#
echo
echo "Creating zarafa-licensed-configuration-template ..."
echo
mkdir -p /etc/e-smith/templates/etc/zarafa/licensed.cfg
cat /usr/share/doc/zarafa-licensed/example-config/licensed.cfg | sed -e 's/\r$//g' >  /etc/e-smith/templates/etc/zarafa/licensed.cfg/licensed.cfg
replace /etc/e-smith/templates/etc/zarafa/licensed.cfg/licensed.cfg log_method '{ ${'\''zarafa-licensed'\''}{log_method} || '\''file'\''; }'
replace /etc/e-smith/templates/etc/zarafa/licensed.cfg/licensed.cfg log_level '{ ${'\''zarafa-licensed'\''}{log_level} || '\''2'\''; }'
replace /etc/e-smith/templates/etc/zarafa/licensed.cfg/licensed.cfg log_timestamp '{ ${'\''zarafa-licensed'\''}{log_timestamp} || '\''1'\''; }'

#
#--- server config ---
#
echo
echo "Creating zarafa-server-configuration-template ..."
echo
mkdir -p /etc/e-smith/templates/etc/zarafa/server.cfg
cat /usr/share/doc/zarafa/example-config/server.cfg | sed -e 's/\r$//g' >  /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_tcp_enabled '{ ${'\''zarafa-server'\''}{server_tcp_enabled} || '\''yes'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_tcp_port	'{ ${'\''zarafa-server'\''}{TCPPort} || '\''236'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_pipe_enabled '{ ${'\''zarafa-server'\''}{server_pipe_enabled} || '\''yes'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_name '{ ${'\''zarafa-server'\''}{server_name} || '\''Zarafa'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg database_engine '{ ${'\''zarafa-server'\''}{database_engine} || '\''mysql'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg allow_local_users '{ ${'\''zarafa-server'\''}{allow_local_users} || '\''yes'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg local_admin_users '{ ${'\''zarafa-server'\''}{local_admin_users} || '\''root'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg system_email_address '{ ${'\''zarafa-server'\''}{system_email_address} || '\''postmaster@localhost'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg session_timeout '{ ${'\''zarafa-server'\''}{session_timeout} || '\''300'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg license_timeout '{ ${'\''zarafa-server'\''}{license_timeout} || '\''10'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg log_method '{ ${'\''zarafa-server'\''}{log_method} || '\''file'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg log_level '{ ${'\''zarafa-server'\''}{log_level} || '\''2'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg log_timestamp '{ ${'\''zarafa-server'\''}{log_timestamp} || '\''1'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg audit_log_enabled '{ ${'\''zarafa-server'\''}{audit_log_enabled} || '\''no'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg audit_log_level	'{ ${'\''zarafa-server'\''}{audit_log_level} || '\''1'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg audit_log_timestamp '{ ${'\''zarafa-server'\''}{audit_log_timestamp} || '\''1'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg mysql_host '{ ${'\''zarafa-server'\''}{mysql_host} || '\''localhost'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg mysql_port '{ ${'\''zarafa-server'\''}{mysql_port} || '\''3306'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg mysql_user '{ ${'\''zarafa-server'\''}{DbUser} || '\''zarafa'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg mysql_password '{ ${'\''zarafa-server'\''}{DbPassword}; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg mysql_database '{ ${'\''zarafa-server'\''}{DbName} || '\''zarafa'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg attachment_storage '{ ${'\''zarafa-server'\''}{attachment_storage} || '\''files'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg attachment_path '/home/e-smith/files/zarafa'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg attachment_compression '{ ${'\''zarafa-server'\''}{attachment_compression} || '\''6'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_ssl_enabled '{ ${'\''zarafa-ssl'\''}{server_ssl_enabled} || '\''yes'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_ssl_port	'{ ${'\''zarafa-ssl'\''}{TCPPort} || '\''237'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_ssl_key_file '/home/e-smith/ssl.pem/{$SystemName}.{$DomainName}.pem'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_ssl_key_pass '{ ${'\''zarafa-server'\''}{DbPassword}; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_ssl_ca_file '/home/e-smith/ssl.crt/{$SystemName}.{$DomainName}.crt'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_ssl_ca_path '/home/e-smith/ssl.crt'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg sslkeys_path '/home/e-smith/ssl.pem'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg threads	'{ ${'\''zarafa-server'\''}{threads} || '\''8'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg watchdog_frequency '{ ${'\''zarafa-server'\''}{watchdog_frequency} || '\''1'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg watchdog_max_age '{ ${'\''zarafa-server'\''}{watchdog_max_age} || '\''500'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_max_keep_alive_requests '{ ${'\''zarafa-server'\''}{server_max_keep_alive_requests} || '\''100'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_recv_timeout '{ ${'\''zarafa-server'\''}{server_recv_timeout} || '\''5'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_read_timeout '{ ${'\''zarafa-server'\''}{server_read_timeout} || '\''60'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_send_timeout '{ ${'\''zarafa-server'\''}{server_send_timeout} || '\''60'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg softdelete_lifetime '{ ${'\''zarafa-server'\''}{softdelete_lifetime} || '\''30'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg sync_lifetime '{ ${'\''zarafa-server'\''}{sync_lifetime} || '\''365'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg sync_log_all_changes '{ ${'\''zarafa-server'\''}{sync_log_all_changes} || '\''no'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg enable_sso '{ ${'\''zarafa-server'\''}{enable_sso} || '\''no'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg enable_gab '{ ${'\''zarafa-server'\''}{enable_gab} || '\''yes'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg auth_method '{ ${'\''zarafa-server'\''}{auth_method} || '\''plugin'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg pam_service '{ ${'\''zarafa-server'\''}{pam_service} || '\''passwd'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg cache_cell_size '{ ${'\''zarafa-server'\''}{cache_cell_size} || '\''268435456'\''; }' 
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg cache_object_size '{ ${'\''zarafa-server'\''}{cache_object_size} || '\''5242880'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg cache_indexedobject_size '{ ${'\''zarafa-server'\''}{cache_indexedobject_size} || '\''16777216'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg cache_quota_size '{ ${'\''zarafa-server'\''}{cache_quota_size} || '\''1048576'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg cache_quota_lifetime '{ ${'\''zarafa-server'\''}{cache_quota_lifetime} || '\''1'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg cache_acl_size '{ ${'\''zarafa-server'\''}{cache_acl_size} || '\''1048576'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg cache_store_size '{ ${'\''zarafa-server'\''}{cache_store_size} || '\''1048576'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg cache_user_size	'{ ${'\''zarafa-server'\''}{cache_user_size} || '\''1048576'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg cache_userdetails_size '{ ${'\''zarafa-server'\''}{cache_userdetails_size} || '\''26214400'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg cache_userdetails_lifetime '{ ${'\''zarafa-server'\''}{cache_userdetails_lifetime} || '\''5'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg cache_server_size '{ ${'\''zarafa-server'\''}{cache_server_size} || '\''1048576'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg cache_server_lifetime '{ ${'\''zarafa-server'\''}{cache_server_lifetime} || '\''30'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg quota_warn '{ ${'\''zarafa-server'\''}{quota_warn} || '\''0'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg quota_soft '{ ${'\''zarafa-server'\''}{quota_soft} || '\''0'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg quota_hard '{ ${'\''zarafa-server'\''}{quota_hard} || '\''0'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg companyquota_warn '{ ${'\''zarafa-server'\''}{companyquota_warn} || '\''0'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg user_plugin '{ ${'\''zarafa-server'\''}{user_plugin} || '\''db'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg user_plugin_config '{ ${'\''zarafa-server'\''}{user_plugin_config}; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg user_safe_mode '{ ${'\''zarafa-server'\''}{user_safe_mode} || '\''no'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg thread_stacksize '{ ${'\''zarafa-server'\''}{thread_stacksize} || '\''512'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg enable_hosted_zarafa '{ ${'\''zarafa-server'\''}{enable_hosted_zarafa} || '\''false'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg enable_distributed_zarafa '{ ${'\''zarafa-server'\''}{enable_distributed_zarafa} || '\''false'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg storename_format '{ ${'\''zarafa-server'\''}{storename_format} || '\''%f'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg loginname_format '{ ${'\''zarafa-server'\''}{loginname_format} || '\''%u'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg client_update_enabled '{ ${'\''zarafa-server'\''}{client_update_enabled} || '\''false'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg client_update_path '{ ${'\''zarafa-server'\''}{client_update_path} || '\''/var/lib/zarafa/client'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg client_update_log_level '{ ${'\''zarafa-server'\''}{client_update_log_level} || '\''1'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg hide_everyone '{ ${'\''zarafa-server'\''}{hide_everyone} || '\''yes'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg hide_system '{ ${'\''zarafa-server'\''}{hide_system} || '\''yes'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg search_enabled '{ ${'\''zarafa-server'\''}{search_enabled} || '\''no'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg search_timeout '{ ${'\''zarafa-server'\''}{search_timeout} || '\''10'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg enable_enhanced_ics '{ ${'\''zarafa-server'\''}{enable_enhanced_ics} || '\''yes'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg sync_gab_realtime '{ ${'\''zarafa-server'\''}{sync_gab_realtime} || '\''yes'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg disabled_features '{ ${'\''zarafa-server'\''}{disabled_features}; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg max_deferred_records '{ ${'\''zarafa-server'\''}{max_deferred_records} || '\''0'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg max_deferred_records_folder '{ ${'\''zarafa-server'\''}{max_deferred_records_folder} || '\''20'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg coredump_enabled '{ ${'\''zarafa-server'\''}{coredump_enabled} || '\''yes'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_ssl_enable_v2 '{ ${'\''zarafa-server'\''}{server_ssl_enable_v2} || '\''no'\''; }'


#
#--- dagent config ---
#
echo
echo "Creating zarafa-dagent-configuration-template ..."
echo
mkdir -p /etc/e-smith/templates/etc/zarafa/dagent.cfg
cat /usr/share/doc/zarafa-dagent/example-config/dagent.cfg | sed -e 's/\r$//g' >  /etc/e-smith/templates/etc/zarafa/dagent.cfg/dagent.cfg
replace /etc/e-smith/templates/etc/zarafa/dagent.cfg/dagent.cfg log_method '{ ${'\''zarafa-dagent'\''}{log_method} || '\''file'\''; }'
replace /etc/e-smith/templates/etc/zarafa/dagent.cfg/dagent.cfg log_level '{ ${'\''zarafa-dagent'\''}{log_level} || '\''2'\''; }'
replace /etc/e-smith/templates/etc/zarafa/dagent.cfg/dagent.cfg log_timestamp '{ ${'\''zarafa-dagent'\''}{log_timestamp} || '\''1'\''; }'
replace /etc/e-smith/templates/etc/zarafa/dagent.cfg/dagent.cfg log_raw_message '{ ${'\''zarafa-dagent'\''}{log_raw_message} || '\''no'\''; }'
replace /etc/e-smith/templates/etc/zarafa/dagent.cfg/dagent.cfg lmtp_port '{ ${'\''zarafa-dagent'\''}{lmtp_port} || '\''2003'\''; }'
replace /etc/e-smith/templates/etc/zarafa/dagent.cfg/dagent.cfg lmtp_max_threads '{ ${'\''zarafa-dagent'\''}{lmtp_max_threads} || '\''20'\''; }'
replace /etc/e-smith/templates/etc/zarafa/dagent.cfg/dagent.cfg process_model '{ ${'\''zarafa-dagent'\''}{process_model} || '\''fork'\''; }'
replace /etc/e-smith/templates/etc/zarafa/dagent.cfg/dagent.cfg spam_header_name '{ ${'\''zarafa-dagent'\''}{spam_header_name} || '\''X-Spam-Status'\''; }'
replace /etc/e-smith/templates/etc/zarafa/dagent.cfg/dagent.cfg spam_header_value '{ ${'\''zarafa-dagent'\''}{spam_header_value} || '\''Yes'\''; }'
replace /etc/e-smith/templates/etc/zarafa/dagent.cfg/dagent.cfg archive_on_delivery '{ ${'\''zarafa-dagent'\''}{archive_on_delivery} || '\''no'\''; }'
replace /etc/e-smith/templates/etc/zarafa/dagent.cfg/dagent.cfg set_rule_headers '{ ${'\''zarafa-dagent'\''}{set_rule_headers} || '\''yes'\''; }'


#
#--- spooler config ---
#
echo
echo "Creating zarafa-spooler-configuration-template ..."
echo
mkdir -p /etc/e-smith/templates/etc/zarafa/spooler.cfg
cat /usr/share/doc/zarafa-spooler/example-config/spooler.cfg | sed -e 's/\r$//g' >  /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg smtp_port '{ ${'\''zarafa-spooler'\''}{smtp_port} || '\''25'\''; }'
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg log_method '{ ${'\''zarafa-spooler'\''}{log_method} || '\''file'\''; }'
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg log_level '{ ${'\''zarafa-spooler'\''}{log_level} || '\''3'\''; }'
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg log_timestamp '{ ${'\''zarafa-spooler'\''}{log_timestamp} || '\''1'\''; }'
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg max_threads '{ ${'\''zarafa-spooler'\''}{max_threads} || '\''5'\''; }'
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg fax_domain '{ ${'\''zarafa-spooler'\''}{fax_domain} || '\''fax.local'\''; }'
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg fax_international '{ ${'\''zarafa-spooler'\''}{fax_international} || '\''00'\''; }'
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg always_send_delegates '{ ${'\''zarafa-spooler'\''}{always_send_delegates} || '\''no'\''; }'
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg allow_redirect_spoofing '{ ${'\''zarafa-spooler'\''}{allow_redirect_spoofing} || '\''yes'\''; }'
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg copy_delegate_mails '{ ${'\''zarafa-spooler'\''}{copy_delegate_mails} || '\''yes'\''; }'
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg allow_delegate_meeting_request '{ ${'\''zarafa-spooler'\''}{allow_delegate_meeting_request} || '\''yes'\''; }'
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg allow_send_to_everyone '{ ${'\''zarafa-spooler'\''}{allow_send_to_everyone} || '\''yes'\''; }'
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg always_send_tnef '{ ${'\''zarafa-spooler'\''}{always_send_tnef} || '\''no'\''; }'
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg always_send_utf8 '{ ${'\''zarafa-spooler'\''}{always_send_utf8} || '\''no'\''; }'
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg charset_upgrade '{ ${'\''zarafa-spooler'\''}{charset_upgrade} || '\''windows-1252'\''; }'
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg expand_groups '{ ${'\''zarafa-spooler'\''}{expand_groups} || '\''no'\''; }'
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg archive_on_send '{ ${'\''zarafa-spooler'\''}{archive_on_send} || '\''no'\''; }'


#
#--- monitor config ---
#
echo
echo "Creating zarafa-monitor-configuration-template ..."
echo "The monitor program sends quota warning mails to users who are over quota."
echo
mkdir -p /etc/e-smith/templates/etc/zarafa/monitor.cfg
cat /usr/share/doc/zarafa-monitor/example-config/monitor.cfg | sed -e 's/\r$//g' >  /etc/e-smith/templates/etc/zarafa/monitor.cfg/monitor.cfg
replace /etc/e-smith/templates/etc/zarafa/monitor.cfg/monitor.cfg log_method '{ ${'\''zarafa-monitor'\''}{log_method} || '\''file'\''; }'
replace /etc/e-smith/templates/etc/zarafa/monitor.cfg/monitor.cfg log_level '{ ${'\''zarafa-monitor'\''}{log_level} || '\''2'\''; }'
replace /etc/e-smith/templates/etc/zarafa/monitor.cfg/monitor.cfg log_timestamp '{ ${'\''zarafa-monitor'\''}{log_timestamp} || '\''1'\''; }'
replace /etc/e-smith/templates/etc/zarafa/monitor.cfg/monitor.cfg quota_check_interval '{ ${'\''zarafa-monitor'\''}{quota_check_interval} || '\''15'\''; }'
replace /etc/e-smith/templates/etc/zarafa/monitor.cfg/monitor.cfg mailquota_resend_interval '{ ${'\''zarafa-monitor'\''}{mailquota_resend_interval} || '\''1'\''; }'


#
#--- gateway config ---
#
echo
echo "Creating zarafa-gateway-configuration-template ..."
echo
mkdir -p /etc/e-smith/templates/etc/zarafa/gateway.cfg
cat /usr/share/doc/zarafa-gateway/example-config/gateway.cfg | sed -e 's/\r$//g' >  /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg server_socket 'http://localhost:{${'\''zarafa-server'\''}{TCPPort}||'\''236'\'';}/zarafa'
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg pop3_enable '{ if (${'\''zarafa-pop3'\''}{status} eq '\''enabled'\'') {'\''yes'\''} else {'\''no'\''}; }'
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg pop3_port '{ ${'\''zarafa-pop3'\''}{TCPPort} || '\''8110'\''; }'
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg pop3s_enable '{ if (${'\''zarafa-pop3s'\''}{status} eq '\''enabled'\'') {'\''yes'\''} else {'\''no'\''}; }'
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg pop3s_port '{ ${'\''zarafa-pop3s'\''}{TCPPort} || '\''8995'\''; }'
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg imap_enable '{ if (${'\''zarafa-imap'\''}{status} eq '\''enabled'\'') {'\''yes'\''} else {'\''no'\''}; }'
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg imap_port '{ ${'\''zarafa-imap'\''}{TCPPort} || '\''8143'\''; }'
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg imaps_enable '{ if (${'\''zarafa-imaps'\''}{status} eq '\''enabled'\'') {'\''yes'\''} else {'\''no'\''}; }'
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg imaps_port '{ ${'\''zarafa-imaps'\''}{TCPPort} || '\''8993'\''; }'
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg imap_only_mailfolders '{ ${'\''zarafa-imap'\''}{imap_only_mailfolders} || '\''yes'\''; }'
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg imap_public_folders '{ ${'\''zarafa-imap'\''}{imap_public_folders} || '\''yes'\''; }'
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg imap_capability_idle '{ ${'\''zarafa-imap'\''}{imap_capability_idle} || '\''yes'\''; }'
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg imap_max_messagesize '{ ${'\''zarafa-imap'\''}{imap_max_messagesize} || '\''134217728'\''; }'
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg imap_generate_utf8 '{ ${'\''zarafa-imap'\''}{imap_generate_utf8} || '\''no'\''; }'
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg imap_expunge_on_delete '{ ${'\''zarafa-imap'\''}{imap_expunge_on_delete} || '\''no'\''; }'
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg imap_store_rfc822 '{ ${'\''zarafa-imap'\''}{imap_store_rfc822} || '\''yes'\''; }'
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg ssl_private_key_file '/home/e-smith/ssl.key/{$SystemName}.{$DomainName}.key'
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg ssl_certificate_file '/home/e-smith/ssl.crt/{$SystemName}.{$DomainName}.crt'
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg ssl_verify_client '{ ${'\''zarafa-gateway'\''}{ssl_verify_client} || '\''no'\''; }'
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg process_model '{ ${'\''zarafa-gateway'\''}{process_model} || '\''fork'\''; }'
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg log_method '{ ${'\''zarafa-gateway'\''}{log_method} || '\''file'\''; }'
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg log_level '{ ${'\''zarafa-gateway'\''}{log_level} || '\''2'\''; }'
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg log_timestamp '{ ${'\''zarafa-gateway'\''}{log_timestamp} || '\''1'\''; }'
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg ssl_enable_v2 '{ ${'\''zarafa-gateway'\''}{ssl_enable_v2} || '\''no'\''; }'


#
#--- ical config ---
#
echo
echo "Creating zarafa-ical-configuration-template ..."
echo
mkdir -p /etc/e-smith/templates/etc/zarafa/ical.cfg
cat /usr/share/doc/zarafa-ical/example-config/ical.cfg | sed -e 's/\r$//g' >  /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg ical_enable '{ if (${'\''zarafa-ical'\''}{status} eq '\''enabled'\'') {'\''yes'\''} else {'\''no'\''}; }'
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg ical_port '{ ${'\''zarafa-ical'\''}{TCPPort} || '\''8088'\''; }'
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg icals_enable '{ if (${'\''zarafa-icals'\''}{status} eq '\''enabled'\'') {'\''yes'\''} else {'\''no'\''}; }'
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg icals_port '{ ${'\''zarafa-icals'\''}{TCPPort} || '\''8089'\''; }'
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg server_socket 'http://localhost:{${'\''zarafa-server'\''}{TCPPort}||'\''236'\'';}/zarafa'
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg process_model '{ ${'\''zarafa-ical'\''}{process_model} || '\''fork'\''; }'
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg log_method '{ ${'\''zarafa-ical'\''}{log_method} || '\''file'\''; }'
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg log_level '{ ${'\''zarafa-ical'\''}{log_level} || '\''2'\''; }'
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg log_timestamp '{ ${'\''zarafa-ical'\''}{log_timestamp} || '\''1'\''; }'
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg ssl_private_key_file '/home/e-smith/ssl.key/{$SystemName}.{$DomainName}.key'
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg ssl_certificate_file '/home/e-smith/ssl.crt/{$SystemName}.{$DomainName}.crt'
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg ssl_verify_client '{ ${'\''zarafa-ical'\''}{ssl_verify_client} || '\''no'\''; }'
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg server_timezone '{$TimeZone}'
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg default_charset '{ ${'\''zarafa-ical'\''}{default_charset} || '\''utf-8'\''; }'
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg enable_ical_get '{ ${'\''zarafa-ical'\''}{enable_ical_get} || '\''yes'\''; }'
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg ssl_enable_v2 '{ ${'\''zarafa-ical'\''}{ssl_enable_v2} || '\''no'\''; }'


#
#--- search config ---
#
echo
echo "Creating zarafa-search-configuration-template ..."
echo
mkdir -p /etc/e-smith/templates/etc/zarafa/search.cfg
cat /usr/share/doc/zarafa-search/example-config/search.cfg | sed -e 's/\r$//g' >  /etc/e-smith/templates/etc/zarafa/search.cfg/search.cfg
replace /etc/e-smith/templates/etc/zarafa/search.cfg/search.cfg coredump_enabled '{ ${'\''zarafa-search'\''}{coredump_enabled} || '\''no'\''; }'
replace /etc/e-smith/templates/etc/zarafa/search.cfg/search.cfg limit_results	'{ ${'\''zarafa-search'\''}{limit_results} || '\''0'\''; }'
replace /etc/e-smith/templates/etc/zarafa/search.cfg/search.cfg log_method '{ ${'\''zarafa-search'\''}{log_method} || '\''file'\''; }'
replace /etc/e-smith/templates/etc/zarafa/search.cfg/search.cfg log_level '{ ${'\''zarafa-search'\''}{log_level} || '\''2'\''; }'
replace /etc/e-smith/templates/etc/zarafa/search.cfg/search.cfg log_timestamp '{ ${'\''zarafa-search'\''}{log_timestamp} || '\''1'\''; }'
replace /etc/e-smith/templates/etc/zarafa/search.cfg/search.cfg term_cache_size '{ ${'\''zarafa-search'\''}{term_cache_size} || '\''64M'\''; }'
replace /etc/e-smith/templates/etc/zarafa/search.cfg/search.cfg optimize_start '{ ${'\''zarafa-search'\''}{optimize_start} || '\''2'\''; }'
replace /etc/e-smith/templates/etc/zarafa/search.cfg/search.cfg optimize_stop '{ ${'\''zarafa-search'\''}{optimize_stop} || '\''5'\''; }'
replace /etc/e-smith/templates/etc/zarafa/search.cfg/search.cfg optimize_age '{ ${'\''zarafa-search'\''}{optimize_age} || '\''7'\''; }'
replace /etc/e-smith/templates/etc/zarafa/search.cfg/search.cfg index_attachments '{ ${'\''zarafa-search'\''}{index_attachments} || '\''no'\''; }'
replace /etc/e-smith/templates/etc/zarafa/search.cfg/search.cfg index_attachment_max_size '{ ${'\''zarafa-search'\''}{index_attachment_max_size} || '\''5M'\''; }'
replace /etc/e-smith/templates/etc/zarafa/search.cfg/search.cfg index_attachment_parser_max_memory '{ ${'\''zarafa-search'\''}{index_attachment_parser_max_memory} || '\''0'\''; }'
replace /etc/e-smith/templates/etc/zarafa/search.cfg/search.cfg index_attachment_parser_max_cputime '{ ${'\''zarafa-search'\''}{index_attachment_parser_max_cputime} || '\''0'\''; }'


######################################
# Configuring SME-events : Templates to expand
######################################

/bin/echo 
/bin/echo "Configuring SME-events : Templates2expand"
/bin/echo 
mkdir -p /etc/e-smith/events/email-update/templates2expand/etc/zarafa
touch /etc/e-smith/events/email-update/templates2expand/etc/zarafa/gateway.cfg
touch /etc/e-smith/events/email-update/templates2expand/etc/zarafa/ical.cfg
touch /etc/e-smith/events/email-update/templates2expand/etc/zarafa/server.cfg
touch /etc/e-smith/events/email-update/templates2expand/etc/zarafa/unix.cfg
touch /etc/e-smith/events/email-update/templates2expand/etc/zarafa/spooler.cfg
touch /etc/e-smith/events/email-update/templates2expand/etc/zarafa/licensed.cfg
touch /etc/e-smith/events/email-update/templates2expand/etc/zarafa/monitor.cfg
touch /etc/e-smith/events/email-update/templates2expand/etc/zarafa/dagent.cfg

mkdir -p /etc/e-smith/events/group-create/templates2expand/etc/zarafa
touch /etc/e-smith/events/group-create/templates2expand/etc/zarafa/unix.cfg

mkdir -p /etc/e-smith/events/group-delete/templates2expand/etc/zarafa
touch /etc/e-smith/events/group-delete/templates2expand/etc/zarafa/unix.cfg

mkdir -p /etc/e-smith/events/group-modify/templates2expand/etc/zarafa
touch /etc/e-smith/events/group-modify/templates2expand/etc/zarafa/unix.cfg

mkdir -p /etc/e-smith/events/user-create/templates2expand/etc/zarafa
touch /etc/e-smith/events/user-create/templates2expand/etc/zarafa/unix.cfg

mkdir -p /etc/e-smith/events/user-delete/templates2expand/etc/zarafa
touch /etc/e-smith/events/user-delete/templates2expand/etc/zarafa/unix.cfg

mkdir -p /etc/e-smith/events/user-modify/templates2expand/etc/zarafa
touch /etc/e-smith/events/user-modify/templates2expand/etc/zarafa/unix.cfg

mkdir -p /etc/e-smith/events/ibay-create/templates2expand/etc/zarafa
touch /etc/e-smith/events/ibay-create/templates2expand/etc/zarafa/unix.cfg

mkdir -p /etc/e-smith/events/machine-account-create/templates2expand/etc/zarafa
touch /etc/e-smith/events/machine-account-create/templates2expand/etc/zarafa/unix.cfg

mkdir -p /etc/e-smith/events/post-upgrade/templates2expand/etc/zarafa
touch /etc/e-smith/events/post-upgrade/templates2expand/etc/e-smith/sql/init/80zarafa
touch /etc/e-smith/events/post-upgrade/templates2expand/etc/zarafa/gateway.cfg
touch /etc/e-smith/events/post-upgrade/templates2expand/etc/zarafa/ical.cfg
touch /etc/e-smith/events/post-upgrade/templates2expand/etc/zarafa/server.cfg
touch /etc/e-smith/events/post-upgrade/templates2expand/etc/zarafa/unix.cfg
touch /etc/e-smith/events/post-upgrade/templates2expand/etc/zarafa/spooler.cfg
touch /etc/e-smith/events/post-upgrade/templates2expand/etc/zarafa/licensed.cfg
touch /etc/e-smith/events/post-upgrade/templates2expand/etc/zarafa/monitor.cfg
touch /etc/e-smith/events/post-upgrade/templates2expand/etc/zarafa/dagent.cfg


######################################
# Configuring SME-events : Services to adjust
######################################

/bin/echo 
/bin/echo "Configuring SME-events : Services2adjust"
/bin/echo 
mkdir -p /etc/e-smith/events/machine-account-create/services2adjust
ln -s reload /etc/e-smith/events/group-create/services2adjust/zarafa-server
ln -s reload /etc/e-smith/events/group-delete/services2adjust/zarafa-server
ln -s reload /etc/e-smith/events/group-modify/services2adjust/zarafa-server
ln -s reload /etc/e-smith/events/user-create/services2adjust/zarafa-server
ln -s reload /etc/e-smith/events/user-delete/services2adjust/zarafa-server
ln -s reload /etc/e-smith/events/user-modify/services2adjust/zarafa-server
ln -s reload /etc/e-smith/events/ibay-create/services2adjust/zarafa-server
ln -s reload /etc/e-smith/events/machine-account-create/services2adjust/zarafa-server
ln -s reload /etc/e-smith/events/timezone-update/services2adjust/zarafa-server


######################################
# Setting up SME-db-entries
######################################

/bin/echo 
/bin/echo "Enter the language of your choice for your zarafa-mailboxes and public store(s)."
/bin/echo "Values: en_US.UTF-8, en_GB.UTF-8, nl_NL.UTF-8, fr_FR.UTF-8, de_DE.UTF-8, ..."
/bin/echo 
read ZARAFALANGUAGE
/sbin/e-smith/config set zarafa service status enabled language $ZARAFALANGUAGE
/sbin/e-smith/expand-template /etc/sysconfig/zarafa

/bin/echo 
/bin/echo "Initialize-default-databases"
/bin/echo 
/etc/e-smith/events/actions/initialize-default-databases

/bin/echo 
/bin/echo "Setting up db-entries for Zarafa"
/bin/echo 
/sbin/e-smith/db configuration setprop mysqld InnoDB enabled
/sbin/e-smith/db configuration setprop smtpd tnef2mime disabled
/sbin/e-smith/db configuration setprop zarafa-server access private status enabled TCPPort 236 search_enabled yes
/bin/echo 
/bin/echo "Enter your user plugin."
/bin/echo "Values: unix or db (ldap is not supported, multicompany-support only with db-plugin)."
/bin/echo 
read USERPLUGIN
/sbin/e-smith/db configuration setprop zarafa-server user_plugin $USERPLUGIN

if [ "$USERPLUGIN" == unix ]; then
/sbin/e-smith/db configuration setprop zarafa-server user_plugin_config /etc/zarafa/unix.cfg
fi

if [ "$USERPLUGIN" == db ]; then
/bin/echo
/bin/echo "Do you want to set up a multicompany-environment ?"
/bin/echo "Values: yes or no."
/bin/echo
read MULTICOMPANY
/sbin/e-smith/db configuration setprop zarafa-server Multicompany $MULTICOMPANY
/sbin/e-smith/db configuration delprop zarafa-server user_plugin_config
if [ "$MULTICOMPANY" == yes ]; then
/sbin/e-smith/db configuration setprop zarafa-server enable_hosted_zarafa true
/sbin/e-smith/db configuration setprop zarafa-server loginname_format %u.%c
else
/sbin/e-smith/db configuration setprop zarafa-server enable_hosted_zarafa false
/sbin/e-smith/db configuration setprop zarafa-server loginname_format %u
fi
fi

/sbin/e-smith/db configuration setprop zarafa access SSL
/sbin/e-smith/db configuration set zarafa-ical service access private status enabled TCPPort 8088
/sbin/e-smith/db configuration set zarafa-icals service access public status enabled TCPPort 8089
/sbin/e-smith/db configuration set zarafa-imap service access private status enabled TCPPort 8143
/sbin/e-smith/db configuration set zarafa-imaps service access public status enabled TCPPort 8993
/sbin/e-smith/db configuration set zarafa-pop3 service access private status enabled TCPPort 8110
/sbin/e-smith/db configuration set zarafa-pop3s service access public status enabled TCPPort 8995
/sbin/e-smith/db configuration set zarafa-ssl service access public status enabled TCPPort 237
/sbin/e-smith/db configuration set zarafa-gateway service status enabled
/sbin/e-smith/db configuration set zarafa-spooler service status enabled
/sbin/e-smith/db configuration set zarafa-monitor service status enabled
/sbin/e-smith/db configuration set zarafa-search service status enabled
/sbin/e-smith/db configuration set zarafa-licensed service status enabled
/sbin/e-smith/db configuration set zarafa-dagent service status enabled


######################################
# Setting up the Zarafa-db
######################################

/bin/echo
/bin/echo "Expanding the my.cnf-template"
/bin/echo
/sbin/e-smith/expand-template /etc/my.cnf

/bin/echo
/bin/echo "Restarting mysqld"
/bin/echo
/usr/bin/sv t /service/mysqld

/bin/echo
/bin/echo "Signal-event remoteaccess-update"
/bin/echo
/sbin/e-smith/signal-event remoteaccess-update

/bin/echo
/bin/echo "Creating the Zarafa-database"
/bin/echo
/sbin/e-smith/expand-template /etc/e-smith/sql/init/80zarafa
/etc/rc.d/init.d/mysql.init start


######################################
# Expanding the Zarafa-configuration-templates
######################################

/bin/echo
/bin/echo "Expanding the Zarafa-configuration-templates"
/bin/echo
/etc/e-smith/events/actions/zarafa-expand-templates


######################################
# Configuration of the Webaccess
######################################

/bin/echo
/bin/echo "Configuration of the Webaccess"
/bin/echo
/bin/chown -R www:www /var/lib/zarafa-webaccess/tmp
/bin/chown -R www:www /var/lib/zarafa-webapp/tmp
FILE=/etc/httpd/conf.d/zarafa-webaccess.conf; if [ -a $FILE ]; then /bin/rm -f $FILE; fi
FILE=/etc/httpd/conf.d/zarafa-webapp.conf; if [ -a $FILE ]; then /bin/rm -f $FILE; fi

/bin/echo
/bin/echo "Expanding http.conf-template"
/bin/echo
/sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf

/bin/echo
/bin/echo "Restarting httpd"
/bin/echo
/usr/bin/sv restart /service/httpd-e-smith


######################################
# Setting up more symbolic links
######################################

/bin/echo
/bin/echo "Setting up more symbolic links"
/bin/echo
if [ `getconf LONG_BIT` = "64" ]; then
	ln -s /usr/lib64/zarafa /usr/lib/zarafa
	ln -s /lib64/libcrypto.so.0.9.8e /usr/lib/libcrypto.so.0.9.8
	ln -s /lib64/libssl.so.0.9.8e /usr/lib/libssl.so.0.9.8	
else
	ln -s /lib/libcrypto.so.0.9.8e /usr/lib/libcrypto.so.0.9.8
	ln -s /lib/libssl.so.0.9.8e /usr/lib/libssl.so.0.9.8
fi
ln -s /etc/rc.d/init.d/e-smith-service /etc/rc.d/rc7.d/S99zarafa-dagent
ln -s /etc/rc.d/init.d/e-smith-service /etc/rc.d/rc7.d/S99zarafa-gateway
ln -s /etc/rc.d/init.d/e-smith-service /etc/rc.d/rc7.d/S99zarafa-search
ln -s /etc/rc.d/init.d/e-smith-service /etc/rc.d/rc7.d/S99zarafa-licensed
ln -s /etc/rc.d/init.d/e-smith-service /etc/rc.d/rc7.d/S99zarafa-monitor
ln -s /etc/rc.d/init.d/e-smith-service /etc/rc.d/rc7.d/S99zarafa-spooler
ln -s /etc/rc.d/init.d/e-smith-service /etc/rc.d/rc7.d/S99zarafa-ical
ln -s /etc/rc.d/init.d/e-smith-service /etc/rc.d/rc7.d/S99zarafa-server


#######################################
# Installing a license-key
#######################################

/bin/echo 
/bin/echo "Installing a license-key"
/bin/echo 
if [ -x /usr/bin/zarafa-licensed ]; then
	if [ ! -f /etc/zarafa/license/base ]; then
		mkdir -p /etc/zarafa/license
		SERIAL="0"
		while [ ${#SERIAL} -ne 25 -a ${#SERIAL} -ne 0 ]; do
			if [ -n "$SERIAL" ]; then
				echo "Serial number must be 25 characters or empty"
			fi
			echo -ne "Server serial number (leave empty for none) []\t\t: "
			read SERIAL
		done
		SERIAL=`echo $SERIAL | tr [a-z] [A-Z]`
		echo $SERIAL > /etc/zarafa/license/base
		echo
		echo "The correctness of the serial will be checked when the Zarafa-server starts."
		echo
	fi
fi


#######################################
# Starting Zarafa
#######################################

/bin/echo 
/bin/echo "Starting Zarafa-services"
/bin/echo 
/etc/e-smith/events/actions/zarafa-services start

/bin/echo
/bin/echo "Setting permissions on files"
/bin/echo
FILE=/var/log/zarafa/dagent.log; if [ -a $FILE ]; then /bin/chmod 666 $FILE; fi
/bin/chmod 554 /etc/e-smith/events/actions/zarafa-update


#######################################
# Creating public store(s)
#######################################

if [ "$USERPLUGIN" == unix ]; then
/bin/echo
/bin/echo "creating Public store"
/bin/echo
/usr/bin/zarafa-admin --utf8 -s
fi

if [ "$USERPLUGIN" == db ]; then
if [ "$MULTICOMPANY" == no ]; then
/bin/echo
/bin/echo "creating Public store"
/bin/echo
/usr/bin/zarafa-admin --utf8 -s
fi
fi

if [ "$USERPLUGIN" == db ]; then
if [ "$MULTICOMPANY" == yes ]; then
 /bin/echo
 /bin/echo "Make your first company. Enter your first companyname :"
 /bin/echo
 read COMPANYNAME
 /usr/bin/zarafa-admin --create-company "$COMPANYNAME"
 /bin/echo
 /bin/echo "!!! REMEMBER !!! : for a multicompany-environment the username-format of the SME-user and the ZARAFA-user,"
 /bin/echo "has to be : [username].[companyname] !!!"
 /bin/echo
fi
fi

To save :
CTRL + X
yes
<ENTER>

UPGRADESCRIPT

Only if you are upgrading from zcp 7.0.x to 7.1.x -> Uninstall zarafa-indexer and remove templates, db-entries and links for zarafa-indexer :
rpm -e zarafa-indexer --nodeps
rm -rf /etc/e-smith/templates/etc/zarafa/indexer.cfg
db configuration delete zarafa-indexer
rm -f /etc/rc.d/rc7.d/S99zarafa-indexer
Only if you are upgrading from zcp 7.0.x to 7.1.x -> Delete the old update-script for zcp 7.0.x :
rm -f /etc/e-smith/events/actions/zarafa-update
nano -w /etc/e-smith/events/actions/zarafa-update
#!/bin/sh

/bin/echo "Stopping the Zarafa-services"
/etc/e-smith/events/actions/zarafa-services stop

#
#--- zarafa-configuration-helper-action ---
#
echo
echo "Creating zarafa-configuration-helper-action ..."
echo
cat <<HERE1 > /etc/e-smith/events/actions/helpers.inc
# -*- Mode: sh -*-
replace() {
	file=\$1
	option=\$2
	value=\$3
	
	# escape &-signs, and % for sed
	value=\`echo \$value | sed -e 's/\&/\\\\\&/g' -e 's/\%/\\\\\%/g'\`
	sed -i -e "s%\([[:space:]]*\$option[[:space:]]*=[[:space:]]*\).*%\1\$value%" \$file

}
HERE1

. /etc/e-smith/events/actions/helpers.inc

#
#--- sysconfig config ---
#
echo
echo "Creating zarafa-sysconfig-configuration-template ..."
echo
mkdir -p /etc/e-smith/templates/etc/sysconfig/zarafa
cat /etc/sysconfig/zarafa | sed -e 's/\r$//g' >  /etc/e-smith/templates/etc/sysconfig/zarafa/zarafa
replace /etc/e-smith/templates/etc/sysconfig/zarafa/zarafa ZARAFA_LOCALE '"{ ${'\''zarafa'\''}{language} || '\''en_US.UTF-8'\'' ; }"'
replace /etc/e-smith/templates/etc/sysconfig/zarafa/zarafa ZARAFA_USERSCRIPT_LOCALE '"{ ${'\''zarafa'\''}{language} || '\''en_US.UTF-8'\'' ; }"'


#
#--- licensed config ---
#
echo
echo "Creating zarafa-licensed-configuration-template ..."
echo
mkdir -p /etc/e-smith/templates/etc/zarafa/licensed.cfg
cat /usr/share/doc/zarafa-licensed/example-config/licensed.cfg | sed -e 's/\r$//g' >  /etc/e-smith/templates/etc/zarafa/licensed.cfg/licensed.cfg
replace /etc/e-smith/templates/etc/zarafa/licensed.cfg/licensed.cfg log_method '{ ${'\''zarafa-licensed'\''}{log_method} || '\''file'\''; }'
replace /etc/e-smith/templates/etc/zarafa/licensed.cfg/licensed.cfg log_level '{ ${'\''zarafa-licensed'\''}{log_level} || '\''2'\''; }'
replace /etc/e-smith/templates/etc/zarafa/licensed.cfg/licensed.cfg log_timestamp '{ ${'\''zarafa-licensed'\''}{log_timestamp} || '\''1'\''; }'

#
#--- server config ---
#
echo
echo "Creating zarafa-server-configuration-template ..."
echo
mkdir -p /etc/e-smith/templates/etc/zarafa/server.cfg
cat /usr/share/doc/zarafa/example-config/server.cfg | sed -e 's/\r$//g' >  /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_tcp_enabled '{ ${'\''zarafa-server'\''}{server_tcp_enabled} || '\''yes'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_tcp_port	'{ ${'\''zarafa-server'\''}{TCPPort} || '\''236'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_pipe_enabled '{ ${'\''zarafa-server'\''}{server_pipe_enabled} || '\''yes'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_name '{ ${'\''zarafa-server'\''}{server_name} || '\''Zarafa'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg database_engine '{ ${'\''zarafa-server'\''}{database_engine} || '\''mysql'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg allow_local_users '{ ${'\''zarafa-server'\''}{allow_local_users} || '\''yes'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg local_admin_users '{ ${'\''zarafa-server'\''}{local_admin_users} || '\''root'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg system_email_address '{ ${'\''zarafa-server'\''}{system_email_address} || '\''postmaster@localhost'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg session_timeout '{ ${'\''zarafa-server'\''}{session_timeout} || '\''300'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg license_timeout '{ ${'\''zarafa-server'\''}{license_timeout} || '\''10'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg log_method '{ ${'\''zarafa-server'\''}{log_method} || '\''file'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg log_level '{ ${'\''zarafa-server'\''}{log_level} || '\''2'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg log_timestamp '{ ${'\''zarafa-server'\''}{log_timestamp} || '\''1'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg audit_log_enabled '{ ${'\''zarafa-server'\''}{audit_log_enabled} || '\''no'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg audit_log_level	'{ ${'\''zarafa-server'\''}{audit_log_level} || '\''1'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg audit_log_timestamp '{ ${'\''zarafa-server'\''}{audit_log_timestamp} || '\''1'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg mysql_host '{ ${'\''zarafa-server'\''}{mysql_host} || '\''localhost'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg mysql_port '{ ${'\''zarafa-server'\''}{mysql_port} || '\''3306'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg mysql_user '{ ${'\''zarafa-server'\''}{DbUser} || '\''zarafa'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg mysql_password '{ ${'\''zarafa-server'\''}{DbPassword}; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg mysql_database '{ ${'\''zarafa-server'\''}{DbName} || '\''zarafa'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg attachment_storage '{ ${'\''zarafa-server'\''}{attachment_storage} || '\''files'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg attachment_path '/home/e-smith/files/zarafa'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg attachment_compression '{ ${'\''zarafa-server'\''}{attachment_compression} || '\''6'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_ssl_enabled '{ ${'\''zarafa-ssl'\''}{server_ssl_enabled} || '\''yes'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_ssl_port	'{ ${'\''zarafa-ssl'\''}{TCPPort} || '\''237'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_ssl_key_file '/home/e-smith/ssl.pem/{$SystemName}.{$DomainName}.pem'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_ssl_key_pass '{ ${'\''zarafa-server'\''}{DbPassword}; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_ssl_ca_file '/home/e-smith/ssl.crt/{$SystemName}.{$DomainName}.crt'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_ssl_ca_path '/home/e-smith/ssl.crt'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg sslkeys_path '/home/e-smith/ssl.pem'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg threads	'{ ${'\''zarafa-server'\''}{threads} || '\''8'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg watchdog_frequency '{ ${'\''zarafa-server'\''}{watchdog_frequency} || '\''1'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg watchdog_max_age '{ ${'\''zarafa-server'\''}{watchdog_max_age} || '\''500'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_max_keep_alive_requests '{ ${'\''zarafa-server'\''}{server_max_keep_alive_requests} || '\''100'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_recv_timeout '{ ${'\''zarafa-server'\''}{server_recv_timeout} || '\''5'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_read_timeout '{ ${'\''zarafa-server'\''}{server_read_timeout} || '\''60'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_send_timeout '{ ${'\''zarafa-server'\''}{server_send_timeout} || '\''60'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg softdelete_lifetime '{ ${'\''zarafa-server'\''}{softdelete_lifetime} || '\''30'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg sync_lifetime '{ ${'\''zarafa-server'\''}{sync_lifetime} || '\''365'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg sync_log_all_changes '{ ${'\''zarafa-server'\''}{sync_log_all_changes} || '\''no'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg enable_sso '{ ${'\''zarafa-server'\''}{enable_sso} || '\''no'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg enable_gab '{ ${'\''zarafa-server'\''}{enable_gab} || '\''yes'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg auth_method '{ ${'\''zarafa-server'\''}{auth_method} || '\''plugin'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg pam_service '{ ${'\''zarafa-server'\''}{pam_service} || '\''passwd'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg cache_cell_size '{ ${'\''zarafa-server'\''}{cache_cell_size} || '\''268435456'\''; }' 
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg cache_object_size '{ ${'\''zarafa-server'\''}{cache_object_size} || '\''5242880'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg cache_indexedobject_size '{ ${'\''zarafa-server'\''}{cache_indexedobject_size} || '\''16777216'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg cache_quota_size '{ ${'\''zarafa-server'\''}{cache_quota_size} || '\''1048576'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg cache_quota_lifetime '{ ${'\''zarafa-server'\''}{cache_quota_lifetime} || '\''1'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg cache_acl_size '{ ${'\''zarafa-server'\''}{cache_acl_size} || '\''1048576'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg cache_store_size '{ ${'\''zarafa-server'\''}{cache_store_size} || '\''1048576'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg cache_user_size	'{ ${'\''zarafa-server'\''}{cache_user_size} || '\''1048576'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg cache_userdetails_size '{ ${'\''zarafa-server'\''}{cache_userdetails_size} || '\''26214400'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg cache_userdetails_lifetime '{ ${'\''zarafa-server'\''}{cache_userdetails_lifetime} || '\''5'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg cache_server_size '{ ${'\''zarafa-server'\''}{cache_server_size} || '\''1048576'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg cache_server_lifetime '{ ${'\''zarafa-server'\''}{cache_server_lifetime} || '\''30'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg quota_warn '{ ${'\''zarafa-server'\''}{quota_warn} || '\''0'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg quota_soft '{ ${'\''zarafa-server'\''}{quota_soft} || '\''0'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg quota_hard '{ ${'\''zarafa-server'\''}{quota_hard} || '\''0'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg companyquota_warn '{ ${'\''zarafa-server'\''}{companyquota_warn} || '\''0'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg user_plugin '{ ${'\''zarafa-server'\''}{user_plugin} || '\''db'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg user_plugin_config '{ ${'\''zarafa-server'\''}{user_plugin_config}; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg user_safe_mode '{ ${'\''zarafa-server'\''}{user_safe_mode} || '\''no'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg thread_stacksize '{ ${'\''zarafa-server'\''}{thread_stacksize} || '\''512'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg enable_hosted_zarafa '{ ${'\''zarafa-server'\''}{enable_hosted_zarafa} || '\''false'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg enable_distributed_zarafa '{ ${'\''zarafa-server'\''}{enable_distributed_zarafa} || '\''false'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg storename_format '{ ${'\''zarafa-server'\''}{storename_format} || '\''%f'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg loginname_format '{ ${'\''zarafa-server'\''}{loginname_format} || '\''%u'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg client_update_enabled '{ ${'\''zarafa-server'\''}{client_update_enabled} || '\''false'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg client_update_path '{ ${'\''zarafa-server'\''}{client_update_path} || '\''/var/lib/zarafa/client'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg client_update_log_level '{ ${'\''zarafa-server'\''}{client_update_log_level} || '\''1'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg hide_everyone '{ ${'\''zarafa-server'\''}{hide_everyone} || '\''yes'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg hide_system '{ ${'\''zarafa-server'\''}{hide_system} || '\''yes'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg search_enabled '{ ${'\''zarafa-server'\''}{search_enabled} || '\''no'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg search_timeout '{ ${'\''zarafa-server'\''}{search_timeout} || '\''10'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg enable_enhanced_ics '{ ${'\''zarafa-server'\''}{enable_enhanced_ics} || '\''yes'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg sync_gab_realtime '{ ${'\''zarafa-server'\''}{sync_gab_realtime} || '\''yes'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg disabled_features '{ ${'\''zarafa-server'\''}{disabled_features}; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg max_deferred_records '{ ${'\''zarafa-server'\''}{max_deferred_records} || '\''0'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg max_deferred_records_folder '{ ${'\''zarafa-server'\''}{max_deferred_records_folder} || '\''20'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg coredump_enabled '{ ${'\''zarafa-server'\''}{coredump_enabled} || '\''yes'\''; }'
replace /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg server_ssl_enable_v2 '{ ${'\''zarafa-server'\''}{server_ssl_enable_v2} || '\''no'\''; }'


#
#--- dagent config ---
#
echo
echo "Creating zarafa-dagent-configuration-template ..."
echo
mkdir -p /etc/e-smith/templates/etc/zarafa/dagent.cfg
cat /usr/share/doc/zarafa-dagent/example-config/dagent.cfg | sed -e 's/\r$//g' >  /etc/e-smith/templates/etc/zarafa/dagent.cfg/dagent.cfg
replace /etc/e-smith/templates/etc/zarafa/dagent.cfg/dagent.cfg log_method '{ ${'\''zarafa-dagent'\''}{log_method} || '\''file'\''; }'
replace /etc/e-smith/templates/etc/zarafa/dagent.cfg/dagent.cfg log_level '{ ${'\''zarafa-dagent'\''}{log_level} || '\''2'\''; }'
replace /etc/e-smith/templates/etc/zarafa/dagent.cfg/dagent.cfg log_timestamp '{ ${'\''zarafa-dagent'\''}{log_timestamp} || '\''1'\''; }'
replace /etc/e-smith/templates/etc/zarafa/dagent.cfg/dagent.cfg log_raw_message '{ ${'\''zarafa-dagent'\''}{log_raw_message} || '\''no'\''; }'
replace /etc/e-smith/templates/etc/zarafa/dagent.cfg/dagent.cfg lmtp_port '{ ${'\''zarafa-dagent'\''}{lmtp_port} || '\''2003'\''; }'
replace /etc/e-smith/templates/etc/zarafa/dagent.cfg/dagent.cfg lmtp_max_threads '{ ${'\''zarafa-dagent'\''}{lmtp_max_threads} || '\''20'\''; }'
replace /etc/e-smith/templates/etc/zarafa/dagent.cfg/dagent.cfg process_model '{ ${'\''zarafa-dagent'\''}{process_model} || '\''fork'\''; }'
replace /etc/e-smith/templates/etc/zarafa/dagent.cfg/dagent.cfg spam_header_name '{ ${'\''zarafa-dagent'\''}{spam_header_name} || '\''X-Spam-Status'\''; }'
replace /etc/e-smith/templates/etc/zarafa/dagent.cfg/dagent.cfg spam_header_value '{ ${'\''zarafa-dagent'\''}{spam_header_value} || '\''Yes'\''; }'
replace /etc/e-smith/templates/etc/zarafa/dagent.cfg/dagent.cfg archive_on_delivery '{ ${'\''zarafa-dagent'\''}{archive_on_delivery} || '\''no'\''; }'
replace /etc/e-smith/templates/etc/zarafa/dagent.cfg/dagent.cfg set_rule_headers '{ ${'\''zarafa-dagent'\''}{set_rule_headers} || '\''yes'\''; }'


#
#--- spooler config ---
#
echo
echo "Creating zarafa-spooler-configuration-template ..."
echo
mkdir -p /etc/e-smith/templates/etc/zarafa/spooler.cfg
cat /usr/share/doc/zarafa-spooler/example-config/spooler.cfg | sed -e 's/\r$//g' >  /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg smtp_port '{ ${'\''zarafa-spooler'\''}{smtp_port} || '\''25'\''; }'
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg log_method '{ ${'\''zarafa-spooler'\''}{log_method} || '\''file'\''; }'
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg log_level '{ ${'\''zarafa-spooler'\''}{log_level} || '\''3'\''; }'
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg log_timestamp '{ ${'\''zarafa-spooler'\''}{log_timestamp} || '\''1'\''; }'
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg max_threads '{ ${'\''zarafa-spooler'\''}{max_threads} || '\''5'\''; }'
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg fax_domain '{ ${'\''zarafa-spooler'\''}{fax_domain} || '\''fax.local'\''; }'
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg fax_international '{ ${'\''zarafa-spooler'\''}{fax_international} || '\''00'\''; }'
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg always_send_delegates '{ ${'\''zarafa-spooler'\''}{always_send_delegates} || '\''no'\''; }'
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg allow_redirect_spoofing '{ ${'\''zarafa-spooler'\''}{allow_redirect_spoofing} || '\''yes'\''; }'
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg copy_delegate_mails '{ ${'\''zarafa-spooler'\''}{copy_delegate_mails} || '\''yes'\''; }'
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg allow_delegate_meeting_request '{ ${'\''zarafa-spooler'\''}{allow_delegate_meeting_request} || '\''yes'\''; }'
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg allow_send_to_everyone '{ ${'\''zarafa-spooler'\''}{allow_send_to_everyone} || '\''yes'\''; }'
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg always_send_tnef '{ ${'\''zarafa-spooler'\''}{always_send_tnef} || '\''no'\''; }'
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg always_send_utf8 '{ ${'\''zarafa-spooler'\''}{always_send_utf8} || '\''no'\''; }'
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg charset_upgrade '{ ${'\''zarafa-spooler'\''}{charset_upgrade} || '\''windows-1252'\''; }'
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg expand_groups '{ ${'\''zarafa-spooler'\''}{expand_groups} || '\''no'\''; }'
replace /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg archive_on_send '{ ${'\''zarafa-spooler'\''}{archive_on_send} || '\''no'\''; }'


#
#--- monitor config ---
#
echo
echo "Creating zarafa-monitor-configuration-template ..."
echo "The monitor program sends quota warning mails to users who are over quota."
echo
mkdir -p /etc/e-smith/templates/etc/zarafa/monitor.cfg
cat /usr/share/doc/zarafa-monitor/example-config/monitor.cfg | sed -e 's/\r$//g' >  /etc/e-smith/templates/etc/zarafa/monitor.cfg/monitor.cfg
replace /etc/e-smith/templates/etc/zarafa/monitor.cfg/monitor.cfg log_method '{ ${'\''zarafa-monitor'\''}{log_method} || '\''file'\''; }'
replace /etc/e-smith/templates/etc/zarafa/monitor.cfg/monitor.cfg log_level '{ ${'\''zarafa-monitor'\''}{log_level} || '\''2'\''; }'
replace /etc/e-smith/templates/etc/zarafa/monitor.cfg/monitor.cfg log_timestamp '{ ${'\''zarafa-monitor'\''}{log_timestamp} || '\''1'\''; }'
replace /etc/e-smith/templates/etc/zarafa/monitor.cfg/monitor.cfg quota_check_interval '{ ${'\''zarafa-monitor'\''}{quota_check_interval} || '\''15'\''; }'
replace /etc/e-smith/templates/etc/zarafa/monitor.cfg/monitor.cfg mailquota_resend_interval '{ ${'\''zarafa-monitor'\''}{mailquota_resend_interval} || '\''1'\''; }'


#
#--- gateway config ---
#
echo
echo "Creating zarafa-gateway-configuration-template ..."
echo
mkdir -p /etc/e-smith/templates/etc/zarafa/gateway.cfg
cat /usr/share/doc/zarafa-gateway/example-config/gateway.cfg | sed -e 's/\r$//g' >  /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg server_socket 'http://localhost:{${'\''zarafa-server'\''}{TCPPort}||'\''236'\'';}/zarafa'
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg pop3_enable '{ if (${'\''zarafa-pop3'\''}{status} eq '\''enabled'\'') {'\''yes'\''} else {'\''no'\''}; }'
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg pop3_port '{ ${'\''zarafa-pop3'\''}{TCPPort} || '\''8110'\''; }'
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg pop3s_enable '{ if (${'\''zarafa-pop3s'\''}{status} eq '\''enabled'\'') {'\''yes'\''} else {'\''no'\''}; }'
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg pop3s_port '{ ${'\''zarafa-pop3s'\''}{TCPPort} || '\''8995'\''; }'
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg imap_enable '{ if (${'\''zarafa-imap'\''}{status} eq '\''enabled'\'') {'\''yes'\''} else {'\''no'\''}; }'
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg imap_port '{ ${'\''zarafa-imap'\''}{TCPPort} || '\''8143'\''; }'
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg imaps_enable '{ if (${'\''zarafa-imaps'\''}{status} eq '\''enabled'\'') {'\''yes'\''} else {'\''no'\''}; }'
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg imaps_port '{ ${'\''zarafa-imaps'\''}{TCPPort} || '\''8993'\''; }'
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg imap_only_mailfolders '{ ${'\''zarafa-imap'\''}{imap_only_mailfolders} || '\''yes'\''; }'
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg imap_public_folders '{ ${'\''zarafa-imap'\''}{imap_public_folders} || '\''yes'\''; }'
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg imap_capability_idle '{ ${'\''zarafa-imap'\''}{imap_capability_idle} || '\''yes'\''; }'
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg imap_max_messagesize '{ ${'\''zarafa-imap'\''}{imap_max_messagesize} || '\''134217728'\''; }'
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg imap_generate_utf8 '{ ${'\''zarafa-imap'\''}{imap_generate_utf8} || '\''no'\''; }'
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg imap_expunge_on_delete '{ ${'\''zarafa-imap'\''}{imap_expunge_on_delete} || '\''no'\''; }'
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg imap_store_rfc822 '{ ${'\''zarafa-imap'\''}{imap_store_rfc822} || '\''yes'\''; }'
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg ssl_private_key_file '/home/e-smith/ssl.key/{$SystemName}.{$DomainName}.key'
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg ssl_certificate_file '/home/e-smith/ssl.crt/{$SystemName}.{$DomainName}.crt'
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg ssl_verify_client '{ ${'\''zarafa-gateway'\''}{ssl_verify_client} || '\''no'\''; }'
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg process_model '{ ${'\''zarafa-gateway'\''}{process_model} || '\''fork'\''; }'
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg log_method '{ ${'\''zarafa-gateway'\''}{log_method} || '\''file'\''; }'
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg log_level '{ ${'\''zarafa-gateway'\''}{log_level} || '\''2'\''; }'
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg log_timestamp '{ ${'\''zarafa-gateway'\''}{log_timestamp} || '\''1'\''; }'
replace /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg ssl_enable_v2 '{ ${'\''zarafa-gateway'\''}{ssl_enable_v2} || '\''no'\''; }'


#
#--- ical config ---
#
echo
echo "Creating zarafa-ical-configuration-template ..."
echo
mkdir -p /etc/e-smith/templates/etc/zarafa/ical.cfg
cat /usr/share/doc/zarafa-ical/example-config/ical.cfg | sed -e 's/\r$//g' >  /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg ical_enable '{ if (${'\''zarafa-ical'\''}{status} eq '\''enabled'\'') {'\''yes'\''} else {'\''no'\''}; }'
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg ical_port '{ ${'\''zarafa-ical'\''}{TCPPort} || '\''8088'\''; }'
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg icals_enable '{ if (${'\''zarafa-icals'\''}{status} eq '\''enabled'\'') {'\''yes'\''} else {'\''no'\''}; }'
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg icals_port '{ ${'\''zarafa-icals'\''}{TCPPort} || '\''8089'\''; }'
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg server_socket 'http://localhost:{${'\''zarafa-server'\''}{TCPPort}||'\''236'\'';}/zarafa'
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg process_model '{ ${'\''zarafa-ical'\''}{process_model} || '\''fork'\''; }'
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg log_method '{ ${'\''zarafa-ical'\''}{log_method} || '\''file'\''; }'
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg log_level '{ ${'\''zarafa-ical'\''}{log_level} || '\''2'\''; }'
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg log_timestamp '{ ${'\''zarafa-ical'\''}{log_timestamp} || '\''1'\''; }'
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg ssl_private_key_file '/home/e-smith/ssl.key/{$SystemName}.{$DomainName}.key'
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg ssl_certificate_file '/home/e-smith/ssl.crt/{$SystemName}.{$DomainName}.crt'
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg ssl_verify_client '{ ${'\''zarafa-ical'\''}{ssl_verify_client} || '\''no'\''; }'
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg server_timezone '{$TimeZone}'
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg default_charset '{ ${'\''zarafa-ical'\''}{default_charset} || '\''utf-8'\''; }'
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg enable_ical_get '{ ${'\''zarafa-ical'\''}{enable_ical_get} || '\''yes'\''; }'
replace /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg ssl_enable_v2 '{ ${'\''zarafa-ical'\''}{ssl_enable_v2} || '\''no'\''; }'


#
#--- search config ---
#
echo
echo "Creating zarafa-search-configuration-template ..."
echo
mkdir -p /etc/e-smith/templates/etc/zarafa/search.cfg
cat /usr/share/doc/zarafa-search/example-config/search.cfg | sed -e 's/\r$//g' >  /etc/e-smith/templates/etc/zarafa/search.cfg/search.cfg
replace /etc/e-smith/templates/etc/zarafa/search.cfg/search.cfg coredump_enabled '{ ${'\''zarafa-search'\''}{coredump_enabled} || '\''no'\''; }'
replace /etc/e-smith/templates/etc/zarafa/search.cfg/search.cfg limit_results	'{ ${'\''zarafa-search'\''}{limit_results} || '\''0'\''; }'
replace /etc/e-smith/templates/etc/zarafa/search.cfg/search.cfg log_method '{ ${'\''zarafa-search'\''}{log_method} || '\''file'\''; }'
replace /etc/e-smith/templates/etc/zarafa/search.cfg/search.cfg log_level '{ ${'\''zarafa-search'\''}{log_level} || '\''2'\''; }'
replace /etc/e-smith/templates/etc/zarafa/search.cfg/search.cfg log_timestamp '{ ${'\''zarafa-search'\''}{log_timestamp} || '\''1'\''; }'
replace /etc/e-smith/templates/etc/zarafa/search.cfg/search.cfg term_cache_size '{ ${'\''zarafa-search'\''}{term_cache_size} || '\''64M'\''; }'
replace /etc/e-smith/templates/etc/zarafa/search.cfg/search.cfg optimize_start '{ ${'\''zarafa-search'\''}{optimize_start} || '\''2'\''; }'
replace /etc/e-smith/templates/etc/zarafa/search.cfg/search.cfg optimize_stop '{ ${'\''zarafa-search'\''}{optimize_stop} || '\''5'\''; }'
replace /etc/e-smith/templates/etc/zarafa/search.cfg/search.cfg optimize_age '{ ${'\''zarafa-search'\''}{optimize_age} || '\''7'\''; }'
replace /etc/e-smith/templates/etc/zarafa/search.cfg/search.cfg index_attachments '{ ${'\''zarafa-search'\''}{index_attachments} || '\''no'\''; }'
replace /etc/e-smith/templates/etc/zarafa/search.cfg/search.cfg index_attachment_max_size '{ ${'\''zarafa-search'\''}{index_attachment_max_size} || '\''5M'\''; }'
replace /etc/e-smith/templates/etc/zarafa/search.cfg/search.cfg index_attachment_parser_max_memory '{ ${'\''zarafa-search'\''}{index_attachment_parser_max_memory} || '\''0'\''; }'
replace /etc/e-smith/templates/etc/zarafa/search.cfg/search.cfg index_attachment_parser_max_cputime '{ ${'\''zarafa-search'\''}{index_attachment_parser_max_cputime} || '\''0'\''; }'


/bin/echo "webaccess config"
/bin/chown -R www:www /var/lib/zarafa-webaccess/tmp
/bin/chown -R www:www /var/lib/zarafa-webapp/tmp
FILE=/etc/httpd/conf.d/zarafa-webaccess.conf; if [ -a $FILE ]; then /bin/rm -f $FILE; fi
FILE=/etc/httpd/conf.d/zarafa-webapp.conf; if [ -a $FILE ]; then /bin/rm -f $FILE; fi


/bin/echo "Expanding Zarafa-templates"
/etc/e-smith/events/actions/zarafa-expand-templates

/bin/echo "Expanding http.conf-template"
/sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf

/bin/echo "Restarting httpd"
/usr/bin/sv restart /service/httpd-e-smith

/bin/echo "Starting Zarafa-services"
/etc/e-smith/events/actions/zarafa-services start

/bin/echo "Setting permissions on files"
FILE=/var/log/zarafa/dagent.log; if [ -a $FILE ]; then /bin/chmod 666 $FILE; fi

To save :
CTRL + X
yes
<ENTER>
Execute zarafa-update
cd /etc/e-smith/events/actions/
./zarafa-update
Only if you are upgrading from zcp 7.0.x to 7.1.x -> nano -w /etc/e-smith/events/actions/zarafa-update-to71 :
#!/usr/bin/env bash
clear

/bin/echo "Stopping the Zarafa-services"
/etc/e-smith/events/actions/zarafa-services stop

if [ `whoami` != "root" ]; then
	echo "This installation must be run as user root."
	echo "Become root, and run this script again."
	echo
	exit 1
fi

##########################################
# Creating some Zarafa-actions
##########################################

#
#--- zarafa-expand-templates ---
#
echo
echo "Creating zarafa-expand-templates-action ..."
echo
cat <<HERE1 > /etc/e-smith/events/actions/zarafa-expand-templates
#!/bin/sh
/sbin/e-smith/expand-template /etc/zarafa/gateway.cfg
/sbin/e-smith/expand-template /etc/zarafa/ical.cfg
/sbin/e-smith/expand-template /etc/zarafa/server.cfg
/sbin/e-smith/expand-template /etc/zarafa/unix.cfg
/sbin/e-smith/expand-template /etc/zarafa/monitor.cfg
/sbin/e-smith/expand-template /etc/zarafa/search.cfg
/sbin/e-smith/expand-template /etc/zarafa/spooler.cfg
/sbin/e-smith/expand-template /etc/zarafa/dagent.cfg
/sbin/e-smith/expand-template /etc/zarafa/licensed.cfg
/etc/e-smith/events/actions/qmail-update-user
HERE1


#
#--- zarafa-services ---
#
echo
echo "Creating zarafa-services-action ..."
echo
cat <<HERE2 > /etc/e-smith/events/actions/zarafa-services
#!/bin/sh
FILE=/etc/rc.d/init.d/zarafa-licensed
if [ "\$1" == start ]; then
 /etc/rc.d/init.d/zarafa-dagent start
 /etc/rc.d/init.d/zarafa-gateway start
 /etc/rc.d/init.d/zarafa-ical start
 if [ -a \$FILE ]; then \$FILE start; fi
 /etc/rc.d/init.d/zarafa-monitor start
 /etc/rc.d/init.d/zarafa-spooler start
 /etc/rc.d/init.d/zarafa-search start
 /etc/rc.d/init.d/zarafa-server start
 exit 0
fi
if [ "\$1" == stop ]; then
 /etc/rc.d/init.d/zarafa-dagent stop
 /etc/rc.d/init.d/zarafa-gateway stop
 /etc/rc.d/init.d/zarafa-ical stop
 if [ -a \$FILE ]; then \$FILE stop; fi
 /etc/rc.d/init.d/zarafa-search stop
 /etc/rc.d/init.d/zarafa-spooler stop
 /etc/rc.d/init.d/zarafa-server stop
 /etc/rc.d/init.d/zarafa-monitor stop  
 exit 0
fi
if [ "\$1" == restart ]; then
 /etc/rc.d/init.d/zarafa-dagent stop
 /etc/rc.d/init.d/zarafa-gateway stop
 /etc/rc.d/init.d/zarafa-ical stop
 if [ -a \$FILE ]; then \$FILE stop; fi
 /etc/rc.d/init.d/zarafa-monitor stop
 /etc/rc.d/init.d/zarafa-search stop
 /etc/rc.d/init.d/zarafa-spooler stop
 /etc/rc.d/init.d/zarafa-server stop
 /etc/rc.d/init.d/zarafa-dagent start
 /etc/rc.d/init.d/zarafa-gateway start
 /etc/rc.d/init.d/zarafa-ical start
 if [ -a \$FILE ]; then \$FILE start; fi
 /etc/rc.d/init.d/zarafa-monitor start
 /etc/rc.d/init.d/zarafa-server start
 /etc/rc.d/init.d/zarafa-spooler start
 /etc/rc.d/init.d/zarafa-search start
 exit 0
fi
if [ "\$1" == enabled ]; then
 config setprop zarafa-gateway status enabled
 config setprop zarafa-ical status enabled
 if [ -a \$FILE ]; then config setprop zarafa-licensed status enabled; fi
 config setprop zarafa-monitor status enabled
 config setprop zarafa-server status enabled
 config setprop zarafa-spooler status enabled
 config setprop zarafa-search status enabled
 config setprop zarafa-dagent status enabled
 exit 0
fi
if [ "\$1" == disabled ]; then
 config setprop zarafa-gateway status disabled
 config setprop zarafa-ical status disabled
 if [ -a \$FILE ]; then config setprop zarafa-licensed status disabled; fi
 config setprop zarafa-monitor status disabled
 config setprop zarafa-server status disabled
 config setprop zarafa-spooler status disabled
 config setprop zarafa-search status disabled
 config setprop zarafa-dagent status disabled
 exit 0
fi
echo "Usage: start|stop|restart|enabled|disabled"
exit 0
HERE2

/bin/chmod 554 /etc/e-smith/events/actions/zarafa-expand-templates
/bin/chmod 554 /etc/e-smith/events/actions/zarafa-services

######################################
# Setting up SME-db-entries
######################################

/sbin/e-smith/db configuration set zarafa-search service status enabled

######################################
# Setting up more symbolic links
######################################

/bin/echo
/bin/echo "Setting up more symbolic links"
/bin/echo

ln -s /etc/rc.d/init.d/e-smith-service /etc/rc.d/rc7.d/S99zarafa-search

/bin/echo "Expanding Zarafa-templates"
/etc/e-smith/events/actions/zarafa-expand-templates

/bin/echo "Expanding http.conf-template"
/sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf

/bin/echo "Restarting httpd"
/usr/bin/sv restart /service/httpd-e-smith

/bin/echo "Starting Zarafa-services"
/etc/e-smith/events/actions/zarafa-services start

To save :

 CTRL + X
 yes
 <ENTER>

Execute zarafa-update-to71
/bin/chmod 554 /etc/e-smith/events/actions/zarafa-update-to71
cd /etc/e-smith/events/actions/
./zarafa-update-to71
signal-event post-upgrade; signal-event reboot