Difference between revisions of "Zarafa on SME8"

From SME Server
Jump to navigationJump to search
 
(75 intermediate revisions by 5 users not shown)
Line 1: Line 1:
This howto is in progressBut it seems to work for several people.
+
{{Level|Advanced }}
 +
{{Note box|
 +
'''This wiki page is specific to SME8 only.'''
 +
 
 +
'''There is a separate wiki page on how to install Zarafa 7.x on SME7 [[Zarafa|Zarafa on SME 7]].'''
 +
 
 +
'''There is a separate wiki page with a ''fully automated'' install of Zarafa 7.1.x on SME9 that utilizes the unix plugin [[Zarafa on SME 9|Zarafa on SME 9]].'''
 +
}}
 +
 
 +
 
 +
*'''New zarafa-7.0.x- and z-push-install/upgradescripts for SME8'''<br>  These new 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> There is even more integration with the SME-perlDB too(Most of the zarafa-config-keys can be set in the SME-perlDB !).<br>
 +
*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.
 +
 
 +
_____________________
 +
 
 +
*Placeholder for [[Zarafa quick install script]]
 +
 
  
 
== Maintainer ==
 
== Maintainer ==
 
Frederik POLLET : [mailto:frederik.pollet@pollet-ghys.be email]
 
Frederik POLLET : [mailto:frederik.pollet@pollet-ghys.be email]
 +
 +
===Version===
 +
{{#smeversion:smeserver-zarafa}}
 +
{{#smeversion:zarafa}}
  
 
== Description ==
 
== Description ==
Line 8: Line 29:
 
*http://z-push.sourceforge.net/soswp/
 
*http://z-push.sourceforge.net/soswp/
  
Zarafa is a workgroup sharing solution based on the look-and-feel of Microsoft Outlook, which enables the sharing of mail, contacts, appointments and tasks in a web-based interface and Microsoft Outlook or other clients. It can be used as a MS Exchange replacement, even featuring public folders.
+
Zarafa is a groupware-server which enables the sharing of mail, contacts, appointments, notes and tasks in a web-interface and/or Microsoft Outlook (or even other clients). It supports MAPI, POP3, IMAP, CalDAV/iCal. It can be used as a MS Exchange replacement, even featuring public folders. Connecting Microsoft Outlook with this groupware-server is simple, enabling most of the MS Exchange-functions.
  
 
Z-push is an implementation of Microsoft's ActiveSync protocol which is used 'over-the-air' for multi platform active sync devices, including Windows Mobile and active sync used on Apple's iPhone, Sony Ericsson and Nokia phones. Open source Z-Push enables any PHP-based groupware package to become fully syncable with any ActiveSync-compliant device.
 
Z-push is an implementation of Microsoft's ActiveSync protocol which is used 'over-the-air' for multi platform active sync devices, including Windows Mobile and active sync used on Apple's iPhone, Sony Ericsson and Nokia phones. Open source Z-Push enables any PHP-based groupware package to become fully syncable with any ActiveSync-compliant device.
  
== Installing Zarafa 7.0.8 and above on SME 8 + Z-push ==
+
== Making some decisions before installing ==
=== Making some decisions before installing : ===
 
  
 
Zarafa can be configured with 3 different 'user-backends' :
 
Zarafa can be configured with 3 different 'user-backends' :
Line 20: Line 40:
 
*LDAP/AD (not implemented in this howto)
 
*LDAP/AD (not implemented in this howto)
  
Using the '''db-plugin''' in the zarafa-configuration, let you make your zarafa-users in the MySQL-zarafadatabase, with a separate user-password for every zarafa-user and a store. So, you make your separated Zarafa-users and the stores for these zarafa-users one by one in the zarafa-MySQL-database.  There is no syncronisation between the SME-user-passwords and the Zarafa-user-passwords. You can only enable maildelivery for a SME/unix-user to a zarafa-user with the same logon-name.<br>
+
Using the '''db-plugin''' in the Zarafa-configuration, let you make your zarafa-users in the MySQL-zarafadatabase, with a separate user-password for every Zarafa-user and a store. So, you make your separated Zarafa-users and the stores for these Zarafa-users one by one in the Zarafa-MySQL-database with the '''zarafa-admin'''-tool and sripts in this howto.  There is no syncronisation between the SME-user-passwords and the Zarafa-user-passwords. You can only enable maildelivery for a SME/unix-user to a Zarafa-user <u>with the same logon-name</u>.<br>
 +
 
 +
When using the '''unix-plugin''' in the Zarafa-configuration, Zarafa makes a store for every SME/unix-user on your system, except for those who are excluded by the template used in this howto. Zarafa uses the passwords of the SME/unix-users. There are no separated Zarafa-users and no separated passwords. You can enable maildelivery for a SME/unix-user to Zarafa. Since the unix files do not contain enough information for Zarafa, there are some properties of a user that will be stored in the MySQL-zarafadatabase. These properties are the email address, overriding quota settings, and administrator settings. The '''zarafa-admin'''-tool has to be used to update these user properties. All other user-properties are done using the normal unix tools.  '''The unix-plugin seems to be your best choice if all your SME-users will use Zarafa Webaccess/Microsoft Outlook, and you don't need a multicompany-environment'''.<br>
  
When using the '''unix-plugin''' in the zarafa-configuration, zarafa makes a store for every SME/unix-user on your system, except for those who are excluded by the template used in this howto. Zarafa uses the passwords of the SME/unix-users. You can enable maildelivery for a SME/unix-user to Zarafa.  The unix-plugin seems to be your best choice if all your SME-users will use Zarafa Webaccess/Microsoft Outlook, and you don't need a multicompany-environment.<br>
+
[http://doc.zarafa.com/7.0/Administrator_Manual/en-US/html-single/index.html#_user_authentication MORE INFORMATION]
  
 
In a multicompany-evironment every company has his own Global Adressbook and public folders.
 
In a multicompany-evironment every company has his own Global Adressbook and public folders.
Line 28: Line 50:
 
{{Warning box|IMPORTANT : If you want to have a multicompany-environment, <u>format of the SME/unix-username and the ZARAFA-username has to be [username].[companyname]</u> !!!<br>}}
 
{{Warning box|IMPORTANT : If you want to have a multicompany-environment, <u>format of the SME/unix-username and the ZARAFA-username has to be [username].[companyname]</u> !!!<br>}}
  
=== Search latest php53-mapi.rpm : ===
+
== INSTALLATION of VERSION 7.0.x ==
 +
=== Search latest php53-mapi.rpm for 7.0.x (NOT 7.1.x !) ===
  
 
SME8 uses PHP5.3<br>
 
SME8 uses PHP5.3<br>
Line 35: Line 58:
 
  https://community.zarafa.com/pg/blog/read/1837/support-for-php-53-in-rhel-5-via-new-php53mapi-rpm-package
 
  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 php53-mapi-package.
+
So, search on the EPEL-repositories <u>'''the latest''' php53-mapi-package</u> for 7.0.x (NOT 7.1.x !).
  
 
  https://admin.fedoraproject.org/updates/search/php53-mapi?
 
  https://admin.fedoraproject.org/updates/search/php53-mapi?
  
=== Set the epel-repository :===
+
=== Set the epel-repository (incl. epel-testing) :===
  
 
  /sbin/e-smith/db yum_repositories set epel repository \
 
  /sbin/e-smith/db yum_repositories set epel repository \
Line 45: Line 68:
 
  BaseUrl 'http://download.fedoraproject.org/pub/epel/5/$basearch' \
 
  BaseUrl 'http://download.fedoraproject.org/pub/epel/5/$basearch' \
 
  MirrorList 'http://mirrors.fedoraproject.org/mirrorlist?repo=epel-5&arch=$basearch' \
 
  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 \
 +
Name 'Epel-testing - EL5' \
 +
BaseUrl 'http://download.fedoraproject.org/pub/epel/testing/5/$basearch' \
 +
MirrorList 'http://mirrors.fedoraproject.org/mirrorlist?repo=testing-epel5&arch=$basearch' \
 
  EnableGroups no \
 
  EnableGroups no \
 
  GPGCheck yes \
 
  GPGCheck yes \
Line 53: Line 86:
 
  signal-event yum-modify
 
  signal-event yum-modify
  
=== ONLY IF YOU ARE UPDATING AN EXISTING ZARAFA-7-INSTALLATION -> Remove the existing php53-mapi.rpm first : ===
+
=== Download via the Zarafawebsite the package for ZCP <u>''corresponding'' with the php53-mapi.rpm (cf. version above !!)</u> ===
  
  rpm -e php53-mapi --nodeps
+
Make an installdirectory (ex. : /root/InstallZarafa)
 +
 
 +
  mkdir -p /root/InstallZarafa
 +
 
 +
Go (cd /...) to the installdirectory (ex. : /root/InstallZarafa) :
  
=== Download via the Zarafawebsite the package for ZCP corresponding with the php53-mapi.rpm (cf. version above) : ===
+
cd /to the installdirectory
  
cd /to an installdirectory, ex. : /root/InstallZarafa
+
ex.:  
 +
 +
cd /root/InstallZarafa
  
 
  wget http://download.zarafa.com/community/final/7.0/[version]/zcp-[version]-rhel-5-[cpu-arch]-free.tar.gz
 
  wget http://download.zarafa.com/community/final/7.0/[version]/zcp-[version]-rhel-5-[cpu-arch]-free.tar.gz
Line 65: Line 104:
 
The 'free'-version has the ability to connect with Microsoft Outlook (default 3 users for free, buy zarafa-CAL's if you want more).
 
The 'free'-version has the ability to connect with Microsoft Outlook (default 3 users for free, buy zarafa-CAL's if you want more).
  
=== Download the Z-push-package (version 1.5 !!) : ===
+
=== Unpack the corresponding package for ZCP :===
 
 
wget http://zarafa-deutschland.de/z-push-download/final/1.5/[z-push-latest version]
 
 
 
Save in the same installdirectory, ex. : root/InstallZarafa
 
 
 
=== 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 zcp-*
 
  tar -zxvf zcp-*
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'.
 
  
 +
=== Remove the devel packages ===
 
Go  (cd ./zcp-...) to the created subdirectory (zcp-...) :
 
Go  (cd ./zcp-...) to the created subdirectory (zcp-...) :
  
 
  cd ./zcp- ...  
 
  cd ./zcp- ...  
 +
rm -f *-dev*.rpm
  
'''Remove the devel packages'''
+
Move the windows-directory to an installshare in your network
'''Move the windows-directory to an installshare in your network'''
 
  
=== Download the latest webapp.rpm too in the same subdirectory : ===
+
=== Download the latest webapp.rpm too in the same subdirectory :===
  
  wget http://download.zarafa.com/community/final/WebApp/1.1/rhel/[zarafa-webapp-version.noarch.rpm]
+
  wget http://download.zarafa.com/community/final/WebApp/[version]/rhel/[zarafa-webapp-version.noarch.rpm]
  
=== Install all rpm's in the unpacked package of ZCP and the webapp.rpm too : ===
+
=== Install all rpm's in the unpacked package of ZCP and the webapp.rpm too :===
  
 
  yum localinstall *.rpm
 
  yum localinstall *.rpm
Line 101: Line 126:
 
All packages have dependencies that cannot be resolved if you install only part of the rpm's.
 
All packages have dependencies that cannot be resolved if you install only part of the rpm's.
  
If you only want to upgrade one package (ex. the Webapp) :
+
=== Remove the default php-mapi.rpm ===
 
 
cd /to the new Webapp.rpm
 
rpm -Uvh --force zarafa-webapp-[version].noarch
 
 
 
=== Remove the default php-mapi.rpm : ===
 
  
 
We have to remove the installation of the default php-mapi (because it's not built for php 5.3).
 
We have to remove the installation of the default php-mapi (because it's not built for php 5.3).
Line 112: Line 132:
 
  rpm -e php-mapi --nodeps
 
  rpm -e php-mapi --nodeps
  
=== Install the php53-mapi.rpm : ===
+
=== Install the php53-mapi.rpm ===
 
 
Install the php53-mapi.rpm of the EPEL-repository :
 
 
 
 
-If you downloaded the rpm :
 
-If you downloaded the rpm :
  
Line 122: Line 139:
 
-If you did set the EPEL-repository :
 
-If you did set the EPEL-repository :
  
  yum install php53-mapi --enablerepo=epel
+
  yum install php53-mapi-[same ZCP-verion as above] --enablerepo=epel --enablerepo=epel-testing
 +
 
 +
=== Make install/update-actions ===
 +
==== INSTALLSCRIPT ====
 +
===== nano -w /etc/e-smith/events/actions/zarafa-install =====
 +
 
 +
<nowiki>
 +
#!/usr/bin/env bash
 +
clear
  
=== ONLY FOR FIRST INSTALLATION : Make actions : ===
+
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
  
==== nano -w /etc/e-smith/events/actions/zarafa-expand-templates ====
+
##########################################
 +
# Creating some Zarafa-actions
 +
##########################################
  
<nowiki>
+
#
 +
#--- zarafa-expand-templates ---
 +
#
 +
echo
 +
echo "Creating zarafa-expand-templates-action ..."
 +
echo
 +
cat <<HERE1 > /etc/e-smith/events/actions/zarafa-expand-templates
 
#!/bin/sh
 
#!/bin/sh
 
 
/sbin/e-smith/expand-template /etc/zarafa/gateway.cfg
 
/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/ical.cfg
Line 140: Line 177:
 
/sbin/e-smith/expand-template /etc/zarafa/dagent.cfg
 
/sbin/e-smith/expand-template /etc/zarafa/dagent.cfg
 
/sbin/e-smith/expand-template /etc/zarafa/licensed.cfg
 
/sbin/e-smith/expand-template /etc/zarafa/licensed.cfg
</nowiki>
+
/etc/e-smith/events/actions/qmail-update-user
 +
HERE1
  
==== nano -w /etc/e-smith/events/actions/zarafa-services ====
 
  
<nowiki>
+
#
 +
#--- zarafa-services ---
 +
#
 +
echo
 +
echo "Creating zarafa-services-action ..."
 +
echo
 +
cat <<HERE2 > /etc/e-smith/events/actions/zarafa-services
 
#!/bin/sh
 
#!/bin/sh
 
FILE=/etc/rc.d/init.d/zarafa-licensed
 
FILE=/etc/rc.d/init.d/zarafa-licensed
if [ "$1" == start ]; then
+
if [ "\$1" == start ]; then
 
  /etc/rc.d/init.d/zarafa-dagent start
 
  /etc/rc.d/init.d/zarafa-dagent start
 
  /etc/rc.d/init.d/zarafa-gateway start
 
  /etc/rc.d/init.d/zarafa-gateway start
 
  /etc/rc.d/init.d/zarafa-ical start
 
  /etc/rc.d/init.d/zarafa-ical start
  if [ -a $FILE ]; then $FILE start; fi
+
  if [ -a \$FILE ]; then \$FILE start; fi
 
  /etc/rc.d/init.d/zarafa-monitor start
 
  /etc/rc.d/init.d/zarafa-monitor start
 
  /etc/rc.d/init.d/zarafa-spooler start
 
  /etc/rc.d/init.d/zarafa-spooler start
Line 158: Line 201:
 
  exit 0
 
  exit 0
 
fi
 
fi
if [ "$1" == stop ]; then
+
if [ "\$1" == stop ]; then
 
  /etc/rc.d/init.d/zarafa-dagent stop
 
  /etc/rc.d/init.d/zarafa-dagent stop
 
  /etc/rc.d/init.d/zarafa-gateway stop
 
  /etc/rc.d/init.d/zarafa-gateway stop
 
  /etc/rc.d/init.d/zarafa-ical stop
 
  /etc/rc.d/init.d/zarafa-ical stop
  if [ -a $FILE ]; then $FILE stop; fi
+
  if [ -a \$FILE ]; then \$FILE stop; fi
 
  /etc/rc.d/init.d/zarafa-indexer stop
 
  /etc/rc.d/init.d/zarafa-indexer stop
 
  /etc/rc.d/init.d/zarafa-spooler stop
 
  /etc/rc.d/init.d/zarafa-spooler stop
Line 169: Line 212:
 
  exit 0
 
  exit 0
 
fi
 
fi
if [ "$1" == restart ]; then
+
if [ "\$1" == restart ]; then
 
  /etc/rc.d/init.d/zarafa-dagent stop
 
  /etc/rc.d/init.d/zarafa-dagent stop
 
  /etc/rc.d/init.d/zarafa-gateway stop
 
  /etc/rc.d/init.d/zarafa-gateway stop
 
  /etc/rc.d/init.d/zarafa-ical stop
 
  /etc/rc.d/init.d/zarafa-ical stop
  if [ -a $FILE ]; then $FILE stop; fi
+
  if [ -a \$FILE ]; then \$FILE stop; fi
 
  /etc/rc.d/init.d/zarafa-monitor stop
 
  /etc/rc.d/init.d/zarafa-monitor stop
 
  /etc/rc.d/init.d/zarafa-indexer stop
 
  /etc/rc.d/init.d/zarafa-indexer stop
Line 181: Line 224:
 
  /etc/rc.d/init.d/zarafa-gateway start
 
  /etc/rc.d/init.d/zarafa-gateway start
 
  /etc/rc.d/init.d/zarafa-ical start
 
  /etc/rc.d/init.d/zarafa-ical start
  if [ -a $FILE ]; then $FILE start; fi
+
  if [ -a \$FILE ]; then \$FILE start; fi
 
  /etc/rc.d/init.d/zarafa-monitor start
 
  /etc/rc.d/init.d/zarafa-monitor start
 
  /etc/rc.d/init.d/zarafa-server start
 
  /etc/rc.d/init.d/zarafa-server start
Line 188: Line 231:
 
  exit 0
 
  exit 0
 
fi
 
fi
if [ "$1" == enabled ]; then
+
if [ "\$1" == enabled ]; then
 
  config setprop zarafa-gateway status enabled
 
  config setprop zarafa-gateway status enabled
 
  config setprop zarafa-ical status enabled
 
  config setprop zarafa-ical status enabled
  if [ -a $FILE ]; then config setprop zarafa-licensed status enabled; fi
+
  if [ -a \$FILE ]; then config setprop zarafa-licensed status enabled; fi
 
  config setprop zarafa-monitor status enabled
 
  config setprop zarafa-monitor status enabled
 
  config setprop zarafa-server status enabled
 
  config setprop zarafa-server status enabled
Line 199: Line 242:
 
  exit 0
 
  exit 0
 
fi
 
fi
if [ "$1" == disabled ]; then
+
if [ "\$1" == disabled ]; then
 
  config setprop zarafa-gateway status disabled
 
  config setprop zarafa-gateway status disabled
 
  config setprop zarafa-ical status disabled
 
  config setprop zarafa-ical status disabled
  if [ -a $FILE ]; then config setprop zarafa-licensed status disabled; fi
+
  if [ -a \$FILE ]; then config setprop zarafa-licensed status disabled; fi
 
  config setprop zarafa-monitor status disabled
 
  config setprop zarafa-monitor status disabled
 
  config setprop zarafa-server status disabled
 
  config setprop zarafa-server status disabled
Line 212: Line 255:
 
echo "Usage: start|stop|restart|enabled|disabled"
 
echo "Usage: start|stop|restart|enabled|disabled"
 
exit 0
 
exit 0
</nowiki>
+
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
  
==== nano -w /etc/e-smith/events/actions/zarafa-install ====
 
  
<nowiki>
+
#
 +
#--- zarafa-create-company-action ---
 +
#
 +
echo
 +
echo "Creating zarafa-create-company-action ..."
 +
echo
 +
cat <<HERE4 > /etc/e-smith/events/actions/zarafa-create-company
 
#!/bin/sh
 
#!/bin/sh
 
clear
 
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-expand-templates
 
/bin/chmod 554 /etc/e-smith/events/actions/zarafa-services
 
/bin/chmod 554 /etc/e-smith/events/actions/zarafa-services
/bin/chmod 554 /etc/e-smith/events/actions/zarafa-update
 
 
/bin/chmod 554 /etc/e-smith/events/actions/zarafa-create-user
 
/bin/chmod 554 /etc/e-smith/events/actions/zarafa-create-user
 
/bin/chmod 554 /etc/e-smith/events/actions/zarafa-create-company
 
/bin/chmod 554 /etc/e-smith/events/actions/zarafa-create-company
  
/bin/echo "Enter the language of your choice for your zarafa-mailboxes and public store. Values: en_US.UTF-8, en_GB.UTF-8, nl_NL.UTF-8, fr_FR.UTF-8, de_DE.UTF-8, ..."
+
#
read ZARAFALANGUAGE
+
#--- zarafa-configuration-helper-action ---
/sbin/e-smith/config set zarafa service status enabled language $ZARAFALANGUAGE
+
#
/sbin/e-smith/expand-template /etc/sysconfig/zarafa
+
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 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'\''; }'
 +
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'\''; }'
 +
 
 +
 
 +
#
 +
#--- 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'\''; }'
 +
 
 +
 
 +
######################################
 +
# Configuring SME-events : Templates to expand
 +
######################################
  
/bin/echo "Setting up templates2expand-files"
+
/bin/echo
 +
/bin/echo "Configuring SME-events : Templates2expand"
 +
/bin/echo
 
mkdir -p /etc/e-smith/events/email-update/templates2expand/etc/zarafa
 
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/gateway.cfg
Line 277: Line 930:
 
touch /etc/e-smith/events/post-upgrade/templates2expand/etc/zarafa/dagent.cfg
 
touch /etc/e-smith/events/post-upgrade/templates2expand/etc/zarafa/dagent.cfg
  
mkdir -p /etc/e-smith/events/timezone-update/templates2expand/etc/zarafa
 
touch /etc/e-smith/events/timezone-update/templates2expand/etc/zarafa/ical.cfg
 
  
/bin/echo "Setting up services2adjust-links"
+
######################################
 +
# 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-create/services2adjust/zarafa-server
 
ln -s reload /etc/e-smith/events/group-delete/services2adjust/zarafa-server
 
ln -s reload /etc/e-smith/events/group-delete/services2adjust/zarafa-server
Line 291: Line 949:
 
ln -s reload /etc/e-smith/events/timezone-update/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 "Initialize-default-databases"
 +
/bin/echo
 
/etc/e-smith/events/actions/initialize-default-databases
 
/etc/e-smith/events/actions/initialize-default-databases
  
 +
/bin/echo
 
/bin/echo "Setting up db-entries for Zarafa"
 
/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 mysqld InnoDB enabled
 
/sbin/e-smith/db configuration setprop smtpd tnef2mime disabled
 
/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
 
/sbin/e-smith/db configuration setprop zarafa-server access private status enabled TCPPort 236 index_services_enabled yes
/bin/echo "Enter your user plugin. Values: unix or db (ldap is not supported, multicompany-support only with db-plugin)"
+
/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
 
read USERPLUGIN
/sbin/e-smith/db configuration setprop zarafa-server Plugin $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
 
if [ "$USERPLUGIN" == db ]; then
/bin/echo "Do you want to set up a multicompany-environment ? Values: yes or no"
+
/bin/echo
 +
/bin/echo "Do you want to set up a multicompany-environment ?"
 +
/bin/echo "Values: yes or no."
 +
/bin/echo
 
read MULTICOMPANY
 
read MULTICOMPANY
 
/sbin/e-smith/db configuration setprop zarafa-server Multicompany $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
 
fi
  
Line 323: Line 1,016:
 
/sbin/e-smith/db configuration set zarafa-dagent 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 "Expanding the my.cnf-template"
 +
/bin/echo
 
/sbin/e-smith/expand-template /etc/my.cnf
 
/sbin/e-smith/expand-template /etc/my.cnf
  
 +
/bin/echo
 
/bin/echo "Restarting mysqld"
 
/bin/echo "Restarting mysqld"
 +
/bin/echo
 
/usr/bin/sv t /service/mysqld
 
/usr/bin/sv t /service/mysqld
  
 +
/bin/echo
 
/bin/echo "Signal-event remoteaccess-update"
 
/bin/echo "Signal-event remoteaccess-update"
 +
/bin/echo
 
/sbin/e-smith/signal-event remoteaccess-update
 
/sbin/e-smith/signal-event remoteaccess-update
  
 +
/bin/echo
 
/bin/echo "Creating the Zarafa-database"
 
/bin/echo "Creating the Zarafa-database"
 +
/bin/echo
 
/sbin/e-smith/expand-template /etc/e-smith/sql/init/80zarafa
 
/sbin/e-smith/expand-template /etc/e-smith/sql/init/80zarafa
 
/etc/rc.d/init.d/mysql.init start
 
/etc/rc.d/init.d/mysql.init start
  
/bin/echo "Expanding the Zarafa-templates"
+
 
 +
######################################
 +
# Expanding the Zarafa-configuration-templates
 +
######################################
 +
 
 +
/bin/echo
 +
/bin/echo "Expanding the Zarafa-configuration-templates"
 +
/bin/echo
 
/etc/e-smith/events/actions/zarafa-expand-templates
 
/etc/e-smith/events/actions/zarafa-expand-templates
  
/bin/echo "Configuration of the Webaccess and Z-push"
+
 
 +
######################################
 +
# 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-webaccess/tmp
 
/bin/chown -R www:www /var/lib/zarafa-webapp/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-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
 
FILE=/etc/httpd/conf.d/zarafa-webapp.conf; if [ -a $FILE ]; then /bin/rm -f $FILE; fi
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
 
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
 
 
  
 +
/bin/echo
 
/bin/echo "Expanding http.conf-template"
 
/bin/echo "Expanding http.conf-template"
 +
/bin/echo
 
/sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf
 
/sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf
  
 +
/bin/echo
 
/bin/echo "Restarting httpd"
 
/bin/echo "Restarting httpd"
 +
/bin/echo
 
/usr/bin/sv restart /service/httpd-e-smith
 
/usr/bin/sv restart /service/httpd-e-smith
  
 +
 +
######################################
 +
# Setting up more symbolic links
 +
######################################
 +
 +
/bin/echo
 
/bin/echo "Setting up more symbolic links"
 
/bin/echo "Setting up more symbolic links"
ln -s /lib/libcrypto.so.0.9.8e /usr/lib/libcrypto.so.0.9.8
+
/bin/echo
ln -s /lib/libssl.so.0.9.8e /usr/lib/libssl.so.0.9.8
+
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-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-gateway
Line 369: Line 1,100:
 
ln -s /etc/rc.d/init.d/e-smith-service /etc/rc.d/rc7.d/S99zarafa-server
 
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 "Installing a license-key"
 +
/bin/echo
 
if [ -x /usr/bin/zarafa-licensed ]; then
 
if [ -x /usr/bin/zarafa-licensed ]; then
 
if [ ! -f /etc/zarafa/license/base ]; then
 
if [ ! -f /etc/zarafa/license/base ]; then
Line 389: Line 1,127:
 
fi
 
fi
  
 +
 +
#######################################
 +
# Starting Zarafa
 +
#######################################
 +
 +
/bin/echo
 
/bin/echo "Starting Zarafa-services"
 
/bin/echo "Starting Zarafa-services"
 +
/bin/echo
 
/etc/e-smith/events/actions/zarafa-services start
 
/etc/e-smith/events/actions/zarafa-services start
  
 +
/bin/echo
 
/bin/echo "Setting permissions on files"
 
/bin/echo "Setting permissions on files"
 +
/bin/echo
 
FILE=/var/log/zarafa/dagent.log; if [ -a $FILE ]; then /bin/chmod 666 $FILE; fi
 
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
 
if [ "$USERPLUGIN" == unix ]; then
 +
/bin/echo
 
/bin/echo "creating Public store"
 
/bin/echo "creating Public store"
 +
/bin/echo
 
/usr/bin/zarafa-admin --utf8 -s
 
/usr/bin/zarafa-admin --utf8 -s
 
fi
 
fi
Line 402: Line 1,157:
 
if [ "$USERPLUGIN" == db ]; then
 
if [ "$USERPLUGIN" == db ]; then
 
if [ "$MULTICOMPANY" == no ]; then
 
if [ "$MULTICOMPANY" == no ]; then
 +
/bin/echo
 
/bin/echo "creating Public store"
 
/bin/echo "creating Public store"
 +
/bin/echo
 
/usr/bin/zarafa-admin --utf8 -s
 
/usr/bin/zarafa-admin --utf8 -s
 
fi
 
fi
Line 409: Line 1,166:
 
if [ "$USERPLUGIN" == db ]; then
 
if [ "$USERPLUGIN" == db ]; then
 
if [ "$MULTICOMPANY" == yes ]; then
 
if [ "$MULTICOMPANY" == yes ]; then
 +
/bin/echo
 
  /bin/echo "Make your first company. Enter your first companyname :"
 
  /bin/echo "Make your first company. Enter your first companyname :"
 +
/bin/echo
 
  read COMPANYNAME
 
  read COMPANYNAME
 
  /usr/bin/zarafa-admin --create-company "$COMPANYNAME"
 
  /usr/bin/zarafa-admin --create-company "$COMPANYNAME"
  /bin/echo "!!! REMEMBER !!! : for a multicompany-environment the username-format of the SME-user and the ZARAFA-user, has to be : [username].[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
 
fi
 
fi
 
</nowiki>
 
</nowiki>
  
==== nano -w /etc/e-smith/events/actions/zarafa-update ====
+
===== To save : =====
 +
CTRL + X
 +
yes
 +
<ENTER>
 +
 
 +
==== UPGRADESCRIPT ====
 +
===== nano -w /etc/e-smith/events/actions/zarafa-update =====
  
 
  <nowiki>
 
  <nowiki>
Line 424: Line 1,192:
 
/bin/echo "Stopping the Zarafa-services"
 
/bin/echo "Stopping the Zarafa-services"
 
/etc/e-smith/events/actions/zarafa-services stop
 
/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 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'\''; }'
 +
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'\''; }'
 +
 +
 +
#
 +
#--- 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'\''; }'
 +
  
 
/bin/echo "webaccess config"
 
/bin/echo "webaccess config"
Line 430: Line 1,490:
 
FILE=/etc/httpd/conf.d/zarafa-webaccess.conf; if [ -a $FILE ]; then /bin/rm -f $FILE; fi
 
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
 
FILE=/etc/httpd/conf.d/zarafa-webapp.conf; if [ -a $FILE ]; then /bin/rm -f $FILE; fi
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
 
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
 
  
 
/bin/echo "Expanding Zarafa-templates"
 
/bin/echo "Expanding Zarafa-templates"
Line 452: Line 1,508:
 
</nowiki>
 
</nowiki>
  
==== nano -w /etc/e-smith/events/actions/zarafa-create-user (ONLY FOR DB-PLUGIN) ====
+
===== To save : =====
 +
CTRL + X
 +
yes
 +
<ENTER>
  
  <nowiki>
+
=== Execute zarafa-install (see installscript above for 7.0.x !!!!) ===
#!/bin/sh
+
 
 +
  /bin/chmod 554 /etc/e-smith/events/actions/zarafa-install
 +
 
 +
cd /etc/e-smith/events/actions/
 +
 
 +
./zarafa-install
 +
 
 +
signal-event post-upgrade; signal-event reboot
 +
 
 +
== UPGRADING of Zarafa ==
 +
 
 +
=== VERSION 7.0.x (7.0.x -> 7.0.x) ===
 +
==== Download via the Zarafawebsite the package for ZCP corresponding with the newest php53-mapi.rpm (cf. version above) ====
 +
 
 +
Go (cd /...) to the installdirectory (ex. : /root/InstallZarafa) :
 +
 
 +
cd /to the installdirectory
 +
 
 +
ex.:
 +
 +
cd /root/InstallZarafa
 +
 
 +
wget http://download.zarafa.com/community/final/7.0/[version]/zcp-[version]-rhel-5-[cpu-arch]-free.tar.gz
 +
 
 +
==== Unpack the corresponding package for ZCP :====
 +
 
 +
tar -zxvf zcp-*
 +
 
 +
==== Remove the devel packages ====
 +
 
 +
Go  (cd ./zcp-...) to the created subdirectory (zcp-...) :
 +
 
 +
cd ./zcp- ...
 +
rm -f *-dev*.rpm
 +
 
 +
Move the windows-directory to an installshare in your network
 +
 
 +
==== Download the latest webapp.rpm too in the same subdirectory :====
 +
 
 +
wget http://download.zarafa.com/community/final/WebApp/[version]/rhel/[zarafa-webapp-version.noarch.rpm]
 +
 
 +
==== !!! Remove the existing php53-mapi.rpm first : !!! ====
 +
 
 +
rpm -e php53-mapi --nodeps
 +
 
 +
==== Install all rpm's in the unpacked package of ZCP and the webapp.rpm too :====
 +
 
 +
yum localinstall *.rpm
 +
 
 +
All packages have dependencies that cannot be resolved if you install only part of the rpm's.
 +
 
 +
If you only want to upgrade one package (ex. the Webapp) :
 +
 
 +
cd /to the new Webapp.rpm
 +
rpm -Uvh --force zarafa-webapp-[version].noarch
 +
 
 +
==== Remove the default php-mapi.rpm ====
 +
 
 +
We have to remove the installation of the default php-mapi (because it's not built for php 5.3).
  
clear
+
rpm -e php-mapi --nodeps
  
/bin/echo "Enter the username of the ZARAFA-user"
+
==== Install the NEW php53-mapi.rpm ====
/bin/echo "If you have a multicompany-setup, format of the SME-username and the ZARAFA-username"
+
-If you downloaded the rpm :
/bin/echo "has to be [username].[companyname] !!!"
 
read USERNAME
 
  
/bin/echo "Enter password:"
+
rpm -Uvh --force php53-mapi
read PASSWORD
 
  
/bin/echo "Enter e-mail address:"
+
-If you did set the EPEL-repository :
read EMAIL
 
  
/bin/echo "Enter full name:"
+
yum install php53-mapi-[same ZCP-verion as above] --enablerepo=epel --enablerepo=epel-testing
read FULLNAME
 
  
/bin/echo "Executing..."
+
==== Execute zarafa-update (see upgradescript above for 7.0.x !!!!) ====
  
/usr/bin/zarafa-admin -c "$USERNAME" -p "$PASSWORD" -e "$EMAIL" -f "$FULLNAME"
+
cd /etc/e-smith/events/actions/
/usr/bin/zarafa-admin -l
 
  
/sbin/e-smith/db accounts setprop $USERNAME zarafa enabled
+
./zarafa-update
/etc/e-smith/events/actions/qmail-update-user
 
</nowiki>
 
  
==== nano -w /etc/e-smith/events/actions/zarafa-create-company (ONLY FOR DB-PLUGIN) ====
+
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 :
  
  <nowiki>
+
  http://doc.zarafa.com/7.0/Release_Notes/en-US/html-single/
#!/bin/sh
 
  
clear
+
signal-event post-upgrade; signal-event reboot
/bin/echo "Enter the companyname :"
 
read COMPANYNAME
 
  
/bin/echo "Executing..."
+
== INSTALLATION of Z-push (1.5.x or 2.0.x) ==
  
/usr/bin/zarafa-admin --create-company "$COMPANYNAME"
+
* You can test if z-push is installed and functioning by going to http://[your-server-ip]/Microsoft-Server-ActiveSync You should be presented with a login request, and if you cancel, you will see Z-Push info. If you see both, z-push is working just fine.
</nowiki>
+
* If you experience (all of a sudden) z-push issues with your smartphone, please increase the PHP memory limit as descibed [http://wiki.contribs.org/Useful_Commands#Memory_Limit here]
 +
* Please note that z-push version 2.1 works with the below 2.0.x instructions, but you need to install php-posix
 +
yum install php-posix
  
=== ONLY FOR FIRST INSTALLATION : Make templates : ===
+
=== VERSION 1.5.x ===
 +
==== Download the Z-push-package (version 1.5 !!)====
  
==== nano -w /etc/e-smith/db/configuration/migrate/80zarafa ====
+
wget http://zarafa-deutschland.de/z-push-download/final/1.5/[z-push-latest version]
<nowiki>
 
{
 
    use MIME::Base64 qw(encode_base64);
 
  
    my $rec = $DB->get('zarafa-server') || $DB->new_record('zarafa-server', {type => 'service'});
+
Save in an installdirectory, ex. : root/InstallZPush
  
    my $pw = $rec->prop('DbPassword');
+
==== Unpack the package for Z-push :====
    return "" if $pw;
 
  
    $rec->set_prop('DbPassword', sprintf("%15.0f", int( (1000000000000000) * rand() )));
+
Go (cd /...) to the installdirectory (if you haven't done this yet) :
}
 
</nowiki>
 
  
==== nano -w /etc/e-smith/templates/etc/e-smith/sql/init/80zarafa ====
+
cd /to the installdirectory
  
<nowiki>
+
And unpack :
{
 
    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
 
}
 
</nowiki>
 
  
 +
tar -zxvf z-push-[latest version] -C /var/www/html
  
==== nano -w /etc/e-smith/templates.metadata/etc/e-smith/sql/init/80zarafa ====
+
==== Change the name of the created z-push-directory in /var/www/html to 'z-push'====
<nowiki>
 
PERMS=0750</nowiki>
 
  
==== mkdir -p /etc/e-smith/templates/etc/sysconfig/zarafa ====
+
==== INSTALLSCRIPT ====
==== nano -w /etc/e-smith/templates/etc/sysconfig/zarafa/zarafa ====
+
===== nano -w /etc/e-smith/events/actions/z-push-install =====
 
  <nowiki>
 
  <nowiki>
#
+
#!/bin/sh
# Locale setting for all Zarafa services
 
#
 
ZARAFA_LOCALE="{ ${'zarafa'}{language} || 'en_US.UTF-8' ; }"
 
  
 
#
 
#
# Locale setting for Zarafa userscripts
+
#--- /etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/29ZarafaAliases ---
 
#
 
#
ZARAFA_USERSCRIPT_LOCALE="{ ${'zarafa'}{language} || 'en_US.UTF-8' ; }"
+
echo
</nowiki>
+
echo "Creating /etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/29ZarafaAliases ..."
 
+
echo
==== nano -w /etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/29ZarafaAliases ====
+
cat <<HERE1 > /etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/29ZarafaAliases
<nowiki>
 
 
{
 
{
 
     # vim: ft=perl:
 
     # vim: ft=perl:
  
     $haveSSL = (exists ${modSSL}{status} and ${modSSL}{status} eq "enabled") ?  'yes' : 'no';
+
     \$haveSSL = (exists \${modSSL}{status} and \${modSSL}{status} eq "enabled") ?  'yes' : 'no';
     my $zwebmailStatus = $zarafa{'status'} || "disabled";
+
     my \$zwebmailStatus = \$zarafa{'status'} || "disabled";
     my $zwebmailAccessType = $zarafa{'access'} || "SSL";
+
     my \$zwebmailAccessType = \$zarafa{'access'} || "SSL";
  
     my $dirs;
+
     my \$dirs;
     $dirs{zarafa} = '/usr/share/zarafa-webaccess';
+
     \$dirs{zarafa} = '/usr/share/zarafa-webaccess';
     $dirs{webaccess} = '/usr/share/zarafa-webaccess';
+
     \$dirs{webaccess} = '/usr/share/zarafa-webaccess';
     $dirs{webmail} = '/usr/share/zarafa-webaccess';
+
     \$dirs{webmail} = '/usr/share/zarafa-webaccess';
     if ($imp{'status'} eq 'enabled') {$dirs{webmail} = ''};
+
     if (\$imp{'status'} eq 'enabled') {\$dirs{webmail} = ''};
     $dirs{webapp} = '/usr/share/zarafa-webapp';
+
     \$dirs{webapp} = '/usr/share/zarafa-webapp';
     $dirs{'Microsoft-Server-ActiveSync'} = '/var/www/html/z-push/index.php';
+
     \$dirs{'Microsoft-Server-ActiveSync'} = '/var/www/html/z-push/index.php';
  
 
     return "    # Zarafa is disabled in this VirtualHost\n"
 
     return "    # Zarafa is disabled in this VirtualHost\n"
                 unless $zwebmailStatus eq 'enabled';
+
                 unless \$zwebmailStatus eq 'enabled';
  
     foreach $place ('zarafa','webmail','webaccess','webapp','Microsoft-Server-ActiveSync')
+
     foreach \$place ('zarafa','webmail','webaccess','webapp','Microsoft-Server-ActiveSync')
 
     {
 
     {
         if (($port eq "80") && ($haveSSL eq 'yes') && ($zwebmailAccessType eq 'SSL'))
+
         if ((\$port eq "80") && (\$haveSSL eq 'yes') && (\$zwebmailAccessType eq 'SSL'))
 
         {
 
         {
             $OUT .= "    RewriteRule ^/$place(/.*|\$)    https://%{HTTP_HOST}/$place\$1 [L,R]\n";
+
             \$OUT .= "    RewriteRule ^/\$place(/.*|\\$)    https://%{HTTP_HOST}/\$place\\\$1 [L,R]\n";
 
         } else {
 
         } else {
             if (($dirs{$place}) ne '') {$OUT .= "    Alias /$place  $dirs{$place}\n"};
+
             if ((\$dirs{\$place}) ne '') {\$OUT .= "    Alias /\$place  \$dirs{\$place}\n"};
 
         }
 
         }
 
     }
 
     }
 
}
 
}
 +
HERE1
  
</nowiki>
+
#
 
+
#--- /etc/e-smith/templates/etc/httpd/conf/httpd.conf/86ZarafaAlias ---
==== nano -w /etc/e-smith/templates/etc/httpd/conf/httpd.conf/86ZarafaAlias ====
+
#
<nowiki>
+
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'};
+
     my \$zstatus = \$zarafa{'status'};
  
     if (defined $zstatus && $zstatus eq 'enabled')
+
     if (defined \$zstatus && \$zstatus eq 'enabled')
 
     {
 
     {
         $OUT .= qq(
+
         \$OUT .= qq(
 
#--------------------------------------------------------------------
 
#--------------------------------------------------------------------
 
# Zarafa specific configuration files.
 
# Zarafa specific configuration files.
Line 603: Line 1,684:
 
Alias /zarafa /usr/share/zarafa-webaccess/
 
Alias /zarafa /usr/share/zarafa-webaccess/
 
  <Directory /usr/share/zarafa-webaccess/>
 
  <Directory /usr/share/zarafa-webaccess/>
#  DirectoryIndex index.php
 
#  Options -Indexes +FollowSymLinks
 
#  AllowOverride Options
 
 
   Options -Indexes
 
   Options -Indexes
 
   AllowOverride All
 
   AllowOverride All
Line 633: Line 1,711:
 
     AddType application/x-httpd-php .php .php3
 
     AddType application/x-httpd-php .php .php3
 
     php_flag  magic_quotes_gpc  off
 
     php_flag  magic_quotes_gpc  off
</Directory>
+
</Directory>
  
 
<Directory /var/www/html/z-push/>
 
<Directory /var/www/html/z-push/>
Line 645: Line 1,723:
 
   php_flag magic_quotes_runtime off
 
   php_flag magic_quotes_runtime off
 
   php_flag short_open_tag on
 
   php_flag short_open_tag on
</Directory>
+
</Directory>
  
 
);
 
);
Line 651: Line 1,729:
 
     else
 
     else
 
     {
 
     {
       $OUT .= "# Zarafa Webmail is not configured as it is disabled in the config db";
+
       \$OUT .= "# Zarafa Webmail is not configured as it is disabled in the config db";
 
     }
 
     }
 
}
 
}
</nowiki>
+
HERE2
  
==== mkdir -p /etc/e-smith/templates/etc/zarafa/gateway.cfg ====
+
######################################
==== nano -w /etc/e-smith/templates/etc/zarafa/gateway.cfg/gateway.cfg ====
+
# Configuration of Z-push
 +
######################################
  
<nowiki>
+
/bin/echo
##############################################################
+
/bin/echo "Configuration of Z-push"
# GATEWAY SETTINGS
+
/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
  
server_bind = 0.0.0.0
+
/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
  
# Please refer to the administrator manual or manpage why HTTP is used rather than the UNIX socket.
+
/bin/echo
server_socket = http://localhost:{${'zarafa-server'}{TCPPort}||'236';}/zarafa
+
/bin/echo "Expanding http.conf-template"
 +
/bin/echo
 +
/sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf
  
# Set this value to a name to show in the logon greeting to clients.
+
/bin/echo
# Leave empty to use DNS to find this name.
+
/bin/echo "Restarting httpd"
server_hostname =
+
/bin/echo
 +
/usr/bin/sv restart /service/httpd-e-smith
  
# Whether to show the hostname in the logon greeting to clients.
+
</nowiki>
server_hostname_greeting = no
 
  
# drop privileges and run the process as this user
+
===== To save : =====
run_as_user =
+
CTRL + X
 +
yes
 +
<ENTER>
  
# drop privileges and run the process as this group
+
==== UPGRADESCRIPT ====
run_as_group =  
+
===== nano -w /etc/e-smith/events/actions/z-push-update =====
 +
<nowiki>
 +
#!/bin/sh
  
# create a pid file for stopping the service via the init.d scripts
+
######################################
pid_file = /var/run/zarafa-gateway.pid
+
# Configuration of Z-push
 +
######################################
  
# run server in this path (when not using the -F switch)
+
/bin/echo
running_path = /
+
/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
  
# enable/disable POP3, and POP3 listen port
+
/bin/echo
pop3_enable = { if (${'zarafa-pop3'}{status} eq 'enabled') {'yes'} else {'no'}; }
+
/bin/echo "Need to debug Z-push ?"
pop3_port = { ${'zarafa-pop3'}{TCPPort} || '8110'; }
+
/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
  
# enable/disable Secure POP3, and Secure POP3 listen port
+
/bin/echo
pop3s_enable = { if (${'zarafa-pop3s'}{status} eq 'enabled') {'yes'} else {'no'}; }
+
/bin/echo "Expanding http.conf-template"
pop3s_port = { ${'zarafa-pop3s'}{TCPPort} || '8995'; }
+
/bin/echo
 +
/sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf
  
# enable/disable IMAP, and IMAP listen port
+
/bin/echo
imap_enable = { if (${'zarafa-imap'}{status} eq 'enabled') {'yes'} else {'no'}; }
+
/bin/echo "Restarting httpd"
imap_port = { ${'zarafa-imap'}{TCPPort} || '8143'; }
+
/bin/echo
 
+
/usr/bin/sv restart /service/httpd-e-smith
 
 
# enable/disable Secure IMAP, and Secure IMAP listen port
 
imaps_enable = { if (${'zarafa-imaps'}{status} eq 'enabled') {'yes'} else {'no'}; }
 
imaps_port = { ${'zarafa-imaps'}{TCPPort} || '8993'; }
 
 
 
 
 
# Only mail folder for IMAP or all subfolders (calendar, contacts, tasks, etc. too)
 
imap_only_mailfolders = { ${'zarafa-imap'}{imap_only_mailfolders} || 'yes'; }
 
 
 
# Show Public folders for IMAP
 
imap_public_folders = { ${'zarafa-imap'}{imap_public_folders} || 'yes'; }
 
 
 
# IMAP clients may use IDLE command
 
imap_capability_idle = yes
 
 
 
# The maximum size of an email that can be uploaded to the gateway
 
imap_max_messagesize = { ${'zarafa-imap'}{imap_max_messagesize} || '134217728'; }
 
 
 
# Override the e-mail charset and generate using utf-8 (when imap data is not present on the item)
 
imap_generate_utf8 = { ${'zarafa-imap'}{imap_generate_utf8} || 'no'; }
 
 
 
# Internally issue the expunge command to directly delete e-mail marked for deletion in IMAP.
 
imap_expunge_on_delete = { ${'zarafa-imap'}{imap_expunge_on_delete} || 'no'; }
 
 
 
# Store full rfc822 message during APPEND
 
imap_store_rfc822 = { ${'zarafa-imap'}{imap_store_rfc822} || 'yes'; }
 
 
 
# File with RSA key for SSL
 
ssl_private_key_file = /home/e-smith/ssl.key/{$SystemName}.{$DomainName}.key
 
 
 
 
 
#File with certificate for SSL
 
ssl_certificate_file = /home/e-smith/ssl.crt/{$SystemName}.{$DomainName}.crt
 
 
 
 
 
# Verify client certificate
 
ssl_verify_client = { ${'zarafa-gateway'}{ssl_verify_client} || 'no'; }
 
 
 
# Client verify file and/or path
 
ssl_verify_file =
 
ssl_verify_path =
 
 
 
# Process model, using pthreads (thread) or processes (fork)
 
process_model = { ${'zarafa-gateway'}{process_model} || 'fork'; }
 
 
 
##############################################################
 
# GATEWAY LOG SETTINGS
 
 
 
# Logging method (syslog, file)
 
log_method = { ${'zarafa-gateway'}{log_method} || 'file'; }
 
 
 
# Loglevel (0=no logging, 5=full logging)
 
log_level = { ${'zarafa-gateway'}{log_level} || '2'; }
 
 
 
# Logfile for log_method = file, use '-' for stderr
 
log_file = /var/log/zarafa/gateway.log
 
 
 
# Log timestamp - prefix each log line with timestamp in 'file' logging mode
 
log_timestamp = { ${'zarafa-gateway'}{log_timestamp} || '1'; }
 
  
 
</nowiki>
 
</nowiki>
  
==== mkdir -p /etc/e-smith/templates/etc/zarafa/ical.cfg ====
+
===== To save : =====
==== nano -w /etc/e-smith/templates/etc/zarafa/ical.cfg/ical.cfg ====
+
CTRL + X
  <nowiki>
+
yes
##############################################################
+
  <ENTER>
# ICAL SETTINGS
 
  
# drop privileges and run the process as this user
+
==== See further : "Any version" ====
run_as_user =  
 
  
# drop privileges and run the process as this group
+
=== VERSION 2.0.x ===
run_as_group =
+
==== Download the Z-push-package (version 2.0 !!)====
 +
wget http://zarafa-deutschland.de/z-push-download/final/2.0/[z-push-latest version]
  
# create a pid file for stopping the service via the init.d scripts
+
Save in an installdirectory, ex. : root/InstallZPush
pid_file = /var/run/zarafa-ical.pid
 
  
# run server in this path (when not using the -F switch)
+
==== Unpack the package for Z-push :====
running_path = /
+
Go (cd /...) to the installdirectory (if you haven't done this yet) :
  
# IP Address to bind to (0.0.0.0 for ANY)
+
cd /to the installdirectory
server_bind = 0.0.0.0
 
  
# wether normal connections can be made to the ical server
+
And unpack :
ical_enable = { if (${'zarafa-ical'}{status} eq 'enabled') {'yes'} else {'no'}; }
 
 
 
# port which the ical server listens on for normal connections
 
ical_port = { ${'zarafa-ical'}{TCPPort} || '8088'; }
 
 
 
# wether ssl connections can be made to the ical server
 
icals_enable = { if (${'zarafa-icals'}{status} eq 'enabled') {'yes'} else {'no'}; }
 
 
 
# port which the ical server listens on for ssl connections
 
icals_port = { ${'zarafa-icals'}{TCPPort} || '8089'; }
 
 
 
# default connection to the Zarafa server
 
# Please refer to the administrator manual or manpage why HTTP is used rather than the UNIX socket.
 
server_socket = http://localhost:{${'zarafa-server'}{TCPPort}||'236';}/zarafa
 
 
 
# Process model, using pthreads (thread) or processes (fork)
 
process_model = { ${'zarafa-ical'}{process_model} || 'fork'; }
 
 
 
##############################################################
 
# ICAL LOG SETTINGS
 
  
# Logging method (syslog, file)
+
tar -zxvf z-push-[latest version] -C /usr/share
log_method = { ${'zarafa-ical'}{log_method} || 'file'; }
 
  
# Loglevel (0=no logging, 5=full logging)
+
==== Change the name of the created z-push-directory in /usr/share to 'z-push' ====
log_level = { ${'zarafa-ical'}{log_level} || '2'; }
 
 
 
# Logfile for log_method = file, use '-' for stderr
 
log_file = /var/log/zarafa/ical.log
 
 
 
# Log timestamp - prefix each log line with timestamp in 'file' logging mode
 
log_timestamp = { ${'zarafa-ical'}{log_timestamp} || '1'; }
 
 
 
##############################################################
 
# ICAL SSL SETTINGS FOR INCOMING CONNECTIONS
 
 
 
# File with RSA key for SSL
 
ssl_private_key_file = /home/e-smith/ssl.key/{$SystemName}.{$DomainName}.key
 
 
 
# File with certificate for SSL
 
ssl_certificate_file = /home/e-smith/ssl.crt/{$SystemName}.{$DomainName}.crt
 
 
 
# Verify client certificate
 
ssl_verify_client = { ${'zarafa-ical'}{ssl_verify_client} || 'no'; }
 
 
 
# Client verify file and/or path
 
ssl_verify_file =
 
ssl_verify_path =
 
 
 
##############################################################
 
# OTHER ICAL SETTINGS
 
 
 
# The timezone of the system clock
 
server_timezone = {$TimeZone}
 
 
 
# The charset of data to expect when the client doesn't specify any
 
default_charset = { ${'zarafa-ical'}{default_charset} || 'utf-8'; }
 
 
 
# Enable the iCalendar GET method for downloading calendars
 
enable_ical_get = { ${'zarafa-ical'}{enable_ical_get} || 'yes'; }
 
</nowiki>
 
 
 
==== mkdir -p /etc/e-smith/templates/etc/zarafa/server.cfg ====
 
==== nano -w /etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg ====
 
  
 +
==== INSTALLSCRIPT ====
 +
===== nano -w /etc/e-smith/events/actions/z-push-install =====
 
  <nowiki>
 
  <nowiki>
##############################################################
+
#!/bin/sh
# SERVER SETTINGS
 
 
 
# IP Address to bind to (0.0.0.0 for ANY)
 
# Set to 127.0.0.1 if connections should only come from localhost
 
# and through the webserver proxy
 
server_bind = 0.0.0.0
 
 
 
# Accept normal TCP connections (not recommended to disable)
 
server_tcp_enabled = { ${'zarafa-server'}{server_tcp_enabled} || 'yes'; }
 
 
 
# Port to bind to
 
server_tcp_port = { ${'zarafa-server'}{TCPPort} || '236'; }
 
 
 
# Accept unix pipe connections (not recommended to disable)
 
server_pipe_enabled = { ${'zarafa-server'}{server_pipe_enabled} || 'yes'; }
 
 
 
# Unix socket location
 
server_pipe_name = /var/run/zarafa
 
server_pipe_priority    = /var/run/zarafa-prio
 
 
 
# Name for identifying the server in a multi-server environment
 
server_name = { ${'zarafa-server'}{server_name} || 'Zarafa'; }
 
 
 
# Override the hostname of this server, used by Kerberos SSO if enabled
 
server_hostname =
 
 
 
# Database engine (mysql)
 
database_engine = { ${'zarafa-server'}{database_engine} || 'mysql'; }
 
 
 
# Allow connections from normal users through the unix socket
 
allow_local_users = { ${'zarafa-server'}{allow_local_users} || 'yes'; }
 
 
 
# local admin users who can connect to any store (use this for the zarafa-dagent)
 
# field is SPACE separated
 
# eg: local_admin_users = root vmail
 
local_admin_users = { ${'zarafa-server'}{local_admin_users} || 'root'; }
 
 
 
# e-mail address of the Zarafa System user
 
system_email_address = { ${'zarafa-server'}{system_email_address} || 'postmaster@localhost'; }
 
 
 
# drop privileges and run the process as this user
 
run_as_user =
 
 
 
# drop privileges and run the process as this group
 
run_as_group =
 
 
 
# create a pid file for stopping the service via the init.d scripts
 
pid_file = /var/run/zarafa-server.pid
 
 
 
# run server in this path (when not using the -F switch)
 
running_path = /
 
 
 
# session timeout for clients. Values lower than 300 will be upped to 300
 
# automatically. If the server hears nothing from a client in session_timeout
 
# seconds, then the session is killed.
 
session_timeout = { ${'zarafa-server'}{session_timeout} || '300'; }
 
 
 
# Socket to connect to license server
 
license_socket = /var/run/zarafa-licensed
 
 
 
# Time (in seconds) to wait for a connection to the license server before
 
# terminating the request.
 
license_timeout = { ${'zarafa-server'}{license_timeout} || '10'; }
 
 
 
##############################################################
 
# LOG SETTINGS
 
 
 
# Logging method (syslog, file), syslog facility is 'mail'
 
log_method = { ${'zarafa-server'}{log_method} || 'file'; }
 
 
 
# Logfile (for log_method = file, '-' for stderr)
 
log_file = /var/log/zarafa/server.log
 
 
 
# Loglevel (0=no logging, 5=full logging)
 
log_level = { ${'zarafa-server'}{log_level} || '2'; }
 
 
 
# Log timestamp - prefix each log line with timestamp in 'file' logging mode
 
log_timestamp = { ${'zarafa-server'}{log_timestamp} || '1'; }
 
 
 
##############################################################
 
# AUDIT LOG SETTINGS
 
 
 
# Audit logging is by default not enabled
 
audit_log_enabled = { ${'zarafa-server'}{audit_log_enabled} || 'no'; }
 
 
 
# Audit logging method (syslog, file), syslog facility is 'authpriv'
 
audit_log_method = { ${'zarafa-server'}{audit_log_method} || 'syslog'; }
 
 
 
# Audit logfile (for log_method = file, '-' for stderr)
 
audit_log_file = /var/log/zarafa/audit.log
 
 
 
# Audit loglevel (0=no logging, 1=full logging)
 
audit_log_level = { ${'zarafa-server'}{audit_log_level} || '1'; }
 
 
 
# Audit log timestamp - prefix each log line with timestamp in 'file' logging mode
 
audit_log_timestamp = { ${'zarafa-server'}{audit_log_timestamp} || '1'; }
 
 
 
##############################################################
 
# MYSQL SETTINGS (for database_engine = mysql)
 
 
 
# MySQL hostname to connect to for database access
 
mysql_host = { ${'zarafa-server'}{mysql_host} || 'localhost'; }
 
 
 
# MySQL port to connect with (usually 3306)
 
mysql_port = { ${'zarafa-server'}{mysql_port} || '3306'; }
 
 
 
# The user under which we connect with MySQL
 
mysql_user = { ${'zarafa-server'}{DbUser} || 'zarafa'; }
 
 
 
# The password for the user (leave empty for no password)
 
mysql_password = { ${'zarafa-server'}{DbPassword}; }
 
 
 
# Override the default MySQL socket to access mysql locally
 
# Works only if the mysql_host value is empty or 'localhost'
 
mysql_socket =
 
 
 
# Database to connect to
 
mysql_database = { ${'zarafa-server'}{DbName} || 'zarafa'; }
 
 
 
# Where to place attachments. Value can be 'database' or 'files'
 
attachment_storage = { ${'zarafa-server'}{attachment_storage} || 'files'; }
 
 
 
# When attachment_storage is 'files', use this path to store the files
 
attachment_path = /home/e-smith/files/zarafa
 
 
 
# Compression level for attachments when attachment_storage is 'files'.
 
# Set compression level for attachments disabled=0, max=9
 
attachment_compression = { ${'zarafa-server'}{attachment_compression} || '6'; }
 
 
 
##############################################################
 
#  SSL SETTINGS
 
 
 
# enable SSL support in server
 
server_ssl_enabled = { ${'zarafa-ssl'}{server_ssl_enabled} || 'yes'; }
 
 
 
# Listen for SSL connections on this port
 
server_ssl_port = { ${'zarafa-ssl'}{TCPPort} || '237'; }
 
 
 
# Required Server certificate, contains the certificate and the private key parts
 
server_ssl_key_file = /home/e-smith/ssl.pem/{$SystemName}.{$DomainName}.pem
 
 
 
# Password of Server certificate
 
server_ssl_key_pass = { ${'zarafa-server'}{DbPassword}; }
 
 
 
# Required Certificate Authority of server
 
server_ssl_ca_file = /home/e-smith/ssl.crt/{$SystemName}.{$DomainName}.crt
 
 
 
# Path with CA certificates, e.g. /etc/ssl/certs
 
server_ssl_ca_path = /home/e-smith/ssl.crt
 
 
 
# Path of SSL Public keys of clients
 
sslkeys_path = /home/e-smith/ssl.pem
 
 
 
##############################################################
 
# THREAD SETTINGS
 
 
 
# Number of server threads
 
# default: 8
 
threads = { ${'zarafa-server'}{threads} || '8'; }
 
 
 
# Watchdog frequency. The number of watchdog checks per second.
 
# default: 1
 
watchdog_frequency = { ${'zarafa-server'}{watchdog_frequency} || '1'; }
 
 
 
# Watchdog max age. The maximum age in ms of a task before a
 
# new thread is started.
 
# default: 500
 
watchdog_max_age = { ${'zarafa-server'}{watchdog_max_age} || '500'; }
 
 
 
# Maximum SOAP keep_alive value
 
# default: 100
 
server_max_keep_alive_requests = { ${'zarafa-server'}{server_max_keep_alive_requests} || '100'; }
 
 
 
# SOAP recv timeout value (time between requests)
 
# default: 5
 
server_recv_timeout = { ${'zarafa-server'}{server_recv_timeout} || '5'; }
 
 
 
# SOAP read timeout value (time during requests)
 
# default: 60
 
server_read_timeout = { ${'zarafa-server'}{server_read_timeout} || '60'; }
 
 
 
# SOAP send timeout value
 
# default: 60
 
server_send_timeout = { ${'zarafa-server'}{server_send_timeout} || '60'; }
 
 
 
##############################################################
 
#  OTHER SETTINGS
 
 
 
# Softdelete clean cycle (in days) 0=never running
 
softdelete_lifetime = { ${'zarafa-server'}{softdelete_lifetime} || '30'; }
 
 
 
# Sync lifetime, removes all changes remembered for a client after x days of inactivity
 
sync_lifetime = { ${'zarafa-server'}{sync_lifetime} || '365'; }
 
 
 
# Set to 'yes' if all changes (for synchronization) to messages should be logged to the database
 
sync_log_all_changes = { ${'zarafa-server'}{sync_log_all_changes} || 'no'; }
 
 
 
# Set to 'yes' if you have Kerberos or NTLM correctly configured for single sign-on
 
enable_sso = { ${'zarafa-server'}{enable_sso} || 'no'; }
 
 
 
# Set to 'yes' if you want to show the GAB to your users
 
enable_gab = { ${'zarafa-server'}{enable_gab} || 'yes'; }
 
 
 
# Authentication can be through plugin (default, recommended), pam or kerberos
 
auth_method = { ${'zarafa-server'}{auth_method} || 'plugin'; }
 
 
 
# If auth_method is set to pam, you should provide the pam service name
 
pam_service = { ${'zarafa-server'}{pam_service} || 'passwd'; }
 
 
 
 
 
#############################################################
 
# CACHE SETTINGS
 
#
 
# To see the live cache usage, use 'zarafa-stats --system',
 
# or send a USR1 signal to the server, and read the logfile.
 
 
 
# Size in bytes of the 'cell' cache (should be set as high as you can afford to set it)
 
cache_cell_size = { ${'zarafa-server'}{cache_cell_size} || '268435456'; }
 
 
 
# Size in bytes of the 'object' cache
 
cache_object_size = { ${'zarafa-server'}{cache_object_size} || '5242880'; }
 
 
 
# Size in bytes of the 'indexed object' cache
 
cache_indexedobject_size = { ${'zarafa-server'}{cache_indexedobject_size} || '16777216'; }
 
 
 
# Size in bytes of the userquota details
 
cache_quota_size = { ${'zarafa-server'}{cache_quota_size} || '1048576'; }
 
 
 
# Lifetime for userquota details
 
cache_quota_lifetime = { ${'zarafa-server'}{cache_quota_lifetime} || '1'; }
 
 
 
# Size in bytes of the acl cache
 
cache_acl_size = { ${'zarafa-server'}{cache_acl_size} || '1048576'; }
 
 
 
# Size in bytes of the store id/guid cache
 
cache_store_size = { ${'zarafa-server'}{cache_store_size} || '1048576'; }
 
 
 
# Size in bytes of the 'user id' cache (this is allocated twice)
 
cache_user_size = { ${'zarafa-server'}{cache_user_size} || '1048576'; }
 
 
 
# Size in bytes of the 'user details' cache
 
cache_userdetails_size = { ${'zarafa-server'}{cache_userdetails_size} || '26214400'; }
 
 
 
# Lifetime for user details
 
cache_userdetails_lifetime = { ${'zarafa-server'}{cache_userdetails_lifetime} || '5'; }
 
 
 
# Size in bytes of the server details (multiserver setups only)
 
cache_server_size = { ${'zarafa-server'}{cache_server_size} || '1048576'; }
 
 
 
# Lifetime for server details (multiserver setups only)
 
cache_server_lifetime = { ${'zarafa-server'}{cache_server_lifetime} || '30'; }
 
 
 
 
 
##############################################################
 
#  QUOTA SETTINGS
 
 
 
# The default Warning Quota Level. Set to 0 to disable this level.
 
# The user will receive an email when this level is reached. Value is in Mb. Default value is 0.
 
quota_warn = { ${'zarafa-server'}{quota_warn} || '0'; }
 
 
 
# The default Soft Quota Level. Set to 0 to disable this level.
 
# The user will still receive mail, but sending new mail is prohibited, until objects are removed from the store.
 
# VALUE is in Mb. Default value is 0.
 
quota_soft = { ${'zarafa-server'}{quota_soft} || '0'; }
 
 
 
# The default Hard Quota Level. Set to 0 to disable this level.
 
# The user can not receive and send mail, until objects are removed from the store.
 
# Value is in Mb. Default value is 0.
 
quota_hard = { ${'zarafa-server'}{quota_hard} || '0'; }
 
 
 
# The default Warning Quota Level for multitenant public stores. Set to 0 to disable this level.
 
# The tenant administrator will receive an email when this level is reached. Value is in Mb. Default value is 0.
 
companyquota_warn      = { ${'zarafa-server'}{companyquota_warn} || '0'; }
 
 
 
 
 
##############################################################
 
#  USER PLUGIN SETTINGS
 
 
 
# Name of the plugin that handles users
 
# Required, default = ldap
 
# Values: ldap, unix, db, ldapms (available in enterprise license)
 
user_plugin  = { ${'zarafa-server'}{Plugin} || 'db'; }
 
 
 
# configuration file of the user plugin, examples can be found in /usr/share/zarafa/example-config
 
{
 
  if (( ${'zarafa-server'}{Plugin} || 'db' ) eq 'unix')
 
  { 'user_plugin_config = /etc/zarafa/unix.cfg'; }
 
  elsif (( ${'zarafa-server'}{Plugin} || 'db' ) eq 'ldap')
 
  { 'user_plugin_config = /etc/zarafa/ldap.cfg'; }
 
}
 
 
 
# location of the zarafa plugins
 
# if you have a 64bit distribution, this probably should be changed to /usr/lib64/zarafa
 
plugin_path = /usr/lib/zarafa
 
 
 
# scripts which create stores for users from an external source
 
# used for ldap and unix plugins only
 
createuser_script = /etc/zarafa/userscripts/createuser
 
deleteuser_script = /etc/zarafa/userscripts/deleteuser
 
creategroup_script = /etc/zarafa/userscripts/creategroup
 
deletegroup_script = /etc/zarafa/userscripts/deletegroup
 
createcompany_script    = /etc/zarafa/userscripts/createcompany
 
deletecompany_script    = /etc/zarafa/userscripts/deletecompany
 
 
 
# Set this option to 'yes' to skip the creation and deletion of new users
 
# The action will be logged, so you can see if your changes to the plugin
 
# configuration are correct.
 
user_safe_mode = { ${'zarafa-server'}{user_safe_mode} || 'no'; }
 
 
 
##############################################################
 
# MISC SETTINGS
 
 
 
# Thread size in KB, default is 512
 
# WARNING: Do not set too small, your server WILL crash
 
thread_stacksize = { ${'zarafa-server'}{thread_stacksize} || '512'; }
 
 
 
# Enable multi-tenancy environment
 
# When set to true it is possible to create tenants within the
 
# zarafa instance and assign all users and groups to particular
 
# tenants.
 
# When set to false, the normal single-tenancy environment is created.
 
{
 
  if (( ${'zarafa-server'}{Multicompany} || 'no' ) eq 'yes')
 
  { 'enable_hosted_zarafa = true'; }
 
  elsif (( ${'zarafa-server'}{Multicompany} || 'no' ) eq 'no')
 
  { 'enable_hosted_zarafa = false'; }
 
}
 
 
 
# Enable multi-server environment
 
# When set to true it is possible to place users and tenants on
 
# specific servers.
 
# When set to false, the normal single-server environment is created.
 
enable_distributed_zarafa = { ${'zarafa-server'}{enable_distributed_zarafa} || 'false'; }
 
 
 
# Display format of store name
 
# Allowed variables:
 
#  %u Username
 
#  %f Fullname
 
#  %c Teantname
 
# default: %f
 
storename_format = { ${'zarafa-server'}{storename_format} || '%f'; }
 
  
# Loginname format (for Multi-tenancy installations)
 
# When the user does not login through a system-wide unique
 
# username (like the email address) a unique name is created
 
# by combining the username and the tenantname.
 
# With this configuration option you can set how the
 
# loginname should be built up.
 
#
 
# Note: Do not use the = character in the format.
 
 
#
 
#
# Allowed variables:
+
#--- /etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/29ZarafaAliases ---
#  %u Username
 
#  %c Teantname
 
 
#
 
#
# default: %u
+
echo
{
+
echo "Creating /etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/29ZarafaAliases ..."
  if (( ${'zarafa-server'}{Multicompany} || 'no' ) eq 'yes')
+
echo
  { 'loginname_format = %u.%c'; }
+
cat <<HERE1 > /etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/29ZarafaAliases
  elsif (( ${'zarafa-server'}{Multicompany} || 'no' ) eq 'no')
 
  { 'loginname_format = %u'; }
 
}
 
 
 
# Set to yes for Windows clients to be able to download the latest
 
# Zarafa Outlook client from the Zarafa server
 
client_update_enabled = { ${'zarafa-server'}{client_update_enabled} || 'false'; }
 
 
 
# Place the correct Zarafa Outlook Client in this directory for
 
# Windows clients to download through the Zarafa server
 
client_update_path = { ${'zarafa-server'}{client_update_path} || '/var/lib/zarafa/client'; }
 
 
 
# Recieve update information from the client (0 = disabled, 1 = only on error, 2 = log always)
 
client_update_log_level = { ${'zarafa-server'}{client_update_log_level} || '1'; }
 
 
 
# Log location for the client auto update files
 
client_update_log_path = /var/log/zarafa/autoupdate
 
 
 
# Everyone is a special internal group, which contains every user and group
 
# You may want to disable this group from the Global Addressbook by setting
 
# this option to 'yes'. Administrators will still be able to see the group.
 
hide_everyone = { ${'zarafa-server'}{hide_everyone} || 'yes'; }
 
 
 
# System is a special internal user, which has super-admin privileges
 
# You may want to disable this user from the Global Addressbook by setting
 
# this option to 'yes'. Administrators will still be able to see the user.
 
hide_system = { ${'zarafa-server'}{hide_system} || 'yes'; }
 
 
 
# Use Indexing service for faster searching.
 
# Enabling this option requires the zarafa-indexer service to
 
# be running.
 
index_services_enabled = { ${'zarafa-server'}{index_services_enabled} || 'no'; }
 
 
 
# Path to the zarafa-indexer service, this option is only required
 
# if the server is going to make use of the indexing service.
 
index_services_path = file:///var/run/zarafa-indexer
 
 
 
# Time (in seconds) to wait for a connection to the zarafa-indexer service
 
# before terminating the indexed search request.
 
index_services_search_timeout = { ${'zarafa-server'}{index_services_search_timeout} || '10'; }
 
 
 
# Minimum length of a search term in characters to enable prefix searching
 
index_services_prefix_chars = { ${'zarafa-server'}{index_services_prefix_chars} || '3'; }
 
 
 
# Allow enhanced ICS operations to speedup synchronization with cached profiles.
 
# default: yes
 
enable_enhanced_ics = { ${'zarafa-server'}{enable_enhanced_ics} || 'yes'; }
 
 
 
# Synchronize GAB users on every open of the GAB (otherwise, only on
 
# zarafa-admin --sync)
 
sync_gab_realtime = { ${'zarafa-server'}{sync_gab_realtime} || 'yes'; }
 
 
 
# Disable features for users. Default all features are disabled. This
 
# list is space separated. Currently valid values: imap
 
disabled_features = { ${'zarafa-server'}{disabled_features}; }
 
 
 
# Maximum number of deferred records in total
 
max_deferred_records = { ${'zarafa-server'}{max_deferred_records} || '0'; }
 
 
 
# Maximum number of deferred records per folder
 
max_deferred_records_folder = { ${'zarafa-server'}{max_deferred_records_folder} || '20'; }
 
</nowiki>
 
 
 
==== mkdir -p /etc/e-smith/templates/etc/zarafa/unix.cfg ====
 
==== nano -w  /etc/e-smith/templates/etc/zarafa/unix.cfg/unix.cfg ====
 
 
 
<nowiki>
 
 
{
 
{
use esmith::AccountsDB
+
    # vim: ft=perl:
}
 
##############################################################
 
#  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
+
    \$haveSSL = (exists \${modSSL}{status} and \${modSSL}{status} eq "enabled") ?  'yes' : 'no';
# is us-ascii, but this can differ according to your setup.
+
    my \$zwebmailStatus = \$zarafa{'status'} || "disabled";
# The charset specified here must be supported by your iconv(1)
+
    my \$zwebmailAccessType = \$zarafa{'access'} || "SSL";
# setup. See iconv -l for all charsets.
 
fullname_charset = iso-8859-15
 
  
# Default email domain for constructing new users
+
    my \$dirs;
# Required, no default
+
    \$dirs{zarafa} = '/usr/share/zarafa-webaccess';
default_domain = { ${'zarafa-server'}{DomainName} || $DomainName; }
+
    \$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';
  
# The lowest user id that is considered a regular user
+
    return "    # Zarafa is disabled in this VirtualHost\n"
# Optional, default = 1000
+
                unless \$zwebmailStatus eq 'enabled';
min_user_uid = 101
 
  
# The highest user id that is considered a regular user
+
    foreach \$place ('zarafa','webmail','webaccess','webapp','Microsoft-Server-ActiveSync')
# Optional, default = 10000
+
    {
max_user_uid = 10000
+
        if ((\$port eq "80") && (\$haveSSL eq 'yes') && (\$zwebmailAccessType eq 'SSL'))
 
+
        {
# A list of user ids that are not considered to be regular users
+
            \$OUT .= "    RewriteRule ^/\$place(/.*|\\$)   https://%{HTTP_HOST}/\$place\\\$1 [L,R]\n";
# Optional, default = empty
+
        } else {
# except_user_uids =
+
            if ((\$dirs{\$place}) ne '') {\$OUT .= "   Alias /\$place  \$dirs{\$place}\n"};
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");
 
}
 
}
 
 
}
 
}
 +
HERE1
  
# 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
 
</nowiki>
 
 
==== mkdir -p /etc/e-smith/templates/etc/zarafa/indexer.cfg ====
 
==== nano -w  /etc/e-smith/templates/etc/zarafa/indexer.cfg/indexer.cfg ====
 
 
<nowiki>
 
##############################################################
 
# INDEXER SERVICE SETTINGS
 
 
# Location of the index files
 
index_path          =  /var/lib/zarafa/index/
 
 
# run as specific user
 
run_as_user        =
 
 
# run as specific group
 
run_as_group        =
 
 
# control pid file
 
pid_file            =  /var/run/zarafa-indexer.pid
 
 
# run server in this path (when not using the -F switch)
 
running_path        =  /
 
 
# Force remove lockfiles on startup. Leaves possibly corrupt indexes on disk.
 
# See log for info of removed locks.
 
cleanup_lockfiles = { ${'zarafa-indexer'}{cleanup_lockfiles} || 'no'; }
 
 
# Limit the number of results returned (0 = don't limit)
 
limit_results = { ${'zarafa-indexer'}{limit_results} || '0'; }
 
 
##############################################################
 
# CONNECTION TO ZARAFA SERVER SETTINGS
 
 
#
 
#
 
+
#--- /etc/e-smith/templates/etc/httpd/conf/httpd.conf/86ZarafaAlias ---
# Socket to find the connection to the Zarafa server.
 
# Use https to reach servers over the network
 
server_socket  =  file:///var/run/zarafa
 
 
 
# Login to the Zarafa server using this SSL Key
 
sslkey_file        = /etc/zarafa/ssl/indexer.pem
 
 
 
# The password of the SSL Key
 
sslkey_pass        = replace-with-server-cert-password
 
 
 
##############################################################
 
# LISTEN SETTINGS
 
 
#
 
#
 +
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'};
  
# binding address
+
    if (defined \$zstatus && \$zstatus eq 'enabled')
# To setup for multi-server, use: http://0.0.0.0:port or https://0.0.0.0:port
+
    {
server_bind_name  =  file:///var/run/zarafa-indexer
+
        \$OUT .= qq(
 +
#--------------------------------------------------------------------
 +
# Zarafa specific configuration files.
 +
#--------------------------------------------------------------------
  
# File with RSA key for SSL, used then server_bind_name uses https
+
Alias /zarafa /usr/share/zarafa-webaccess/
ssl_private_key_file= /etc/zarafa/indexer/privkey.pem
+
<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>
  
# File with certificate for SSL, used then server_bind_name uses https
+
Alias /webapp /usr/share/zarafa-webapp/
ssl_certificate_file= /etc/zarafa/indexer/cert.pem
+
<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/>
# LOG SETTINGS
+
  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>
  
# Logging method (syslog, file)
+
);
log_method          =  { ${'zarafa-indexer'}{log_method} || 'file'; }
+
    }   
 +
    else
 +
    {
 +
      \$OUT .= "# Zarafa Webmail is not configured as it is disabled in the config db";
 +
    }
 +
}
 +
HERE2
  
# Loglevel (0=no logging, 5=full logging)
+
######################################
log_level          =  { ${'zarafa-indexer'}{log_level} || '2'; }
+
# Configuration of Z-push
 +
######################################
  
# Logfile for log_method = file, use '-' for stderr
+
/bin/echo
log_file            =   /var/log/zarafa/indexer.log
+
/bin/echo "Configuration of Z-push"
 +
/bin/echo
 +
FILE=/var/lib/z-push; if [ -d $FILE ]; then /bin/echo -e "** $FILE already exists, skipping **\n"; else /bin/mkdir $FILE; fi
 +
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/echo -e "** $FILE already exists, skipping **\n"; else /bin/mkdir $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
  
# Log timestamp - prefix each log line with timestamp in 'file' logging mode
+
/bin/echo
log_timestamp      =  { ${'zarafa-indexer'}{log_timestamp} || '1'; }
+
/bin/echo "Expanding http.conf-template"
 +
/bin/echo
 +
/sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf
  
##############################################################
+
/bin/echo
# ADVANCED INDEXER SETTINGS
+
/bin/echo "Restarting httpd"
 
+
/bin/echo
# Indexing interval (in minutes)
+
/usr/bin/sv restart /service/httpd-e-smith
index_interval      =  { ${'zarafa-indexer'}{index_interval} || '5'; }
 
 
 
# Max number of indexing threads
 
index_threads      =  { ${'zarafa-indexer'}{index_threads} || '1'; }
 
 
 
# Max length of indexed data
 
index_max_field_length  = { ${'zarafa-indexer'}{index_max_field_length} || '10000'; }
 
 
 
# Number of documents per segments before segments are merged
 
index_merge_factor      = { ${'zarafa-indexer'}{index_merge_factor} || '10'; }
 
 
 
# Max number of documents kept in memory before CLucene will write a new segment to disk
 
index_max_buffered_docs = { ${'zarafa-indexer'}{index_max_buffered_docs} || '10'; }
 
 
 
# Minumum amount of documents in memory before index is written to disk
 
index_min_merge_docs    = { ${'zarafa-indexer'}{index_min_merge_docs} || '10'; }
 
 
 
# Maximum number of documents in memory before index is written to disk
 
index_max_merge_docs    = { ${'zarafa-indexer'}{index_max_merge_docs} || '2147483647'; }
 
 
 
# The fraction of terms in the "dictionary" which should be stored in RAM.
 
index_term_interval = { ${'zarafa-indexer'}{index_term_interval} || '128'; }
 
 
 
# Timout for keeping Lucene cache open
 
index_cache_timeout = { ${'zarafa-indexer'}{index_cache_timeout} || '0'; }
 
 
 
##############################################################
 
# ATTACHMENT INDEX SETTINGS
 
 
 
# Should attachments be indexed
 
index_attachments = { ${'zarafa-indexer'}{index_attachments} || 'no'; }
 
 
 
# Maximum file size for attachments (in kb)
 
index_attachment_max_size = { ${'zarafa-indexer'}{index_attachment_max_size} || '5120'; }
 
 
 
# Scripts to attachment to text parser
 
index_attachment_parser = /etc/zarafa/indexerscripts/attachments_parser
 
  
# Maximum amount of memory which a parser may use in bytes (set to 0 for unlimited)
 
# If this maximum is exceeded the parser will be killed
 
index_attachment_parser_max_memory = { ${'zarafa-indexer'}{index_attachment_parser_max_memory} || '0'; }
 
 
# Maximim amount of CPU time (in seconds) which a parser may spend on parsing (set to 0 for unlimited)
 
# If this maximum is exceeded the parser will be killed
 
index_attachment_parser_max_cputime = { ${'zarafa-indexer'}{index_attachment_parser_max_cputime} || '0'; }
 
 
# Filter out parsing of attachment which has a mimetype from this list
 
# Only the first part of the mime needs to be given, like 'image'.
 
# This field is SPACE separated
 
index_attachment_mime_filter =
 
 
# Filter out parsing of attachment which has an extension from this list
 
# (only tested if mimetype was not found on the attachment)
 
# This field is SPACE separated
 
index_attachment_extension_filter =
 
 
##############################################################
 
# INDEX FILTERS
 
 
# Don't index users from the following list
 
# field is SPACE separated
 
index_block_users =
 
 
# Don't index users from the following companies
 
# field is SPACE separated
 
index_block_companies =
 
 
# Index users only from the following servers (see server.cfg#server_name)
 
# If left empty, all servers will be allowed.
 
# field is SPACE separated
 
index_allow_servers =
 
 
</nowiki>
 
</nowiki>
  
==== mkdir -p /etc/e-smith/templates/etc/zarafa/monitor.cfg ====
+
===== To save : =====
==== nano -w /etc/e-smith/templates/etc/zarafa/monitor.cfg/monitor.cfg ====
+
CTRL + X
 +
yes
 +
  <ENTER>
  
 +
==== UPGRADESCRIPT ====
 +
===== nano -w /etc/e-smith/events/actions/z-push-update =====
 
  <nowiki>
 
  <nowiki>
##############################################################
+
#!/bin/sh
# ZARAFA MONITOR SETTINGS
 
  
# Server unix socket location
+
######################################
server_socket = file:///var/run/zarafa
+
# Configuration of Z-push
 +
######################################
  
# drop privileges and run the process as this user
+
/bin/echo
run_as_user =  
+
/bin/echo "Configuration of Z-push"
 +
/bin/echo
 +
FILE=/var/lib/z-push; if [ -d $FILE ]; then /bin/echo -e "** $FILE already exists, skipping **\n"; else /bin/mkdir $FILE; fi
 +
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/echo -e "** $FILE already exists, skipping **\n"; else /bin/mkdir $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
  
# drop privileges and run the process as this group
+
/bin/echo
run_as_group =
+
/bin/echo "Expanding http.conf-template"
 +
/bin/echo
 +
/sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf
  
# create a pid file for stopping the service via the init.d scripts
+
/bin/echo
pid_file = /var/run/zarafa-monitor.pid
+
/bin/echo "Restarting httpd"
 
+
/bin/echo
# run server in this path (when not using the -F switch)
+
/usr/bin/sv restart /service/httpd-e-smith
running_path = /
 
 
 
##############################################################
 
# ZARAFA MONITOR LOG SETTINGS
 
 
 
# Logging method (syslog, file)
 
log_method = { ${'zarafa-monitor'}{log_method} || 'file'; }
 
 
 
# Loglevel (0=no logging, 5=full logging)
 
log_level = { ${'zarafa-monitor'}{log_level} || '2'; }
 
 
 
# Logfile for log_method = file
 
log_file = /var/log/zarafa/monitor.log
 
 
 
# Log timestamp - prefix each log line with timestamp in 'file' logging mode
 
log_timestamp = { ${'zarafa-monitor'}{log_timestamp} || '1'; }
 
 
 
##############################################################
 
# MONITOR SSL LOGIN SETTINGS
 
#
 
# Note: server_socket must be set to https://servername:portname/zarafa
 
#      to use this type of login method
 
 
 
# Login to the Zarafa server using this SSL Key
 
sslkey_file = /etc/zarafa/ssl/monitor.pem
 
 
 
# The password of the SSL Key
 
sslkey_pass = replace-with-monitor-cert-password
 
 
 
##############################################################
 
# ZARAFA MONITOR INTERVAL SETTINGS
 
 
 
# Quota check interval (in minutes)
 
quota_check_interval = { ${'zarafa-monitor'}{quota_check_interval} || '15'; }
 
 
 
##############################################################
 
# ZARAFA MONITOR MAIL QUOTA SETTINGS
 
 
 
# Quota mail interval in days
 
mailquota_resend_interval = { ${'zarafa-monitor'}{mailquota_resend_interval} || '1'; }
 
  
# Templates to be used for quota emails which are send to the user
 
# when the various user quota levels have been exceeded.
 
userquota_warning_template  =  /etc/zarafa/quotamail/userwarning.mail
 
userquota_soft_template    =  /etc/zarafa/quotamail/usersoft.mail
 
userquota_hard_template    =  /etc/zarafa/quotamail/userhard.mail
 
 
# Templates to be used for quota emails which are send to the company administrators
 
# when the various company quota levels have been exceeded.
 
companyquota_warning_template  =  /etc/zarafa/quotamail/companywarning.mail
 
companyquota_soft_template      =  /etc/zarafa/quotamail/companysoft.mail
 
companyquota_hard_template      =  /etc/zarafa/quotamail/companyhard.mail
 
 
</nowiki>
 
</nowiki>
  
==== mkdir -p /etc/e-smith/templates/etc/zarafa/licensed.cfg ====
+
===== To save : =====
==== nano -w /etc/e-smith/templates/etc/zarafa/licensed.cfg/licensed.cfg ====
+
CTRL + X
 +
yes
 +
<ENTER>
  
<nowiki>
+
==== See further : "Any version" ====
##############################################################
 
# SERVER SETTINGS
 
  
# The socket that the license server will run on
+
=== ANY VERSION (1.5.x or 2.0.x)===
# default: /var/run/zarafa-licensed
+
==== Edit the config.php file in the Z-Push directory to fit your needs. ====
server_pipe_name = /var/run/zarafa-licensed
+
ex. Set your timezone in the config.php file.
  
# The URL on which we can contact zarafa-server
+
==== Execute z-push-install (see script above !!!!) ====
# default: file:///var/run/zarafa
 
server_socket = file:///var/run/zarafa-prio
 
  
# Login to the Zarafa server using this SSL Key
+
/bin/chmod 554 /etc/e-smith/events/actions/z-push-install
sslkey_file        = /etc/zarafa/ssl/licensed.pem
 
  
# The password of the SSL Key
+
cd /etc/e-smith/events/actions/
sslkey_pass        = replace-with-server-cert-password
 
  
# License path (should contain 'base' and CALs in other files)
+
./z-push-install
license_path = /etc/zarafa/license
 
  
# drop privileges and run the process as this user
+
== UPGRADING of Z-push ==
run_as_user =  
+
=== VERSION 1.5 (1.5.x -> 1.5.x)===
 +
==== Download the Z-push-package (version 1.5 !!)====
  
# drop privileges and run the process as this group
+
wget http://zarafa-deutschland.de/z-push-download/final/1.5/[z-push-latest version]
run_as_group =
 
  
# create a pid file for stopping the service via the init.d scripts
+
Save in an installdirectory, ex. : root/InstallZPush
pid_file = /var/run/zarafa-licensed.pid
 
  
# run server in this path (when not using the -F switch)
+
==== Unpack the corresponding package for ZCP and the package for Z-push :====
running_path = /
 
  
##############################################################
+
Go (cd /...) to the installdirectory (if you haven't done this yet) :
# LOG SETTINGS
 
  
# Logging method (syslog, file)
+
cd /to the installdirectory
log_method = { ${'zarafa-licensed'}{log_method} || 'file'; }
 
  
# Logfile (for log_method = file, '-' for stderr)
+
And unpack :
log_file = /var/log/zarafa/licensed.log
 
  
# Loglevel (0=no logging, 5=full logging)
+
tar -zxvf z-push-[latest version] -C /var/www/html
log_level = { ${'zarafa-licensed'}{log_level} || '2'; }
 
  
# Log timestamp - prefix each log line with timestamp in 'file' logging mode
+
==== Change the name of the created z-push-directory in /var/www/html to 'z-push'====
log_timestamp = { ${'zarafa-licensed'}{log_timestamp} || '1'; }
+
==== See further : "Any version" ====
</nowiki>
+
=== VERSION 2.0 (2.0.x -> 2.0.x)===
 +
==== Download the Z-push-package (version 2.0 !!)====
  
==== mkdir -p /etc/e-smith/templates/etc/zarafa/spooler.cfg ====
+
wget http://zarafa-deutschland.de/z-push-download/final/2.0/[z-push-latest version]
==== nano -w /etc/e-smith/templates/etc/zarafa/spooler.cfg/spooler.cfg ====
 
  
<nowiki>
+
Save in an installdirectory, ex. : root/InstallZPush
##############################################################
 
# SPOOLER SETTINGS
 
  
# Outgoing mailserver name or IP address
 
smtp_server = localhost
 
  
# Port number for outgoing mailserver
+
==== Unpack the package for Z-push :====
smtp_port = { ${'zarafa-spooler'}{smtp_port} || '25'; }
 
  
# Server unix socket location
+
Go (cd /...) to the installdirectory (if you haven't done this yet) :  
server_socket = file:///var/run/zarafa
 
  
# drop privileges and run the process as this user
+
cd /to the installdirectory
run_as_user =
 
  
# drop privileges and run the process as this group
+
And unpack :
run_as_group =
 
  
# create a pid file for stopping the service via the init.d scripts
+
tar -zxvf z-push-[latest version] -C /usr/share
pid_file = /var/run/zarafa-spooler.pid
 
  
# run server in this path (when not using the -F switch)
+
==== Change the name of the created z-push-directory in /usr/share to 'z-push'====
running_path = /
+
==== See further : "Any version" ====
 +
=== VERSION 1.5.x -> 2.0.x ===
  
##############################################################
+
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
# SPOOLER LOG SETTINGS
 
  
# Logging method (syslog, file)
+
=== ANY VERSION ===
log_method = { ${'zarafa-spooler'}{log_method} || 'file'; }
+
==== Edit the config.php file in the Z-Push directory to fit your needs. ====
 +
ex. Set your timezone in the config.php file.
  
# Loglevel (0=no logging, 5=full logging)
+
==== Execute z-push-update (see script above !!!!) ====
log_level = { ${'zarafa-spooler'}{log_level} || '3'; }
 
  
# Logfile for log_method = file
+
/bin/chmod 554 /etc/e-smith/events/actions/z-push-update
log_file = /var/log/zarafa/spooler.log
 
  
# Log timestamp - prefix each log line with timestamp in 'file' logging mode
+
cd /etc/e-smith/events/actions/
log_timestamp = { ${'zarafa-spooler'}{log_timestamp} || '1'; }
 
  
 +
./z-push-update
  
##############################################################
+
== Managing Zarafa-users/companies : ==
# SPOOLER SSL LOGIN SETTINGS
+
=== With Unix-plugin ===
#
 
# Note: server_socket must be set to https://servername:portname/zarafa
 
#      to use this type of login method
 
 
 
# Login to the Zarafa server using this SSL Key
 
sslkey_file = /etc/zarafa/ssl/spooler.pem
 
 
 
# The password of the SSL Key
 
sslkey_pass = replace-with-server-cert-password
 
 
 
##############################################################
 
# SPOOLER THREAD SETTINGS
 
 
 
# Maximum number of threads used to send outgoing messages
 
# Default: 5
 
max_threads = { ${'zarafa-spooler'}{max_threads} || '5'; }
 
 
 
##############################################################
 
# SPOOLER FAXING SETTINGS
 
 
 
# When sending an email that must go to a fax address, the address
 
# will be rewritten to <phonenumber>@<fax_domain>
 
fax_domain = { ${'zarafa-spooler'}{fax_domain} || 'fax.local'; }
 
 
 
# If the received number starts with a '+', it will be replaced by
 
# the fax_international value.
 
# eg. +3112345678@fax.local will be rewritten to 003112345678@fax.local
 
fax_international = { ${'zarafa-spooler'}{fax_international} || '00'; }
 
 
 
##############################################################
 
# SPOOLER DELEGATE SETTINGS
 
 
 
# Set this value to 'yes' to let the spooler always send emails with
 
# delegates (other user than yourself in the From: header)
 
# In installations before 6.20, this value was always 'yes'.
 
# IMPORTANT: This feature overrides "send-as" functionality.
 
always_send_delegates = { ${'zarafa-spooler'}{always_send_delegates} || 'no'; }
 
 
 
# Set this value to 'no' if you do NOT want to allow redirected e-mails
 
# being sent with their original 'FROM' header
 
allow_redirect_spoofing = { ${'zarafa-spooler'}{allow_redirect_spoofing} || 'yes'; }
 
 
 
# Copies the sent mail of delegates and send-as mails in the
 
# "Sent Items" folder of the representer.
 
copy_delegate_mails = { ${'zarafa-spooler'}{copy_delegate_mails} || 'yes'; }
 
 
 
# Allow to forward and sent a meeting request as delegate Zarafa and
 
# SMTP user.
 
allow_delegate_meeting_request = { ${'zarafa-spooler'}{allow_delegate_meeting_request} || 'yes'; }
 
 
 
# Allow users to send email to the 'everyone' group
 
allow_send_to_everyone = { ${'zarafa-spooler'}{allow_send_to_everyone} || 'yes'; }
 
 
 
##############################################################
 
# SPOOLER OUTPUT SETTINGS
 
 
 
# Set this value to 'yes' to always send meeting request information
 
# using TNEF method (winmail.dat attachments)
 
# Otherwise, the meeting request information is sent using
 
# iCalendar (calendar.ics attachment).
 
always_send_tnef = { ${'zarafa-spooler'}{always_send_tnef} || 'no'; }
 
 
 
# Send all e-mail always using the UTF-8 charset.
 
# Normally, the requested charset is used, which can be any charset.
 
always_send_utf8 = { ${'zarafa-spooler'}{always_send_utf8} || 'no'; }
 
 
 
# The us-ascii charset will be upgraded to this charset, to allow more
 
# use of high-characters. Not used when always_send_utf8 is enabled.
 
charset_upgrade = { ${'zarafa-spooler'}{charset_upgrade} || 'windows-1252'; }
 
 
 
##############################################################
 
# SPOOLER GROUP EXPANSION
 
 
 
# Set this value to 'yes' if groups should be expanded to their
 
# members; This means that the receiving party will see the names
 
# of the group members in the To: header for example. If set to
 
# 'no', the name of the group will appear in the headers.
 
#
 
# Note: groups with email addresses are never expanded
 
expand_groups = { ${'zarafa-spooler'}{expand_groups} || 'no'; }
 
 
 
##############################################################
 
# SPOOLER ARCHIVING SETTINGS
 
 
 
# Enable archive_on_send to automatically archive all outgoing
 
# messages.
 
# This will do nothing if no archive is attached to the source mailbox.
 
archive_on_send = { ${'zarafa-spooler'}{archive_on_send} || 'no'; }
 
</nowiki>
 
 
 
==== mkdir -p /etc/e-smith/templates/etc/zarafa/dagent.cfg ====
 
==== nano -w  /etc/e-smith/templates/etc/zarafa/dagent.cfg/dagent.cfg ====
 
 
 
<nowiki>
 
##############################################################
 
# DAGENT SETTINGS
 
 
 
# connection to the zarafa server
 
server_socket = file:///var/run/zarafa
 
 
 
##############################################################
 
# DAGENT SSL LOGIN SETTINGS
 
#
 
# Note: server_socket must be set to https://servername:portname/zarafa
 
#      to use this type of login method
 
 
 
# Login to the Zarafa server using this SSL Key
 
sslkey_file = /etc/zarafa/ssl/dagent.pem
 
 
 
# The password of the SSL Key
 
sslkey_pass = replace-with-dagent-cert-password
 
 
 
##############################################################
 
# DAGENT LOG SETTINGS
 
 
 
# Logging method (syslog, file)
 
log_method = { ${'zarafa-dagent'}{log_method} || 'file'; }
 
 
 
# Loglevel (0=no logging, 5=full logging)
 
log_level = { ${'zarafa-dagent'}{log_level} || '2'; }
 
 
 
# Logfile for log_method = file, use '-' for stderr
 
log_file = /var/log/zarafa/dagent.log
 
 
 
# Log timestamp - prefix each log line with timestamp in 'file' logging mode
 
log_timestamp = { ${'zarafa-dagent'}{log_timestamp} || '1'; }
 
 
 
# Log raw message to a file
 
log_raw_message = { ${'zarafa-dagent'}{log_raw_message} || 'no'; }
 
 
 
# Log raw messages path
 
log_raw_message_path = /tmp
 
 
 
##############################################################
 
# DAGENT LMTP SETTINGS
 
#  start dagent with -d to create an lmtp daemon of the zarafa-dagent
 
 
 
# binding address for LMTP daemon
 
# change to 0.0.0.0 if you require connections over the network
 
server_bind = 127.0.0.1
 
 
 
# LMTP port to listen on for LMTP connections
 
lmtp_port = { ${'zarafa-dagent'}{lmtp_port} || '2003'; }
 
 
 
# Maximum LMTP threads that ca be running simultaneously
 
# This is also limited by your SMTP server. (20 is the postfix default concurrency limit)
 
lmtp_max_threads = { ${'zarafa-dagent'}{lmtp_max_threads} || '20'; }
 
 
 
# Process model for LMTP daemon, using pthreads (thread) or processes (fork)
 
process_model = { ${'zarafa-dagent'}{process_model} || 'fork'; }
 
 
 
# run as specific user in LMTP mode.
 
#  make sure this user is listed in local_admin_users in your zarafa server config
 
#  or use SSL connections with certificates to login
 
run_as_user =
 
 
 
# run as specific group in LMTP mode.
 
run_as_group =
 
 
 
# control pid file
 
pid_file = /var/run/zarafa-dagent.pid
 
 
 
# The following e-mail header will mark the mail as spam, so the mail
 
# is placed in the Junk Mail folder, and not the Inbox.
 
# The name is case insensitive.
 
# set to empty to not use this detection scheme.
 
spam_header_name = { ${'zarafa-dagent'}{spam_header_name} || 'X-Spam-Status'; }
 
 
 
# If the above header is found, and contains the following value
 
# the mail will be considered as spam.
 
# Notes:
 
#  - The value is case insensitive.
 
#  - Leading and trailing spaces are stripped.
 
#  - The word 'bayes' also contains the word 'yes'.
 
spam_header_value = { ${'zarafa-dagent'}{spam_header_value} || 'Yes'; }
 
 
 
##############################################################
 
# DAGENT ARCHIVING SETTINGS
 
 
 
# Enable archive_on_delivery to automatically archive all incoming
 
# messages on delivery.
 
# This will do nothing if no archive is attached to the target mailbox.
 
archive_on_delivery = { ${'zarafa-dagent'}{archive_on_delivery} || 'no'; }
 
 
 
##############################################################
 
# DAGENT RULE SETTINGS
 
# Enable the addition of X-Zarafa-Rule-Action headers on messages
 
# that have been forwarded or replied by a rule.
 
# Default: yes
 
set_rule_headers = yes
 
</nowiki>
 
 
 
==== nano -w /etc/e-smith/templates-user/.qmail/80Zarafa ====
 
 
 
<nowiki>
 
{
 
  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;"
 
  }
 
}
 
</nowiki>
 
 
 
==== nano -w /etc/e-smith/templates-user/.qmail-junkmail/01Zarafa ====
 
 
 
<nowiki>
 
{
 
    # 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';
 
    return "| /usr/bin/zarafa-dagent -qj $USERNAME ; if [ \$\? -ne 0 ] ; then exit -1; else exit 99; fi;"
 
          if ($zarafa eq 'enabled');
 
}
 
</nowiki>
 
 
 
=== ONLY FOR FIRST INSTALLATION  : Execute zarafa-install : ===
 
/bin/chmod 554 /etc/e-smith/events/actions/zarafa-install
 
 
 
/etc/e-smith/events/actions/zarafa-install
 
 
 
signal-event post-upgrade; signal-event reboot
 
 
 
=== UPGRADING  : Execute zarafa-update : ===
 
 
 
Search in the Zarafa-releasenotes for new keys in the config-files and change the config-templates with these new keys
 
 
 
http://doc.zarafa.com/7.0/Release_Notes/en-US/html-single/
 
 
 
/etc/e-smith/events/actions/zarafa-update
 
 
 
signal-event post-upgrade; signal-event reboot
 
 
 
 
 
=== Managing Zarafa-users/companies : ===
 
==== With Unix-plugin ====
 
 
Zarafa-users are created with the creation of a SME-user, but you have to enable delivery to zarafa for these SME-users.  
 
Zarafa-users are created with the creation of a SME-user, but you have to enable delivery to zarafa for these SME-users.  
===== Enable maildelivery to zarafa for a user : =====
+
==== Enable maildelivery to zarafa for a user : ====
 
  db accounts setprop [USERNAME] zarafa enabled
 
  db accounts setprop [USERNAME] zarafa enabled
 
  /etc/e-smith/events/actions/qmail-update-user
 
  /etc/e-smith/events/actions/qmail-update-user
===== Disable maildelivery to zarafa for a user : =====
+
==== Disable maildelivery to zarafa for a user : ====
 
  db accounts setprop [USERNAME] zarafa disabled
 
  db accounts setprop [USERNAME] zarafa disabled
 
  /etc/e-smith/events/actions/qmail-update-user
 
  /etc/e-smith/events/actions/qmail-update-user
  
===== Enable mail delivery to zarafa for ALL users (NOT RECOMMANDED - cf. junkmail-template not adjusted for GlobalForward) : =====
+
==== Enable mail delivery to zarafa for ALL users : ====
 
  config setprop zarafa-server GlobalForward enabled
 
  config setprop zarafa-server GlobalForward enabled
 
  /etc/e-smith/events/actions/qmail-update-user
 
  /etc/e-smith/events/actions/qmail-update-user
===== Other options for managing users =====
+
 
 +
==== Other options for managing users ====
 
  zarafa-admin --help
 
  zarafa-admin --help
  
==== With DB-plugin ====
+
=== With DB-plugin ===
===== Create company =====
+
==== Create company (in a Multi-company-environment) ====
 
  /etc/e-smith/events/actions/zarafa-create-company
 
  /etc/e-smith/events/actions/zarafa-create-company
===== Create user =====
+
 
 +
==== Create user ====
 
  /etc/e-smith/events/actions/zarafa-create-user
 
  /etc/e-smith/events/actions/zarafa-create-user
===== Disable maildelivery to zarafa for a user : =====
+
==== Disable maildelivery to zarafa for a user : ====
 
  db accounts setprop [USERNAME] zarafa disabled
 
  db accounts setprop [USERNAME] zarafa disabled
 
  /etc/e-smith/events/actions/qmail-update-user
 
  /etc/e-smith/events/actions/qmail-update-user
===== Other options for managing users/companies =====
+
==== Other options for managing users/companies ====
 
  zarafa-admin --help
 
  zarafa-admin --help
  
=== Usefull commands : ===
+
== Usefull commands : ==
  
==== Change db-entries (Change default-values in zarafa-config-files) ====
+
=== Change db-entries (Change default-values in zarafa-config-files) ===
 
  config setprop [zarafa-service] [key] [value]
 
  config setprop [zarafa-service] [key] [value]
 
  /etc/e-smith/events/actions/zarafa-expand-templates
 
  /etc/e-smith/events/actions/zarafa-expand-templates
 
  /etc/e-smith/events/actions/zarafa-services restart
 
  /etc/e-smith/events/actions/zarafa-services restart
  
===== Change loglevel to 5 (= max. (default = 2))=====
+
==== Change loglevel to 5 (= max. (default = 2))====
 
  config setprop zarafa-server log_level 5
 
  config setprop zarafa-server log_level 5
 
  config setprop zarafa-dagent log_level 5
 
  config setprop zarafa-dagent log_level 5
Line 1,956: Line 2,125:
 
  /etc/e-smith/events/actions/zarafa-services restart
 
  /etc/e-smith/events/actions/zarafa-services restart
  
===== Change index-interval to 60 minutes (= max. (default = 5))=====
+
==== Change index-interval to 60 minutes (= max. (default = 5))====
 
  config setprop zarafa-indexer index_interval 60
 
  config setprop zarafa-indexer index_interval 60
 
  /etc/e-smith/events/actions/zarafa-expand-templates
 
  /etc/e-smith/events/actions/zarafa-expand-templates
 
  /etc/e-smith/events/actions/zarafa-services restart
 
  /etc/e-smith/events/actions/zarafa-services restart
  
===== Setting system-email-address =====
+
==== Setting system-email-address ====
 
  config setprop zarafa-server system_email_address [admin@mydomain.com]  
 
  config setprop zarafa-server system_email_address [admin@mydomain.com]  
 
  /etc/e-smith/events/actions/zarafa-expand-templates
 
  /etc/e-smith/events/actions/zarafa-expand-templates
 
  /etc/e-smith/events/actions/zarafa-services restart
 
  /etc/e-smith/events/actions/zarafa-services restart
  
==== View userdetails ====
+
=== Debugging Z-push 1.5.x (not for 2.0.x) ===
 +
==== Disable (debugging is enabled by default in this howto) ====
 +
rm -f /var/www/html/z-push/debug.txt
 +
==== Enable after disabling (debugging is enabled by default in this howto) ====
 +
/bin/touch /var/www/html/z-push/debug.txt
 +
/bin/chown www:www /var/www/html/z-push/debug.txt
 +
/bin/chmod 755 /var/www/html/z-push/debug.txt
 +
 
 +
=== View userdetails ===
 
  zarafa-admin --details [user]
 
  zarafa-admin --details [user]
  
==== Setting send-emailadres for a user ====
+
=== Setting/Changing send-emailadres for a user ===
 
  zarafa-admin -u [user] -e [send-emailadres]
 
  zarafa-admin -u [user] -e [send-emailadres]
  
==== Quota-settings ====
+
=== Setting/Changing fullname for a user ===
 +
zarafa-admin -u [user] -f "[full name]"
 +
 
 +
=== Quota-settings ===
 
  zarafa-admin -u [user] --qo y --qw 1600 --qs 1800 --qh 2000
 
  zarafa-admin -u [user] --qo y --qw 1600 --qs 1800 --qh 2000
  
==== Give a user administrator-privileges ====
+
=== Give a user administrator-privileges ===
 
  zarafa-admin -u [user] -a y
 
  zarafa-admin -u [user] -a y
  
=== Usefull plugins : ===
+
== Usefull plugins : ==
==== Password-plugin for webaccess (ONLY FOR DB-PLUGIN) ====
+
=== Password-plugin for webaccess (ONLY FOR DB-PLUGIN) ===
 
[https://community.zarafa.com/pg/plugins/project/157/developer/dw2412/passwd-plugin Dev-page]
 
[https://community.zarafa.com/pg/plugins/project/157/developer/dw2412/passwd-plugin Dev-page]
  
Line 1,990: Line 2,170:
 
  $passwd_cmd = "/usr/bin/zarafa-passwd -u '%s' -o '%s' -p '%s'";
 
  $passwd_cmd = "/usr/bin/zarafa-passwd -u '%s' -o '%s' -p '%s'";
  
=== Webmail : ===
+
=== Password-change by users from outsite your network for webaccess/webapp (IF USING THE UNIX PLUGIN) ===
 +
==== Install Usermanager ====
 +
[[UserManager]] : Install smeserver-userpanel and smeserver-userpanels
 +
 
 +
==== nano /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/VirtualHosts/28UserManagerProxyPass ====
 +
<nowiki>
 +
{
 +
    # vim: ft=perl:
 +
    $haveSSL = (exists ${modSSL}{status} and ${modSSL}{status} eq "enabled") ?  'yes' : 'no';
 +
    $plainTextAccess = ${'httpd-admin'}{PermitPlainTextAccess} || 'no';
 +
    $OUT = '';
 +
    foreach $place ('user-manager','server-common','user')
 +
    {
 +
        if (($port eq "80") && ($haveSSL eq 'yes') && ($plainTextAccess ne 'yes'))
 +
        {
 +
            $OUT .= "    RewriteRule ^/$place(/.*|\$)    https://%{HTTP_HOST}/$place\$1 [L,R,NC]\n";
 +
        } else {
 +
            $OUT .= "    ProxyPass /$place http://127.0.0.1:${'httpd-admin'}{TCPPort}/$place\n";
 +
            $OUT .= "    ProxyPassReverse /$place http://127.0.0.1:${'httpd-admin'}{TCPPort}/$place\n";
 +
        }
 +
        $OUT .= "    <Location /$place>\n";
 +
        $OUT .= "        order deny,allow\n";
 +
        $OUT .= "        deny from all\n";
 +
        $OUT .= "        allow from all\n";   
 +
        $OUT .= "    </Location>\n";
 +
    }
 +
}
 +
</nowiki>
 +
 
 +
==== To save : ====
 +
CTRL + X
 +
yes
 +
<ENTER>
 +
 
 +
==== Via the Server-Manager : Delegate the userpanel-password to external users ====
 +
Now these external users can change from outsite your network there sme-password : https://www.yourdomain.tld/user
 +
 
 +
=== WebApp - OwnCloud attachment plug-in ===
 +
 
 +
[https://community.zarafa.com/pg/plugins/project/16024/developer/h44z/webapp-owncloud-attachment-plugin OwnCloud attachment plug-in]
 +
 
 +
=== WebApp - Dropbox attachment plug-in===
 +
 
 +
[https://community.zarafa.com/pg/blog/read/14505/webapp-the-dropbox-plugin Dropbox plug-in]
 +
 
 +
== Webmail : ==
 
Access with a browser,
 
Access with a browser,
  
Line 1,998: Line 2,223:
 
  https://server/webapp (NEW VERSION OF WEBACCESS)
 
  https://server/webapp (NEW VERSION OF WEBACCESS)
  
=== Connecting Outlook : ===
+
== Connecting Outlook : ==
  
 
  On your Windowsclients, execute zarafaclient.msi (Moved earlier to an installshare in your network - cf. supra)
 
  On your Windowsclients, execute zarafaclient.msi (Moved earlier to an installshare in your network - cf. supra)
Line 2,004: Line 2,229:
 
  Configure Outlook (point it to your zarafaserver with the credentials of a created Zarafa-user (if DB-plugin : create Zarafa-users first))
 
  Configure Outlook (point it to your zarafaserver with the credentials of a created Zarafa-user (if DB-plugin : create Zarafa-users first))
  
=== Connecting other clients : ===
+
== Connecting other clients : ==
==== IMAP/POP3 ====
+
=== IMAP/POP3 ===
 
The default ports for Zarafa are 8000 + default values
 
The default ports for Zarafa are 8000 + default values
 
*so imap = 8143, imaps = 8993
 
*so imap = 8143, imaps = 8993
 
*so pop3 = 8110, pop3s = 8995
 
*so pop3 = 8110, pop3s = 8995
  
=== Zarafa-documentation : ===
+
== Zarafa-documentation : ==
  
==== Zarafa Administrator Manual ====
+
=== Zarafa Administrator Manual ===
 
[http://doc.zarafa.com/7.0/Administrator_Manual/en-US/html-single/index.html Zarafa Administrator Manual]<br>
 
[http://doc.zarafa.com/7.0/Administrator_Manual/en-US/html-single/index.html Zarafa Administrator Manual]<br>
[http://doc.zarafa.com/7.0/Release_Notes/en-US/html-single Release notes (changes in the Zarafa-configfiles)]
+
[http://doc.zarafa.com/7.0/Release_Notes/en-US/html-single Release notes (changes in the Zarafa-configfiles)]<br>
 +
=== Zarafa User Manual ===
 +
[http://doc.zarafa.com/trunk/User_Manual_WebApp/en-US/html/ Usermanual Zarafa-Webapp]
  
==== Help for the zarafa-admin-tool ====
+
=== Help for the zarafa-admin-tool ===
 
  zarafa-admin --help
 
  zarafa-admin --help
==== man-pages ====
+
=== man-pages ===
 +
==== services-man-pages ====
 
  man zarafa-server
 
  man zarafa-server
 
  man zarafa-monitor
 
  man zarafa-monitor
Line 2,027: Line 2,255:
 
  man zarafa-indexer
 
  man zarafa-indexer
 
  man zarafa-licensed
 
  man zarafa-licensed
 +
==== configuation-man-pages ====
 
  man zarafa-server.cfg
 
  man zarafa-server.cfg
 
  man zarafa-monitor.cfg
 
  man zarafa-monitor.cfg
Line 2,039: Line 2,268:
 
[[Category:Howto]]
 
[[Category:Howto]]
 
[[Category:Groupware]]
 
[[Category:Groupware]]
 +
 +
==Bugs==
 +
 +
Please raise bugs under the SME-Contribs section in {{BugzillaFileBug|product=|component=|title=bugzilla}}and select the smeserver-zarafa-unix component or use {{BugzillaFileBug|product=SME%20Contribs|component=smeserver-zarafa|title=this link}}.
 +
 +
[http://bugs.contribs.org/buglist.cgi?query_format=advanced&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&value0-0-0=Open&component=smeserver-zarafa&product=SME%20Contribs Search open bugs] for smeserver-zarafa at bugs.contribs.org
 +
 +
Zarafa: use their forum for zarafa specific bug reporting, http://forums.zarafa.com/
 +
 +
{{#bugzilla:columns=id,product,version,status,summary |sort=id|order=desc |component=smeserver-zarafa|noresultsmessage="No open bugs found."}}

Latest revision as of 12:56, 29 June 2016

PythonIcon.png Skill level: Advanced
The instructions on this page may require deviations from standard procedures. A good understanding of linux and Koozali SME Server is recommended.


Important.png Note:
This wiki page is specific to SME8 only.

There is a separate wiki page on how to install Zarafa 7.x on SME7 Zarafa on SME 7.

There is a separate wiki page with a fully automated install of Zarafa 7.1.x on SME9 that utilizes the unix plugin Zarafa on SME 9.



  • New zarafa-7.0.x- and z-push-install/upgradescripts for SME8
    These new 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 !
    There is even more integration with the SME-perlDB too. (Most of the zarafa-config-keys can be set in the SME-perlDB !).
  • You can find a upgrade-path to Z-push 2.0 (tested with Zarafa 7.0.12 and Z-push 2.0.7).
  • For version 1.3 of the Webapp you need minimum zarafa 7.0.12.

_____________________


Maintainer

Frederik POLLET : email

Version

smeserver-zarafa
The latest version of smeserver-zarafa is available in the SME repository, click on the version number(s) for more information.


zarafa
The latest version of zarafa is available in the SME repository, click on the version number(s) for more information.


Description

Zarafa is a groupware-server which enables the sharing of mail, contacts, appointments, notes and tasks in a web-interface and/or Microsoft Outlook (or even other clients). It supports MAPI, POP3, IMAP, CalDAV/iCal. It can be used as a MS Exchange replacement, even featuring public folders. Connecting Microsoft Outlook with this groupware-server is simple, enabling most of the MS Exchange-functions.

Z-push is an implementation of Microsoft's ActiveSync protocol which is used 'over-the-air' for multi platform active sync devices, including Windows Mobile and active sync used on Apple's iPhone, Sony Ericsson and Nokia phones. Open source Z-Push enables any PHP-based groupware package to become fully syncable with any ActiveSync-compliant device.

Making some decisions before installing

Zarafa can be configured with 3 different 'user-backends' :

  • database (db)
  • unix-users
  • LDAP/AD (not implemented in this howto)

Using the db-plugin in the Zarafa-configuration, let you make your zarafa-users in the MySQL-zarafadatabase, with a separate user-password for every Zarafa-user and a store. So, you make your separated Zarafa-users and the stores for these Zarafa-users one by one in the Zarafa-MySQL-database with the zarafa-admin-tool and sripts in this howto. There is no syncronisation between the SME-user-passwords and the Zarafa-user-passwords. You can only enable maildelivery for a SME/unix-user to a Zarafa-user with the same logon-name.

When using the unix-plugin in the Zarafa-configuration, Zarafa makes a store for every SME/unix-user on your system, except for those who are excluded by the template used in this howto. Zarafa uses the passwords of the SME/unix-users. There are no separated Zarafa-users and no separated passwords. You can enable maildelivery for a SME/unix-user to Zarafa. Since the unix files do not contain enough information for Zarafa, there are some properties of a user that will be stored in the MySQL-zarafadatabase. These properties are the email address, overriding quota settings, and administrator settings. The zarafa-admin-tool has to be used to update these user properties. All other user-properties are done using the normal unix tools. The unix-plugin seems to be your best choice if all your SME-users will use Zarafa Webaccess/Microsoft Outlook, and you don't need a multicompany-environment.

MORE INFORMATION

In a multicompany-evironment every company has his own Global Adressbook and public folders.

Warning.png Warning:
A multicompany-evironment is only possible with the DB-plugin.


Warning.png Warning:
IMPORTANT : If you want to have a multicompany-environment, format of the SME/unix-username and the ZARAFA-username has to be [username].[companyname] !!!


INSTALLATION of VERSION 7.0.x

Search latest php53-mapi.rpm for 7.0.x (NOT 7.1.x !)

SME8 uses PHP5.3
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 :

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 php53-mapi-package for 7.0.x (NOT 7.1.x !).

https://admin.fedoraproject.org/updates/search/php53-mapi?

Set the epel-repository (incl. epel-testing) :

/sbin/e-smith/db yum_repositories set epel repository \
Name 'Epel - EL5' \
BaseUrl 'http://download.fedoraproject.org/pub/epel/5/$basearch' \
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 \
Name 'Epel-testing - EL5' \
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

Download via the Zarafawebsite the package for ZCP corresponding with the php53-mapi.rpm (cf. version above !!)

Make an installdirectory (ex. : /root/InstallZarafa)

mkdir -p /root/InstallZarafa

Go (cd /...) to the installdirectory (ex. : /root/InstallZarafa) :

cd /to the installdirectory

ex.:

cd /root/InstallZarafa
wget http://download.zarafa.com/community/final/7.0/[version]/zcp-[version]-rhel-5-[cpu-arch]-free.tar.gz

The 'free'-version has the ability to connect with Microsoft Outlook (default 3 users for free, buy zarafa-CAL's if you want more).

Unpack the corresponding package for ZCP :

tar -zxvf zcp-*

Remove the devel packages

Go (cd ./zcp-...) to the created subdirectory (zcp-...) :

cd ./zcp- ... 
rm -f *-dev*.rpm

Move the windows-directory to an installshare in your network

Download the latest webapp.rpm too in the same subdirectory :

wget http://download.zarafa.com/community/final/WebApp/[version]/rhel/[zarafa-webapp-version.noarch.rpm]

Install all rpm's in the unpacked package of ZCP and the webapp.rpm too :

yum localinstall *.rpm

All packages have dependencies that cannot be resolved if you install only part of the rpm's.

Remove the default php-mapi.rpm

We have to remove the installation of the default php-mapi (because it's not built for php 5.3).

rpm -e php-mapi --nodeps

Install the php53-mapi.rpm

-If you downloaded the rpm :

rpm -Uvh --force php53-mapi

-If you did set the EPEL-repository :

yum install php53-mapi-[same ZCP-verion as above] --enablerepo=epel --enablerepo=epel-testing

Make install/update-actions

INSTALLSCRIPT

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/indexer.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-indexer 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-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  
 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-indexer 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-indexer 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-indexer 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-indexer 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 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'\''; }'
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'\''; }'


#
#--- 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'\''; }'


######################################
# 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 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
/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-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


######################################
# 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-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


#######################################
# 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

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 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'\''; }'
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'\''; }'


#
#--- 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'\''; }'


/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-install (see installscript above for 7.0.x !!!!)

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

UPGRADING of Zarafa

VERSION 7.0.x (7.0.x -> 7.0.x)

Download via the Zarafawebsite the package for ZCP corresponding with the newest php53-mapi.rpm (cf. version above)

Go (cd /...) to the installdirectory (ex. : /root/InstallZarafa) :

cd /to the installdirectory

ex.:

cd /root/InstallZarafa
wget http://download.zarafa.com/community/final/7.0/[version]/zcp-[version]-rhel-5-[cpu-arch]-free.tar.gz

Unpack the corresponding package for ZCP :

tar -zxvf zcp-*

Remove the devel packages

Go (cd ./zcp-...) to the created subdirectory (zcp-...) :

cd ./zcp- ... 
rm -f *-dev*.rpm

Move the windows-directory to an installshare in your network

Download the latest webapp.rpm too in the same subdirectory :

wget http://download.zarafa.com/community/final/WebApp/[version]/rhel/[zarafa-webapp-version.noarch.rpm]

!!! Remove the existing php53-mapi.rpm first : !!!

rpm -e php53-mapi --nodeps

Install all rpm's in the unpacked package of ZCP and the webapp.rpm too :

yum localinstall *.rpm

All packages have dependencies that cannot be resolved if you install only part of the rpm's.

If you only want to upgrade one package (ex. the Webapp) :

cd /to the new Webapp.rpm
rpm -Uvh --force zarafa-webapp-[version].noarch

Remove the default php-mapi.rpm

We have to remove the installation of the default php-mapi (because it's not built for php 5.3).

rpm -e php-mapi --nodeps

Install the NEW php53-mapi.rpm

-If you downloaded the rpm :

rpm -Uvh --force php53-mapi

-If you did set the EPEL-repository :

yum install php53-mapi-[same ZCP-verion as above] --enablerepo=epel --enablerepo=epel-testing

Execute zarafa-update (see upgradescript above for 7.0.x !!!!)

cd /etc/e-smith/events/actions/
./zarafa-update

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 :

http://doc.zarafa.com/7.0/Release_Notes/en-US/html-single/
signal-event post-upgrade; signal-event reboot

INSTALLATION of Z-push (1.5.x or 2.0.x)

  • You can test if z-push is installed and functioning by going to http://[your-server-ip]/Microsoft-Server-ActiveSync You should be presented with a login request, and if you cancel, you will see Z-Push info. If you see both, z-push is working just fine.
  • If you experience (all of a sudden) z-push issues with your smartphone, please increase the PHP memory limit as descibed here
  • Please note that z-push version 2.1 works with the below 2.0.x instructions, but you need to install php-posix
yum install php-posix

VERSION 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 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'

INSTALLSCRIPT

nano -w /etc/e-smith/events/actions/z-push-install
#!/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


To save :
CTRL + X
yes
<ENTER>

UPGRADESCRIPT

nano -w /etc/e-smith/events/actions/z-push-update
#!/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


To save :
CTRL + X
yes
<ENTER>

See further : "Any version"

VERSION 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'

INSTALLSCRIPT

nano -w /etc/e-smith/events/actions/z-push-install
#!/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
FILE=/var/lib/z-push; if [ -d $FILE ]; then /bin/echo -e "** $FILE already exists, skipping **\n"; else /bin/mkdir $FILE; fi
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/echo -e "** $FILE already exists, skipping **\n"; else /bin/mkdir $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


To save :
CTRL + X
yes
<ENTER>

UPGRADESCRIPT

nano -w /etc/e-smith/events/actions/z-push-update
#!/bin/sh

######################################
# Configuration of Z-push
######################################

/bin/echo
/bin/echo "Configuration of Z-push"
/bin/echo
FILE=/var/lib/z-push; if [ -d $FILE ]; then /bin/echo -e "** $FILE already exists, skipping **\n"; else /bin/mkdir $FILE; fi
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/echo -e "** $FILE already exists, skipping **\n"; else /bin/mkdir $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


To save :
CTRL + X
yes
<ENTER>

See further : "Any version"

ANY VERSION (1.5.x or 2.0.x)

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
cd /etc/e-smith/events/actions/
./z-push-install

UPGRADING of Z-push

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.x -> 2.0.x

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

Managing Zarafa-users/companies :

With Unix-plugin

Zarafa-users are created with the creation of a SME-user, but you have to enable delivery to zarafa for these SME-users.

Enable maildelivery to zarafa for a user :

db accounts setprop [USERNAME] zarafa enabled
/etc/e-smith/events/actions/qmail-update-user

Disable maildelivery to zarafa for a user :

db accounts setprop [USERNAME] zarafa disabled
/etc/e-smith/events/actions/qmail-update-user

Enable mail delivery to zarafa for ALL users :

config setprop zarafa-server GlobalForward enabled
/etc/e-smith/events/actions/qmail-update-user

Other options for managing users

zarafa-admin --help

With DB-plugin

Create company (in a Multi-company-environment)

/etc/e-smith/events/actions/zarafa-create-company

Create user

/etc/e-smith/events/actions/zarafa-create-user

Disable maildelivery to zarafa for a user :

db accounts setprop [USERNAME] zarafa disabled
/etc/e-smith/events/actions/qmail-update-user

Other options for managing users/companies

zarafa-admin --help

Usefull commands :

Change db-entries (Change default-values in zarafa-config-files)

config setprop [zarafa-service] [key] [value]
/etc/e-smith/events/actions/zarafa-expand-templates
/etc/e-smith/events/actions/zarafa-services restart

Change loglevel to 5 (= max. (default = 2))

config setprop zarafa-server log_level 5
config setprop zarafa-dagent log_level 5
config setprop zarafa-spooler log_level 5
config setprop zarafa-monitor log_level 5
config setprop zarafa-ical log_level 5
config setprop zarafa-gateway log_level 5
config setprop zarafa-licensed log_level 5
config setprop zarafa-indexer log_level 5
/etc/e-smith/events/actions/zarafa-expand-templates
/etc/e-smith/events/actions/zarafa-services restart

Change index-interval to 60 minutes (= max. (default = 5))

config setprop zarafa-indexer index_interval 60
/etc/e-smith/events/actions/zarafa-expand-templates
/etc/e-smith/events/actions/zarafa-services restart

Setting system-email-address

config setprop zarafa-server system_email_address [admin@mydomain.com] 
/etc/e-smith/events/actions/zarafa-expand-templates
/etc/e-smith/events/actions/zarafa-services restart

Debugging Z-push 1.5.x (not for 2.0.x)

Disable (debugging is enabled by default in this howto)

rm -f /var/www/html/z-push/debug.txt

Enable after disabling (debugging is enabled by default in this howto)

/bin/touch /var/www/html/z-push/debug.txt
/bin/chown www:www /var/www/html/z-push/debug.txt
/bin/chmod 755 /var/www/html/z-push/debug.txt

View userdetails

zarafa-admin --details [user]

Setting/Changing send-emailadres for a user

zarafa-admin -u [user] -e [send-emailadres]

Setting/Changing fullname for a user

zarafa-admin -u [user] -f "[full name]"

Quota-settings

zarafa-admin -u [user] --qo y --qw 1600 --qs 1800 --qh 2000

Give a user administrator-privileges

zarafa-admin -u [user] -a y

Usefull plugins :

Password-plugin for webaccess (ONLY FOR DB-PLUGIN)

Dev-page

After installation : in /var/lib/zarafa-webaccess/plugins/passwd/dialogs/pwdchange.php, change this line :

$passwd_cmd = "/usr/local/bin/zarafa-passwd -u %s -o %s -p %s";

to this :

$passwd_cmd = "/usr/bin/zarafa-passwd -u '%s' -o '%s' -p '%s'";

Password-change by users from outsite your network for webaccess/webapp (IF USING THE UNIX PLUGIN)

Install Usermanager

UserManager : Install smeserver-userpanel and smeserver-userpanels

nano /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/VirtualHosts/28UserManagerProxyPass

 {
    # vim: ft=perl:
    $haveSSL = (exists ${modSSL}{status} and ${modSSL}{status} eq "enabled") ?  'yes' : 'no';
    $plainTextAccess = ${'httpd-admin'}{PermitPlainTextAccess} || 'no';
    $OUT = '';
    foreach $place ('user-manager','server-common','user')
    {
        if (($port eq "80") && ($haveSSL eq 'yes') && ($plainTextAccess ne 'yes'))
        {
            $OUT .= "    RewriteRule ^/$place(/.*|\$)    https://%{HTTP_HOST}/$place\$1 [L,R,NC]\n";
        } else {
            $OUT .= "    ProxyPass /$place http://127.0.0.1:${'httpd-admin'}{TCPPort}/$place\n";
            $OUT .= "    ProxyPassReverse /$place http://127.0.0.1:${'httpd-admin'}{TCPPort}/$place\n";
        }
        $OUT .= "    <Location /$place>\n";
        $OUT .= "        order deny,allow\n";
        $OUT .= "        deny from all\n";
        $OUT .= "        allow from all\n";    
        $OUT .= "    </Location>\n";
    }
 }

To save :

CTRL + X
yes
<ENTER>

Via the Server-Manager : Delegate the userpanel-password to external users

Now these external users can change from outsite your network there sme-password : https://www.yourdomain.tld/user

WebApp - OwnCloud attachment plug-in

OwnCloud attachment plug-in

WebApp - Dropbox attachment plug-in

Dropbox plug-in

Webmail :

Access with a browser,

https://server/zarafa
https://server/webaccess
https://server/webmail (with Horde disabled '/server-manager > Email > Webmail Access')
https://server/webapp (NEW VERSION OF WEBACCESS)

Connecting Outlook :

On your Windowsclients, execute zarafaclient.msi (Moved earlier to an installshare in your network - cf. supra)
Configure Outlook (point it to your zarafaserver with the credentials of a created Zarafa-user (if DB-plugin : create Zarafa-users first))

Connecting other clients :

IMAP/POP3

The default ports for Zarafa are 8000 + default values

  • so imap = 8143, imaps = 8993
  • so pop3 = 8110, pop3s = 8995

Zarafa-documentation :

Zarafa Administrator Manual

Zarafa Administrator Manual
Release notes (changes in the Zarafa-configfiles)

Zarafa User Manual

Usermanual Zarafa-Webapp

Help for the zarafa-admin-tool

zarafa-admin --help

man-pages

services-man-pages

man zarafa-server
man zarafa-monitor
man zarafa-dagent
man zarafa-gateway
man zarafa-spooler
man zarafa-ical
man zarafa-indexer
man zarafa-licensed

configuation-man-pages

man zarafa-server.cfg
man zarafa-monitor.cfg
man zarafa-dagent.cfg
man zarafa-gateway.cfg
man zarafa-spooler.cfg
man zarafa-ical.cfg
man zarafa-indexer.cfg
man zarafa-licensed.cfg
man zarafa-unix.cfg

Bugs

Please raise bugs under the SME-Contribs section in bugzilla and select the smeserver-zarafa-unix component or use this link .

Search open bugs for smeserver-zarafa at bugs.contribs.org

Zarafa: use their forum for zarafa specific bug reporting, http://forums.zarafa.com/

IDProductVersionStatusSummary (22 tasks)
7195SME Contribs8.0UNCONFIRMEDLater php53-mapi version requested
7177SME Contribs8.0UNCONFIRMEDZarafa for SME8 custom templates
6746SME Contribs8.0UNCONFIRMEDNo configuration information in Panel
6683SME Contribs8.0UNCONFIRMEDZarafa7 on SME8b6, zarafa-monitor is complaining that Terminal locale is not UTF-8
6682SME Contribs8.0UNCONFIRMEDmysql password is not properly set on SME8b6
6648SME Contribs8.0UNCONFIRMEDText-string might need review
6552SME Contribs8.0CONFIRMEDZarafa webmail mobile does not work
6459SME Contribs7.5CONFIRMEDsmeserver-zarafa package has disappeared from the smecontribs repo
6357SME Contribs7.5CONFIRMEDAdd autodiscover functionality
6305SME Contribs7.5CONFIRMEDserver_timezone parameter missing in /etc/zarafa/ical.cfg
5972SME Contribs7.4CONFIRMEDExclude non valid users and groups from unix plugin
5901SME Contribs7.4CONFIRMEDUpdate Zarafa From 6.40.RC5 to RC6 Crash the DB
5847SME Contribs7.4CONFIRMEDzarafa-install not found!
5841SME Contribs7.4CONFIRMEDConfig error with Unknown option found
5789SME Contribs8.0CONFIRMEDmapi extension not found -- error with Zarafa on sme8b5 WIP
5731SME Contribs7.4CONFIRMEDZarafa doesn't use the modSSL certificate
5667SME Contribs7.4CONFIRMEDAllow for non alphabetical characters in the fullname field
5666SME Contribs7.4CONFIRMEDAllow for non alphanumeric characters in passwords
5561SME Contribs7.4CONFIRMEDLost zarafa users after recent yum updates
5524SME Contribs7.4CONFIRMEDdelivery failure notice of big mail stuck in zarafa
5413SME Contribs7.4CONFIRMEDNo access to icals port 8089 with access=public
4886SME Contribs7.4CONFIRMEDtrigger zarafa-update on updates of zarafa* rpms