$OpenBSD: README.OpenBSD,v 1.10 2009/11/21 12:09:29 ajacoutot Exp $

*** Upgrading users: refer to zarafa documentation on the web to check
*** if any particular step is required after upgrading to a new version. 

Post-install/update instructions for Zarafa
===========================================

By default the server is configured to accept SOAP connections on port
236. If you wish to connect Outlook clients on port 80, please setup
your web server to proxy HTTP requests with URI=/zarafa to
http://localhost:236.

It is advised to tune the MySQL installation according to:
    http://zarafa.com/wiki/index.php/MySQL_tuning
(especially for max_allowed_packet)


Before Starting zarafa-server for the first time
------------------------------------------------

* a MySQL datatabase access needs to be configured in
    /etc/zarafa/server.cfg


After zarafa-server was started for the first time
--------------------------------------------------

* Creating the public store.
    # /usr/local/bin/zarafa-admin -s

* Adding an admin user -- see zarafa-admin(1).
    # /usr/local/bin/zarafa-admin -c zadmin -p secret -e zarafa.admin@domain.tld -f "John Doe" -a 2


Starting Zarafa on boot-up
--------------------------

To start all zarafa services on boot-up, add the following lines to
/etc/rc.local:

if [ -x /usr/local/bin/zarafa-server ]; then
	# make sure mysqld is running before starting zarafa-server
	# (give up after 15 secs)
	i=1
	while [ ! -S "/var/run/mysql/mysql.sock" -a ${i} -lt 15 ]; do
		sleep 1
		i=`expr ${i} + 1`
	done
	for i in zarafa-server zarafa-spooler zarafa-monitor zarafa-gateway zarafa-ical; do
		echo -n " ${i}"; /usr/local/bin/${i}
	done
fi


Shutting down Zarafa
--------------------

zarafa-server may need some time to correctly shut down.
It is advised you use something like the following at the end of your
/etc/rc.shutdown file:

if [ "`pgrep zarafa`" ]; then
	echo "Shutting down Zarafa..."
	pkill zarafa-ical
	pkill zarafa-gateway
	pkill zarafa-monitor
	pkill zarafa-spooler
	pkill zarafa-server
	sleep 5
	i=0
	while [ $i -lt 15 ]
		do
		if [ "`pgrep zarafa\-`" ]; then
			pkill zarafa\-
			sleep 5
			i=`expr $i + 5`
		else
			i=15
		fi
	done
	pkill -9 zarafa\-
fi


Mail delivery agent configuration
---------------------------------

The easiest way to use zarafa-dagent system-wide under a stock OpenBSD
sendmail installation is to use procmail(1).
See the following URL for other MTA integration:
    http://www.zarafa.com/?q=en/faq/61

1. Using procmail.
==================
First, install the procmail package and configure /etc/procmailrc
the following way:
 
:0 w
| /usr/local/bin/zarafa-dagent $LOGNAME
EXITCODE=$?

Next, you need to add the following line to your sendmail.mc file then
restart sendmail(8):
    FEATURE(`local_procmail')dnl

2. Configuring sendmail to use the zarafa-dagent directly.
==========================================================
To enable the Zarafa dagent for all other deliveries (including
localhost), add the following lines to your sendmail.mc and restart
sendmail(8):
    FEATURE(`local_zarafa')dnl
    MAILER(`zarafa')dnl


The PHP mapi module and OpenBSD Apache
--------------------------------------

When using the OpenBSD Apache server, the runtime loader will need to
pre-load the pthread shared library. While the php binary is linked with
-pthread, httpd is not and the PHP mapi module needs
the pthread_mutex_init(3) function.
To do so, we need to start httpd with LD_PRELOAD set in /etc/rc.local
(do not set httpd_flags in rc.conf(8)).
e.g:

rm -f /var/www/logs/{ssl_mutex,httpd.lock,accept.lock}.*
echo -n ' httpd'
LD_PRELOAD=/usr/lib/libpthread.so /usr/sbin/httpd -DSSL


Documentation and help
----------------------

Each zarafa-* command has its corresponding manpage.

Some documentation is also available on the Internet:
    http://www.zarafa.com/wiki/index.php/Main_Page
    http://www.zarafa.com/content/documentation
