<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.open-xchange.com/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Shecki</id>
	<title>Open-Xchange - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.open-xchange.com/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Shecki"/>
	<link rel="alternate" type="text/html" href="https://wiki.open-xchange.com/wiki/index.php?title=Special:Contributions/Shecki"/>
	<updated>2026-11-25T16:19:36Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.7</generator>
	<entry>
		<id>https://wiki.open-xchange.com/wiki/index.php?title=OX6:MailNotify_Bundle&amp;diff=7293</id>
		<title>OX6:MailNotify Bundle</title>
		<link rel="alternate" type="text/html" href="https://wiki.open-xchange.com/wiki/index.php?title=OX6:MailNotify_Bundle&amp;diff=7293"/>
		<updated>2011-03-01T12:41:07Z</updated>

		<summary type="html">&lt;p&gt;Shecki: /* Configuration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Open-Xchange Mail Push =&lt;br /&gt;
&lt;br /&gt;
Beginning with the 6.16 release, there&#039;s a new bundle handling external notifications of new mail to send push requests to mobile devices.&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
This Bundle is currently only able to cooperate with the mail notification functionality of cyrus-imapd, but this will change in a way, that future versions will be configurable on what kind of notification protocol is required.&lt;br /&gt;
&lt;br /&gt;
At the moment, this bundle listens on the address and port as configured in &amp;lt;tt&amp;gt;/opt/open-xchange/etc/groupware/push_mailnotify.properties&amp;lt;/tt&amp;gt; accepting UDP datagrams following the format as used in the cyrus notifyd:&lt;br /&gt;
&lt;br /&gt;
 notifyd/notifyd.c:&lt;br /&gt;
 method NUL class NUL priority NUL user NUL mailbox NUL nopt NUL N(option NUL) message NUL&lt;br /&gt;
&lt;br /&gt;
and the only information which is currently being evaluated is the fourth one, the &amp;lt;tt&amp;gt;username&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{InstallPlugin|pluginname=open-xchange-push-mailnotify|sopath=stable}}&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
On the server running cyrus, add the following to &amp;lt;tt&amp;gt;/etc/imapd.conf&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 mailnotifier: log&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;tt&amp;gt;/etc/cyrus.conf&amp;lt;/tt&amp;gt; take care, that cyrus own notifyd is &#039;&#039;&#039;NOT&#039;&#039;&#039; in use. If it is not commented, either do that or remove it completely.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
  # this is only necessary if using notifications&lt;br /&gt;
  #  notify       cmd=&amp;quot;notifyd&amp;quot; listen=&amp;quot;/var/lib/imap/socket/notify&amp;quot; proto=&amp;quot;udp&amp;quot; prefork=1&lt;br /&gt;
&lt;br /&gt;
Install the program &amp;lt;tt&amp;gt;socat&amp;lt;/tt&amp;gt;. Socat is a Multipurpose relay (see http://www.dest-unreach.org/socat/) which must be used to relay the udb datagrams from the unix domain socket to the open-xchange push bundle.&lt;br /&gt;
&lt;br /&gt;
To redirect the notifications to the open-xchange server, socat must be started like this:&lt;br /&gt;
&lt;br /&gt;
 socat -u -4 UNIX-RECV:/var/lib/cyrus/socket/notify,unlink-early,perm-early=777,type=2 \&lt;br /&gt;
          UDP-SENDTO:&amp;lt;YOUROXIP&amp;gt;:&amp;lt;YOURPUSHPORT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please check location of socket, whether path exists and is correct in &amp;lt;tt&amp;gt;/etc/cyrus.conf&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To debug whether cyrus sends messages, you might want to add debugging to socat:&lt;br /&gt;
&lt;br /&gt;
 socat -d -d -d -D -v -u -4 UNIX-RECV:/var/lib/imap/socket/notify,unlink-early,perm-early=777,type=2 \&lt;br /&gt;
          UDP-SENDTO:&amp;lt;YOUROXIP&amp;gt;:&amp;lt;YOURPUSHPORT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example Initscript for Debian ==&lt;br /&gt;
&lt;br /&gt;
The following initscript can be used to start the socat tunnel on debian.&lt;br /&gt;
A file /etc/default/ox-push can be created to define parameters such as&lt;br /&gt;
DAEMON_ARGS.&lt;br /&gt;
&lt;br /&gt;
After copying the script to /etc/init.d/ox-push do the following:&lt;br /&gt;
&lt;br /&gt;
 $ chmod 755 /etc/init.d/ox-push&lt;br /&gt;
 $ update-rc.d ox-push defaults&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#! /bin/sh&lt;br /&gt;
### BEGIN INIT INFO&lt;br /&gt;
# Provides:          ox-push&lt;br /&gt;
# Required-Start:    $local_fs $remote_fs open-xchange-groupware&lt;br /&gt;
# Required-Stop:     $local_fs $remote_fs&lt;br /&gt;
# Default-Start:     2 3 4 5&lt;br /&gt;
# Default-Stop:      0 1 6&lt;br /&gt;
# Short-Description: UDP Tunnel for Open-Xchange mail push&lt;br /&gt;
# Description:       Tunnel UDP Datagrams from cyrus notify unix socket&lt;br /&gt;
#                    to Open-Xchange Mail Push bundle&lt;br /&gt;
### END INIT INFO&lt;br /&gt;
&lt;br /&gt;
# Do NOT &amp;quot;set -e&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# PATH should only include /usr/* if it runs after the mountnfs.sh script&lt;br /&gt;
PATH=/sbin:/usr/sbin:/bin:/usr/bin&lt;br /&gt;
DESC=&amp;quot;Open-Xchange Push Tunnel&amp;quot;&lt;br /&gt;
NAME=socat&lt;br /&gt;
DAEMON=/usr/bin/$NAME&lt;br /&gt;
DAEMON_ARGS=&amp;quot;-u -4 UNIX-RECV:/var/lib/imap/socket/notify,unlink-early,perm-early=777,type=2 UDP-SENDTO:localhost:23420&amp;quot;&lt;br /&gt;
PIDFILE=/var/run/$NAME.pid&lt;br /&gt;
SCRIPTNAME=/etc/init.d/$NAME&lt;br /&gt;
&lt;br /&gt;
# Exit if the package is not installed&lt;br /&gt;
[ -x &amp;quot;$DAEMON&amp;quot; ] || exit 0&lt;br /&gt;
&lt;br /&gt;
# Read configuration variable file if it is present&lt;br /&gt;
[ -r /etc/default/$NAME ] &amp;amp;&amp;amp; . /etc/default/$NAME&lt;br /&gt;
&lt;br /&gt;
# Load the VERBOSE setting and other rcS variables&lt;br /&gt;
. /lib/init/vars.sh&lt;br /&gt;
&lt;br /&gt;
# Define LSB log_* functions.&lt;br /&gt;
# Depend on lsb-base (&amp;gt;= 3.0-6) to ensure that this file is present.&lt;br /&gt;
. /lib/lsb/init-functions&lt;br /&gt;
&lt;br /&gt;
#&lt;br /&gt;
# Function that starts the daemon/service&lt;br /&gt;
#&lt;br /&gt;
do_start()&lt;br /&gt;
{&lt;br /&gt;
	# Return&lt;br /&gt;
	#   0 if daemon has been started&lt;br /&gt;
	#   1 if daemon was already running&lt;br /&gt;
	#   2 if daemon could not be started&lt;br /&gt;
	start-stop-daemon --start -b --quiet -m --pidfile $PIDFILE --exec $DAEMON --test &amp;gt; /dev/null \&lt;br /&gt;
		|| return 1&lt;br /&gt;
	start-stop-daemon --start -b --quiet -m --pidfile $PIDFILE --exec $DAEMON -- \&lt;br /&gt;
		$DAEMON_ARGS \&lt;br /&gt;
		|| return 2&lt;br /&gt;
	# Add code here, if necessary, that waits for the process to be ready&lt;br /&gt;
	# to handle requests from services started subsequently which depend&lt;br /&gt;
	# on this one.  As a last resort, sleep for some time.&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#&lt;br /&gt;
# Function that stops the daemon/service&lt;br /&gt;
#&lt;br /&gt;
do_stop()&lt;br /&gt;
{&lt;br /&gt;
	# Return&lt;br /&gt;
	#   0 if daemon has been stopped&lt;br /&gt;
	#   1 if daemon was already stopped&lt;br /&gt;
	#   2 if daemon could not be stopped&lt;br /&gt;
	#   other if a failure occurred&lt;br /&gt;
	start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME&lt;br /&gt;
	RETVAL=&amp;quot;$?&amp;quot;&lt;br /&gt;
	[ &amp;quot;$RETVAL&amp;quot; = 2 ] &amp;amp;&amp;amp; return 2&lt;br /&gt;
	# Many daemons don&#039;t delete their pidfiles when they exit.&lt;br /&gt;
	rm -f $PIDFILE&lt;br /&gt;
	return &amp;quot;$RETVAL&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
case &amp;quot;$1&amp;quot; in&lt;br /&gt;
  start)&lt;br /&gt;
	[ &amp;quot;$VERBOSE&amp;quot; != no ] &amp;amp;&amp;amp; log_daemon_msg &amp;quot;Starting $DESC&amp;quot; &amp;quot;$NAME&amp;quot;&lt;br /&gt;
	do_start&lt;br /&gt;
	case &amp;quot;$?&amp;quot; in&lt;br /&gt;
		0|1) [ &amp;quot;$VERBOSE&amp;quot; != no ] &amp;amp;&amp;amp; log_end_msg 0 ;;&lt;br /&gt;
		2) [ &amp;quot;$VERBOSE&amp;quot; != no ] &amp;amp;&amp;amp; log_end_msg 1 ;;&lt;br /&gt;
	esac&lt;br /&gt;
	;;&lt;br /&gt;
  stop)&lt;br /&gt;
	[ &amp;quot;$VERBOSE&amp;quot; != no ] &amp;amp;&amp;amp; log_daemon_msg &amp;quot;Stopping $DESC&amp;quot; &amp;quot;$NAME&amp;quot;&lt;br /&gt;
	do_stop&lt;br /&gt;
	case &amp;quot;$?&amp;quot; in&lt;br /&gt;
		0|1) [ &amp;quot;$VERBOSE&amp;quot; != no ] &amp;amp;&amp;amp; log_end_msg 0 ;;&lt;br /&gt;
		2) [ &amp;quot;$VERBOSE&amp;quot; != no ] &amp;amp;&amp;amp; log_end_msg 1 ;;&lt;br /&gt;
	esac&lt;br /&gt;
	;;&lt;br /&gt;
  restart|force-reload)&lt;br /&gt;
	#&lt;br /&gt;
	# If the &amp;quot;reload&amp;quot; option is implemented then remove the&lt;br /&gt;
	# &#039;force-reload&#039; alias&lt;br /&gt;
	#&lt;br /&gt;
	log_daemon_msg &amp;quot;Restarting $DESC&amp;quot; &amp;quot;$NAME&amp;quot;&lt;br /&gt;
	do_stop&lt;br /&gt;
	case &amp;quot;$?&amp;quot; in&lt;br /&gt;
	  0|1)&lt;br /&gt;
		do_start&lt;br /&gt;
		case &amp;quot;$?&amp;quot; in&lt;br /&gt;
			0) log_end_msg 0 ;;&lt;br /&gt;
			1) log_end_msg 1 ;; # Old process is still running&lt;br /&gt;
			*) log_end_msg 1 ;; # Failed to start&lt;br /&gt;
		esac&lt;br /&gt;
		;;&lt;br /&gt;
	  *)&lt;br /&gt;
	  	# Failed to stop&lt;br /&gt;
		log_end_msg 1&lt;br /&gt;
		;;&lt;br /&gt;
	esac&lt;br /&gt;
	;;&lt;br /&gt;
  *)&lt;br /&gt;
	echo &amp;quot;Usage: $SCRIPTNAME {start|stop|restart|force-reload}&amp;quot; &amp;gt;&amp;amp;2&lt;br /&gt;
	exit 3&lt;br /&gt;
	;;&lt;br /&gt;
esac&lt;br /&gt;
&lt;br /&gt;
:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example Initscript for Redhat/SUSE ==&lt;br /&gt;
&lt;br /&gt;
After copying the script to /etc/init.d/ox-push do the following:&lt;br /&gt;
&lt;br /&gt;
 $ chmod 755 /etc/init.d/ox-push&lt;br /&gt;
&lt;br /&gt;
and on Redhat&lt;br /&gt;
&lt;br /&gt;
 $ chkconfig --level 35 ox-push on&lt;br /&gt;
&lt;br /&gt;
on SUSE&lt;br /&gt;
&lt;br /&gt;
 $ insserv ox-push&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#&lt;br /&gt;
#     LSB system startup script for service/daemon socat tunnel&lt;br /&gt;
#     Based on initscript skeleton.compat as shipped with [open]SUSE.&lt;br /&gt;
#          &lt;br /&gt;
#     This library is free software; you can redistribute it and/or modify it&lt;br /&gt;
#     under the terms of the GNU Lesser General Public License as published by&lt;br /&gt;
#     the Free Software Foundation; either version 2.1 of the License, or (at&lt;br /&gt;
#     your option) any later version.&lt;br /&gt;
#			      &lt;br /&gt;
#     This library is distributed in the hope that it will be useful, but&lt;br /&gt;
#     WITHOUT ANY WARRANTY; without even the implied warranty of&lt;br /&gt;
#     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU&lt;br /&gt;
#     Lesser General Public License for more details.&lt;br /&gt;
#      &lt;br /&gt;
#     You should have received a copy of the GNU Lesser General Public&lt;br /&gt;
#     License along with this library; if not, write to the Free Software&lt;br /&gt;
#     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307,&lt;br /&gt;
#     USA.&lt;br /&gt;
#&lt;br /&gt;
# /etc/init.d/ox-push&lt;br /&gt;
# LSB compatible service control script; see http://www.linuxbase.org/spec/&lt;br /&gt;
# &lt;br /&gt;
# Note: This template uses functions rc_XXX defined in /etc/rc.status on&lt;br /&gt;
# UnitedLinux/SUSE/Novell based Linux distributions. However, it will work&lt;br /&gt;
# on other distributions as well, by using the LSB (Linux Standard Base) &lt;br /&gt;
# or RH functions or by open coding the needed functions.&lt;br /&gt;
# Read http://www.tldp.org/HOWTO/HighQuality-Apps-HOWTO/ if you prefer not &lt;br /&gt;
# to use this template.&lt;br /&gt;
#&lt;br /&gt;
# chkconfig: 345 99 00&lt;br /&gt;
# description: Open Xchange Groupware Daemon&lt;br /&gt;
# &lt;br /&gt;
### BEGIN INIT INFO&lt;br /&gt;
# Provides:          ox-push&lt;br /&gt;
# Required-Start:    $syslog $remote_fs open-xchange-groupware&lt;br /&gt;
# Required-Stop:     $syslog $remote_fs&lt;br /&gt;
# Default-Start:     3 4 5&lt;br /&gt;
# Default-Stop:      0 1 2 6&lt;br /&gt;
# Short-Description: Open Xchange Groupware Daemon&lt;br /&gt;
# Description:       UDP Tunnel for Open-Xchange mail push&lt;br /&gt;
### END INIT INFO&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Note: Special treatment of stop for LSB conformance&lt;br /&gt;
PIDFILE=ox-push.pid&lt;br /&gt;
SOCATBIN=/usr/bin/socat&lt;br /&gt;
SOCATARGS=&amp;quot;-u -4 UNIX-RECV:/var/lib/imap/socket/notify,unlink-early,perm-early=777,type=2 UDP-SENDTO:localhost:23420&amp;quot;&lt;br /&gt;
&lt;br /&gt;
test -x $SOCATBIN || { echo &amp;quot;$SOCATBIN not installed&amp;quot;;&lt;br /&gt;
        if [ &amp;quot;$1&amp;quot; = &amp;quot;stop&amp;quot; ]; then exit 0;&lt;br /&gt;
        else exit 5; fi; }&lt;br /&gt;
&lt;br /&gt;
# Source LSB init functions&lt;br /&gt;
# providing start_daemon, killproc, pidofproc, &lt;br /&gt;
# log_success_msg, log_failure_msg and log_warning_msg.&lt;br /&gt;
# This is currently not used by UnitedLinux based distributions and&lt;br /&gt;
# not needed for init scripts for UnitedLinux only. If it is used,&lt;br /&gt;
# the functions from rc.status should not be sourced or used.&lt;br /&gt;
#. /lib/lsb/init-functions&lt;br /&gt;
&lt;br /&gt;
# Shell functions sourced from /etc/rc.status:&lt;br /&gt;
#      rc_check         check and set local and overall rc status&lt;br /&gt;
#      rc_status        check and set local and overall rc status&lt;br /&gt;
#      rc_status -v     be verbose in local rc status and clear it afterwards&lt;br /&gt;
#      rc_status -v -r  ditto and clear both the local and overall rc status&lt;br /&gt;
#      rc_status -s     display &amp;quot;skipped&amp;quot; and exit with status 3&lt;br /&gt;
#      rc_status -u     display &amp;quot;unused&amp;quot; and exit with status 3&lt;br /&gt;
#      rc_failed        set local and overall rc status to failed&lt;br /&gt;
#      rc_failed &amp;lt;num&amp;gt;  set local and overall rc status to &amp;lt;num&amp;gt;&lt;br /&gt;
#      rc_reset         clear both the local and overall rc status&lt;br /&gt;
#      rc_exit          exit appropriate to overall rc status&lt;br /&gt;
#      rc_active        checks whether a service is activated by symlinks&lt;br /&gt;
&lt;br /&gt;
# Use the SUSE rc_ init script functions;&lt;br /&gt;
# emulate them on LSB, RH and other systems&lt;br /&gt;
&lt;br /&gt;
# Default: Assume sysvinit binaries exist&lt;br /&gt;
start_daemon() { /sbin/start_daemon ${1+&amp;quot;$@&amp;quot;}; }&lt;br /&gt;
killproc()     { /sbin/killproc     ${1+&amp;quot;$@&amp;quot;}; }&lt;br /&gt;
pidofproc()    { /sbin/pidofproc    ${1+&amp;quot;$@&amp;quot;}; }&lt;br /&gt;
checkproc()    { /sbin/checkproc    ${1+&amp;quot;$@&amp;quot;}; }&lt;br /&gt;
if test -e /etc/rc.status; then&lt;br /&gt;
    # SUSE rc script library&lt;br /&gt;
    . /etc/rc.status&lt;br /&gt;
else&lt;br /&gt;
    export LC_ALL=POSIX&lt;br /&gt;
    _cmd=$1&lt;br /&gt;
    declare -a _SMSG&lt;br /&gt;
    if test &amp;quot;${_cmd}&amp;quot; = &amp;quot;status&amp;quot;; then&lt;br /&gt;
	_SMSG=(running dead dead unused unknown reserved)&lt;br /&gt;
	_RC_UNUSED=3&lt;br /&gt;
    else&lt;br /&gt;
	_SMSG=(done failed failed missed failed skipped unused failed failed reserved)&lt;br /&gt;
	_RC_UNUSED=6&lt;br /&gt;
    fi&lt;br /&gt;
    if test -e /lib/lsb/init-functions; then&lt;br /&gt;
	# LSB    &lt;br /&gt;
    	. /lib/lsb/init-functions&lt;br /&gt;
	echo_rc()&lt;br /&gt;
	{&lt;br /&gt;
	    if test ${_RC_RV} = 0; then&lt;br /&gt;
		log_success_msg &amp;quot;  [${_SMSG[${_RC_RV}]}] &amp;quot;&lt;br /&gt;
	    else&lt;br /&gt;
		log_failure_msg &amp;quot;  [${_SMSG[${_RC_RV}]}] &amp;quot;&lt;br /&gt;
	    fi&lt;br /&gt;
	}&lt;br /&gt;
	# TODO: Add checking for lockfiles&lt;br /&gt;
	checkproc() { return pidofproc ${1+&amp;quot;$@&amp;quot;} &amp;gt;/dev/null 2&amp;gt;&amp;amp;1; }&lt;br /&gt;
    elif test -e /etc/init.d/functions; then&lt;br /&gt;
	# RHAT&lt;br /&gt;
	. /etc/init.d/functions&lt;br /&gt;
	echo_rc()&lt;br /&gt;
	{&lt;br /&gt;
	    #echo -n &amp;quot;  [${_SMSG[${_RC_RV}]}] &amp;quot;&lt;br /&gt;
	    if test ${_RC_RV} = 0; then&lt;br /&gt;
		success &amp;quot;  [${_SMSG[${_RC_RV}]}] &amp;quot;&lt;br /&gt;
	    else&lt;br /&gt;
		failure &amp;quot;  [${_SMSG[${_RC_RV}]}] &amp;quot;&lt;br /&gt;
	    fi&lt;br /&gt;
	}&lt;br /&gt;
	checkproc() { return status ${1+&amp;quot;$@&amp;quot;}; }&lt;br /&gt;
	start_daemon() { return daemon ${1+&amp;quot;$@&amp;quot;}; }&lt;br /&gt;
    else&lt;br /&gt;
	# emulate it&lt;br /&gt;
	echo_rc() { echo &amp;quot;  [${_SMSG[${_RC_RV}]}] &amp;quot;; }&lt;br /&gt;
    fi&lt;br /&gt;
    rc_reset() { _RC_RV=0; }&lt;br /&gt;
    rc_failed()&lt;br /&gt;
    {&lt;br /&gt;
	if test -z &amp;quot;$1&amp;quot;; then &lt;br /&gt;
	    _RC_RV=1;&lt;br /&gt;
	elif test &amp;quot;$1&amp;quot; != &amp;quot;0&amp;quot;; then &lt;br /&gt;
	    _RC_RV=$1; &lt;br /&gt;
    	fi&lt;br /&gt;
	return ${_RC_RV}&lt;br /&gt;
    }&lt;br /&gt;
    rc_check()&lt;br /&gt;
    {&lt;br /&gt;
	return rc_failed $?&lt;br /&gt;
    }	&lt;br /&gt;
    rc_status()&lt;br /&gt;
    {&lt;br /&gt;
	rc_failed $?&lt;br /&gt;
	if test &amp;quot;$1&amp;quot; = &amp;quot;-r&amp;quot;; then _RC_RV=0; shift; fi&lt;br /&gt;
	if test &amp;quot;$1&amp;quot; = &amp;quot;-s&amp;quot;; then rc_failed 5; echo_rc; rc_failed 3; shift; fi&lt;br /&gt;
	if test &amp;quot;$1&amp;quot; = &amp;quot;-u&amp;quot;; then rc_failed ${_RC_UNUSED}; echo_rc; rc_failed 3; shift; fi&lt;br /&gt;
	if test &amp;quot;$1&amp;quot; = &amp;quot;-v&amp;quot;; then echo_rc; shift; fi&lt;br /&gt;
	if test &amp;quot;$1&amp;quot; = &amp;quot;-r&amp;quot;; then _RC_RV=0; shift; fi&lt;br /&gt;
	return ${_RC_RV}&lt;br /&gt;
    }&lt;br /&gt;
    rc_exit() { exit ${_RC_RV}; }&lt;br /&gt;
    rc_active() &lt;br /&gt;
    {&lt;br /&gt;
	if test -z &amp;quot;$RUNLEVEL&amp;quot;; then read RUNLEVEL REST &amp;lt; &amp;lt;(/sbin/runlevel); fi&lt;br /&gt;
	if test -e /etc/init.d/S[0-9][0-9]${1}; then return 0; fi&lt;br /&gt;
	return 1&lt;br /&gt;
    }&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Reset status of this service&lt;br /&gt;
rc_reset&lt;br /&gt;
&lt;br /&gt;
# Return values acc. to LSB for all commands but status:&lt;br /&gt;
# 0	  - success&lt;br /&gt;
# 1       - generic or unspecified error&lt;br /&gt;
# 2       - invalid or excess argument(s)&lt;br /&gt;
# 3       - unimplemented feature (e.g. &amp;quot;reload&amp;quot;)&lt;br /&gt;
# 4       - user had insufficient privileges&lt;br /&gt;
# 5       - program is not installed&lt;br /&gt;
# 6       - program is not configured&lt;br /&gt;
# 7       - program is not running&lt;br /&gt;
# 8--199  - reserved (8--99 LSB, 100--149 distrib, 150--199 appl)&lt;br /&gt;
# &lt;br /&gt;
# Note that starting an already running service, stopping&lt;br /&gt;
# or restarting a not-running service as well as the restart&lt;br /&gt;
# with force-reload (in case signaling is not supported) are&lt;br /&gt;
# considered a success.&lt;br /&gt;
&lt;br /&gt;
tstatus() {&lt;br /&gt;
    if [ ! -f /var/run/$PIDFILE ]; then&lt;br /&gt;
        return 3&lt;br /&gt;
    else&lt;br /&gt;
        read PID &amp;lt; /var/run/$PIDFILE&lt;br /&gt;
        test -z &amp;quot;$PID&amp;quot; &amp;amp;&amp;amp; { echo &amp;quot;unable to read pid&amp;quot;; return 3; }&lt;br /&gt;
        if ! ps $PID &amp;gt; /dev/null; then&lt;br /&gt;
                return 3&lt;br /&gt;
        fi&lt;br /&gt;
    fi&lt;br /&gt;
    return 0&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
case &amp;quot;$1&amp;quot; in&lt;br /&gt;
    start)&lt;br /&gt;
	echo -n &amp;quot;Starting ox push &amp;quot;&lt;br /&gt;
	## Start daemon with startproc(8). If this fails&lt;br /&gt;
	## the return value is set appropriately by startproc.&lt;br /&gt;
	$SOCATBIN $SOCATARGS 2&amp;gt;&amp;amp;1 &amp;amp; echo $! &amp;gt; /var/run/$PIDFILE&lt;br /&gt;
&lt;br /&gt;
	# Remember status and be verbose&lt;br /&gt;
	rc_status -v&lt;br /&gt;
	;;&lt;br /&gt;
    stop)&lt;br /&gt;
	echo -n &amp;quot;Shutting down ox push &amp;quot;&lt;br /&gt;
	## Stop daemon with killproc(8) and if this fails&lt;br /&gt;
	## killproc sets the return value according to LSB.&lt;br /&gt;
&lt;br /&gt;
	if [ ! -f /var/run/$PIDFILE ]; then&lt;br /&gt;
		echo &amp;quot;service not running&amp;quot;&lt;br /&gt;
	else&lt;br /&gt;
		read PID &amp;lt; /var/run/$PIDFILE&lt;br /&gt;
		test -z &amp;quot;$PID&amp;quot; &amp;amp;&amp;amp; { echo &amp;quot;unable to read pid&amp;quot;; exit 1; }&lt;br /&gt;
		if ! ps $PID &amp;gt; /dev/null; then&lt;br /&gt;
			echo &amp;quot;service not running&amp;quot;&lt;br /&gt;
		else&lt;br /&gt;
			kill -TERM $PID&lt;br /&gt;
		fi&lt;br /&gt;
	fi&lt;br /&gt;
&lt;br /&gt;
	# Remember status and be verbose&lt;br /&gt;
	rc_status -v&lt;br /&gt;
	;;&lt;br /&gt;
    try-restart|condrestart)&lt;br /&gt;
	## Do a restart only if the service was active before.&lt;br /&gt;
	## Note: try-restart is now part of LSB (as of 1.9).&lt;br /&gt;
	## RH has a similar command named condrestart.&lt;br /&gt;
	if test &amp;quot;$1&amp;quot; = &amp;quot;condrestart&amp;quot;; then&lt;br /&gt;
		echo &amp;quot;${attn} Use try-restart ${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}&amp;quot;&lt;br /&gt;
	fi&lt;br /&gt;
	$0 status&lt;br /&gt;
	if test $? = 0; then&lt;br /&gt;
		$0 restart&lt;br /&gt;
	else&lt;br /&gt;
		rc_reset	# Not running is not a failure.&lt;br /&gt;
	fi&lt;br /&gt;
	# Remember status and be quiet&lt;br /&gt;
	rc_status&lt;br /&gt;
	;;&lt;br /&gt;
    restart)&lt;br /&gt;
	## Stop the service and regardless of whether it was&lt;br /&gt;
	## running or not, start it again.&lt;br /&gt;
	$0 stop&lt;br /&gt;
	$0 start&lt;br /&gt;
&lt;br /&gt;
	# Remember status and be quiet&lt;br /&gt;
	rc_status&lt;br /&gt;
	;;&lt;br /&gt;
    force-reload)&lt;br /&gt;
	## Signal the daemon to reload its config. Most daemons&lt;br /&gt;
	## do this on signal 1 (SIGHUP).&lt;br /&gt;
	## If it does not support it, restart the service if it&lt;br /&gt;
	## is running.&lt;br /&gt;
&lt;br /&gt;
	echo -n &amp;quot;Reload ox push &amp;quot;&lt;br /&gt;
	## if it supports it:&lt;br /&gt;
	#killproc -p $PIDFILE -HUP $OX_BIN&lt;br /&gt;
	#touch /var/run/FOO.pid&lt;br /&gt;
	#rc_status -v&lt;br /&gt;
&lt;br /&gt;
	## Otherwise:&lt;br /&gt;
	$0 try-restart&lt;br /&gt;
	rc_status&lt;br /&gt;
	;;&lt;br /&gt;
    reload)&lt;br /&gt;
	## Like force-reload, but if daemon does not support&lt;br /&gt;
	## signaling, do nothing (!)&lt;br /&gt;
&lt;br /&gt;
	# If it supports signaling:&lt;br /&gt;
	echo -n &amp;quot;Reload ox push &amp;quot;&lt;br /&gt;
	#killproc -p $PIDFILE -HUP $OX_BIN&lt;br /&gt;
	#touch /var/run/FOO.pid&lt;br /&gt;
	#rc_status -v&lt;br /&gt;
	&lt;br /&gt;
	## Otherwise if it does not support reload:&lt;br /&gt;
	rc_failed 3&lt;br /&gt;
	rc_status -v&lt;br /&gt;
	;;&lt;br /&gt;
    status)&lt;br /&gt;
	echo -n &amp;quot;Checking for ox push &amp;quot;&lt;br /&gt;
	## Check status with checkproc(8), if process is running&lt;br /&gt;
	## checkproc will return with exit status 0.&lt;br /&gt;
&lt;br /&gt;
	# Return value is slightly different for the status command:&lt;br /&gt;
	# 0 - service up and running&lt;br /&gt;
	# 1 - service dead, but /var/run/  pid  file exists&lt;br /&gt;
	# 2 - service dead, but /var/lock/ lock file exists&lt;br /&gt;
	# 3 - service not running (unused)&lt;br /&gt;
	# 4 - service status unknown :-(&lt;br /&gt;
	# 5--199 reserved (5--99 LSB, 100--149 distro, 150--199 appl.)&lt;br /&gt;
	&lt;br /&gt;
	# NOTE: checkproc returns LSB compliant status values.&lt;br /&gt;
	tstatus&lt;br /&gt;
	# NOTE: rc_status knows that we called this init script with&lt;br /&gt;
	# &amp;quot;status&amp;quot; option and adapts its messages accordingly.&lt;br /&gt;
	rc_status -v&lt;br /&gt;
	;;&lt;br /&gt;
    *)&lt;br /&gt;
	echo &amp;quot;Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|}&amp;quot;&lt;br /&gt;
	exit 1&lt;br /&gt;
	;;&lt;br /&gt;
esac&lt;br /&gt;
rc_exit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Shecki</name></author>
	</entry>
	<entry>
		<id>https://wiki.open-xchange.com/wiki/index.php?title=OX6:MailNotify_Bundle&amp;diff=7292</id>
		<title>OX6:MailNotify Bundle</title>
		<link rel="alternate" type="text/html" href="https://wiki.open-xchange.com/wiki/index.php?title=OX6:MailNotify_Bundle&amp;diff=7292"/>
		<updated>2011-03-01T12:40:34Z</updated>

		<summary type="html">&lt;p&gt;Shecki: /* Configuration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Open-Xchange Mail Push =&lt;br /&gt;
&lt;br /&gt;
Beginning with the 6.16 release, there&#039;s a new bundle handling external notifications of new mail to send push requests to mobile devices.&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
This Bundle is currently only able to cooperate with the mail notification functionality of cyrus-imapd, but this will change in a way, that future versions will be configurable on what kind of notification protocol is required.&lt;br /&gt;
&lt;br /&gt;
At the moment, this bundle listens on the address and port as configured in &amp;lt;tt&amp;gt;/opt/open-xchange/etc/groupware/push_mailnotify.properties&amp;lt;/tt&amp;gt; accepting UDP datagrams following the format as used in the cyrus notifyd:&lt;br /&gt;
&lt;br /&gt;
 notifyd/notifyd.c:&lt;br /&gt;
 method NUL class NUL priority NUL user NUL mailbox NUL nopt NUL N(option NUL) message NUL&lt;br /&gt;
&lt;br /&gt;
and the only information which is currently being evaluated is the fourth one, the &amp;lt;tt&amp;gt;username&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{InstallPlugin|pluginname=open-xchange-push-mailnotify|sopath=stable}}&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
On the server running cyrus, add the following to &amp;lt;tt&amp;gt;/etc/imapd.conf&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 mailnotifier: log&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;tt&amp;gt;/etc/cyrus.conf&amp;lt;/tt&amp;gt; take care, that cyrus own notifyd is &#039;&#039;&#039;NOT&#039;&#039;&#039; in use. If it is not commented, either do that or remove it completely.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
  # this is only necessary if using notifications&lt;br /&gt;
  #  notify       cmd=&amp;quot;notifyd&amp;quot; listen=&amp;quot;/var/lib/imap/socket/notify&amp;quot; proto=&amp;quot;udp&amp;quot; prefork=1&lt;br /&gt;
&lt;br /&gt;
Install the program &amp;lt;tt&amp;gt;socat&amp;lt;/tt&amp;gt;. Socat is a Multipurpose relay (see http://www.dest-unreach.org/socat/) which must be used to relay the udb datagrams from the unix domain socket to the open-xchange push bundle.&lt;br /&gt;
&lt;br /&gt;
To redirect the notifications to the open-xchange server, socat must be started like this:&lt;br /&gt;
&lt;br /&gt;
 socat -u -4 UNIX-RECV:/var/lib/cyrus/socket/notify,unlink-early,perm-early=777,type=2 \&lt;br /&gt;
          UDP-SENDTO:&amp;lt;YOUROXIP&amp;gt;:&amp;lt;YOURPUSHPORT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please check location of socket, whether path exists and is correct in /etc/cyrus.conf&lt;br /&gt;
&lt;br /&gt;
To debug whether cyrus sends messages, you might want to add debugging to socat:&lt;br /&gt;
&lt;br /&gt;
 socat -d -d -d -D -v -u -4 UNIX-RECV:/var/lib/imap/socket/notify,unlink-early,perm-early=777,type=2 \&lt;br /&gt;
          UDP-SENDTO:&amp;lt;YOUROXIP&amp;gt;:&amp;lt;YOURPUSHPORT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example Initscript for Debian ==&lt;br /&gt;
&lt;br /&gt;
The following initscript can be used to start the socat tunnel on debian.&lt;br /&gt;
A file /etc/default/ox-push can be created to define parameters such as&lt;br /&gt;
DAEMON_ARGS.&lt;br /&gt;
&lt;br /&gt;
After copying the script to /etc/init.d/ox-push do the following:&lt;br /&gt;
&lt;br /&gt;
 $ chmod 755 /etc/init.d/ox-push&lt;br /&gt;
 $ update-rc.d ox-push defaults&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#! /bin/sh&lt;br /&gt;
### BEGIN INIT INFO&lt;br /&gt;
# Provides:          ox-push&lt;br /&gt;
# Required-Start:    $local_fs $remote_fs open-xchange-groupware&lt;br /&gt;
# Required-Stop:     $local_fs $remote_fs&lt;br /&gt;
# Default-Start:     2 3 4 5&lt;br /&gt;
# Default-Stop:      0 1 6&lt;br /&gt;
# Short-Description: UDP Tunnel for Open-Xchange mail push&lt;br /&gt;
# Description:       Tunnel UDP Datagrams from cyrus notify unix socket&lt;br /&gt;
#                    to Open-Xchange Mail Push bundle&lt;br /&gt;
### END INIT INFO&lt;br /&gt;
&lt;br /&gt;
# Do NOT &amp;quot;set -e&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# PATH should only include /usr/* if it runs after the mountnfs.sh script&lt;br /&gt;
PATH=/sbin:/usr/sbin:/bin:/usr/bin&lt;br /&gt;
DESC=&amp;quot;Open-Xchange Push Tunnel&amp;quot;&lt;br /&gt;
NAME=socat&lt;br /&gt;
DAEMON=/usr/bin/$NAME&lt;br /&gt;
DAEMON_ARGS=&amp;quot;-u -4 UNIX-RECV:/var/lib/imap/socket/notify,unlink-early,perm-early=777,type=2 UDP-SENDTO:localhost:23420&amp;quot;&lt;br /&gt;
PIDFILE=/var/run/$NAME.pid&lt;br /&gt;
SCRIPTNAME=/etc/init.d/$NAME&lt;br /&gt;
&lt;br /&gt;
# Exit if the package is not installed&lt;br /&gt;
[ -x &amp;quot;$DAEMON&amp;quot; ] || exit 0&lt;br /&gt;
&lt;br /&gt;
# Read configuration variable file if it is present&lt;br /&gt;
[ -r /etc/default/$NAME ] &amp;amp;&amp;amp; . /etc/default/$NAME&lt;br /&gt;
&lt;br /&gt;
# Load the VERBOSE setting and other rcS variables&lt;br /&gt;
. /lib/init/vars.sh&lt;br /&gt;
&lt;br /&gt;
# Define LSB log_* functions.&lt;br /&gt;
# Depend on lsb-base (&amp;gt;= 3.0-6) to ensure that this file is present.&lt;br /&gt;
. /lib/lsb/init-functions&lt;br /&gt;
&lt;br /&gt;
#&lt;br /&gt;
# Function that starts the daemon/service&lt;br /&gt;
#&lt;br /&gt;
do_start()&lt;br /&gt;
{&lt;br /&gt;
	# Return&lt;br /&gt;
	#   0 if daemon has been started&lt;br /&gt;
	#   1 if daemon was already running&lt;br /&gt;
	#   2 if daemon could not be started&lt;br /&gt;
	start-stop-daemon --start -b --quiet -m --pidfile $PIDFILE --exec $DAEMON --test &amp;gt; /dev/null \&lt;br /&gt;
		|| return 1&lt;br /&gt;
	start-stop-daemon --start -b --quiet -m --pidfile $PIDFILE --exec $DAEMON -- \&lt;br /&gt;
		$DAEMON_ARGS \&lt;br /&gt;
		|| return 2&lt;br /&gt;
	# Add code here, if necessary, that waits for the process to be ready&lt;br /&gt;
	# to handle requests from services started subsequently which depend&lt;br /&gt;
	# on this one.  As a last resort, sleep for some time.&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#&lt;br /&gt;
# Function that stops the daemon/service&lt;br /&gt;
#&lt;br /&gt;
do_stop()&lt;br /&gt;
{&lt;br /&gt;
	# Return&lt;br /&gt;
	#   0 if daemon has been stopped&lt;br /&gt;
	#   1 if daemon was already stopped&lt;br /&gt;
	#   2 if daemon could not be stopped&lt;br /&gt;
	#   other if a failure occurred&lt;br /&gt;
	start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME&lt;br /&gt;
	RETVAL=&amp;quot;$?&amp;quot;&lt;br /&gt;
	[ &amp;quot;$RETVAL&amp;quot; = 2 ] &amp;amp;&amp;amp; return 2&lt;br /&gt;
	# Many daemons don&#039;t delete their pidfiles when they exit.&lt;br /&gt;
	rm -f $PIDFILE&lt;br /&gt;
	return &amp;quot;$RETVAL&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
case &amp;quot;$1&amp;quot; in&lt;br /&gt;
  start)&lt;br /&gt;
	[ &amp;quot;$VERBOSE&amp;quot; != no ] &amp;amp;&amp;amp; log_daemon_msg &amp;quot;Starting $DESC&amp;quot; &amp;quot;$NAME&amp;quot;&lt;br /&gt;
	do_start&lt;br /&gt;
	case &amp;quot;$?&amp;quot; in&lt;br /&gt;
		0|1) [ &amp;quot;$VERBOSE&amp;quot; != no ] &amp;amp;&amp;amp; log_end_msg 0 ;;&lt;br /&gt;
		2) [ &amp;quot;$VERBOSE&amp;quot; != no ] &amp;amp;&amp;amp; log_end_msg 1 ;;&lt;br /&gt;
	esac&lt;br /&gt;
	;;&lt;br /&gt;
  stop)&lt;br /&gt;
	[ &amp;quot;$VERBOSE&amp;quot; != no ] &amp;amp;&amp;amp; log_daemon_msg &amp;quot;Stopping $DESC&amp;quot; &amp;quot;$NAME&amp;quot;&lt;br /&gt;
	do_stop&lt;br /&gt;
	case &amp;quot;$?&amp;quot; in&lt;br /&gt;
		0|1) [ &amp;quot;$VERBOSE&amp;quot; != no ] &amp;amp;&amp;amp; log_end_msg 0 ;;&lt;br /&gt;
		2) [ &amp;quot;$VERBOSE&amp;quot; != no ] &amp;amp;&amp;amp; log_end_msg 1 ;;&lt;br /&gt;
	esac&lt;br /&gt;
	;;&lt;br /&gt;
  restart|force-reload)&lt;br /&gt;
	#&lt;br /&gt;
	# If the &amp;quot;reload&amp;quot; option is implemented then remove the&lt;br /&gt;
	# &#039;force-reload&#039; alias&lt;br /&gt;
	#&lt;br /&gt;
	log_daemon_msg &amp;quot;Restarting $DESC&amp;quot; &amp;quot;$NAME&amp;quot;&lt;br /&gt;
	do_stop&lt;br /&gt;
	case &amp;quot;$?&amp;quot; in&lt;br /&gt;
	  0|1)&lt;br /&gt;
		do_start&lt;br /&gt;
		case &amp;quot;$?&amp;quot; in&lt;br /&gt;
			0) log_end_msg 0 ;;&lt;br /&gt;
			1) log_end_msg 1 ;; # Old process is still running&lt;br /&gt;
			*) log_end_msg 1 ;; # Failed to start&lt;br /&gt;
		esac&lt;br /&gt;
		;;&lt;br /&gt;
	  *)&lt;br /&gt;
	  	# Failed to stop&lt;br /&gt;
		log_end_msg 1&lt;br /&gt;
		;;&lt;br /&gt;
	esac&lt;br /&gt;
	;;&lt;br /&gt;
  *)&lt;br /&gt;
	echo &amp;quot;Usage: $SCRIPTNAME {start|stop|restart|force-reload}&amp;quot; &amp;gt;&amp;amp;2&lt;br /&gt;
	exit 3&lt;br /&gt;
	;;&lt;br /&gt;
esac&lt;br /&gt;
&lt;br /&gt;
:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example Initscript for Redhat/SUSE ==&lt;br /&gt;
&lt;br /&gt;
After copying the script to /etc/init.d/ox-push do the following:&lt;br /&gt;
&lt;br /&gt;
 $ chmod 755 /etc/init.d/ox-push&lt;br /&gt;
&lt;br /&gt;
and on Redhat&lt;br /&gt;
&lt;br /&gt;
 $ chkconfig --level 35 ox-push on&lt;br /&gt;
&lt;br /&gt;
on SUSE&lt;br /&gt;
&lt;br /&gt;
 $ insserv ox-push&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#&lt;br /&gt;
#     LSB system startup script for service/daemon socat tunnel&lt;br /&gt;
#     Based on initscript skeleton.compat as shipped with [open]SUSE.&lt;br /&gt;
#          &lt;br /&gt;
#     This library is free software; you can redistribute it and/or modify it&lt;br /&gt;
#     under the terms of the GNU Lesser General Public License as published by&lt;br /&gt;
#     the Free Software Foundation; either version 2.1 of the License, or (at&lt;br /&gt;
#     your option) any later version.&lt;br /&gt;
#			      &lt;br /&gt;
#     This library is distributed in the hope that it will be useful, but&lt;br /&gt;
#     WITHOUT ANY WARRANTY; without even the implied warranty of&lt;br /&gt;
#     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU&lt;br /&gt;
#     Lesser General Public License for more details.&lt;br /&gt;
#      &lt;br /&gt;
#     You should have received a copy of the GNU Lesser General Public&lt;br /&gt;
#     License along with this library; if not, write to the Free Software&lt;br /&gt;
#     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307,&lt;br /&gt;
#     USA.&lt;br /&gt;
#&lt;br /&gt;
# /etc/init.d/ox-push&lt;br /&gt;
# LSB compatible service control script; see http://www.linuxbase.org/spec/&lt;br /&gt;
# &lt;br /&gt;
# Note: This template uses functions rc_XXX defined in /etc/rc.status on&lt;br /&gt;
# UnitedLinux/SUSE/Novell based Linux distributions. However, it will work&lt;br /&gt;
# on other distributions as well, by using the LSB (Linux Standard Base) &lt;br /&gt;
# or RH functions or by open coding the needed functions.&lt;br /&gt;
# Read http://www.tldp.org/HOWTO/HighQuality-Apps-HOWTO/ if you prefer not &lt;br /&gt;
# to use this template.&lt;br /&gt;
#&lt;br /&gt;
# chkconfig: 345 99 00&lt;br /&gt;
# description: Open Xchange Groupware Daemon&lt;br /&gt;
# &lt;br /&gt;
### BEGIN INIT INFO&lt;br /&gt;
# Provides:          ox-push&lt;br /&gt;
# Required-Start:    $syslog $remote_fs open-xchange-groupware&lt;br /&gt;
# Required-Stop:     $syslog $remote_fs&lt;br /&gt;
# Default-Start:     3 4 5&lt;br /&gt;
# Default-Stop:      0 1 2 6&lt;br /&gt;
# Short-Description: Open Xchange Groupware Daemon&lt;br /&gt;
# Description:       UDP Tunnel for Open-Xchange mail push&lt;br /&gt;
### END INIT INFO&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Note: Special treatment of stop for LSB conformance&lt;br /&gt;
PIDFILE=ox-push.pid&lt;br /&gt;
SOCATBIN=/usr/bin/socat&lt;br /&gt;
SOCATARGS=&amp;quot;-u -4 UNIX-RECV:/var/lib/imap/socket/notify,unlink-early,perm-early=777,type=2 UDP-SENDTO:localhost:23420&amp;quot;&lt;br /&gt;
&lt;br /&gt;
test -x $SOCATBIN || { echo &amp;quot;$SOCATBIN not installed&amp;quot;;&lt;br /&gt;
        if [ &amp;quot;$1&amp;quot; = &amp;quot;stop&amp;quot; ]; then exit 0;&lt;br /&gt;
        else exit 5; fi; }&lt;br /&gt;
&lt;br /&gt;
# Source LSB init functions&lt;br /&gt;
# providing start_daemon, killproc, pidofproc, &lt;br /&gt;
# log_success_msg, log_failure_msg and log_warning_msg.&lt;br /&gt;
# This is currently not used by UnitedLinux based distributions and&lt;br /&gt;
# not needed for init scripts for UnitedLinux only. If it is used,&lt;br /&gt;
# the functions from rc.status should not be sourced or used.&lt;br /&gt;
#. /lib/lsb/init-functions&lt;br /&gt;
&lt;br /&gt;
# Shell functions sourced from /etc/rc.status:&lt;br /&gt;
#      rc_check         check and set local and overall rc status&lt;br /&gt;
#      rc_status        check and set local and overall rc status&lt;br /&gt;
#      rc_status -v     be verbose in local rc status and clear it afterwards&lt;br /&gt;
#      rc_status -v -r  ditto and clear both the local and overall rc status&lt;br /&gt;
#      rc_status -s     display &amp;quot;skipped&amp;quot; and exit with status 3&lt;br /&gt;
#      rc_status -u     display &amp;quot;unused&amp;quot; and exit with status 3&lt;br /&gt;
#      rc_failed        set local and overall rc status to failed&lt;br /&gt;
#      rc_failed &amp;lt;num&amp;gt;  set local and overall rc status to &amp;lt;num&amp;gt;&lt;br /&gt;
#      rc_reset         clear both the local and overall rc status&lt;br /&gt;
#      rc_exit          exit appropriate to overall rc status&lt;br /&gt;
#      rc_active        checks whether a service is activated by symlinks&lt;br /&gt;
&lt;br /&gt;
# Use the SUSE rc_ init script functions;&lt;br /&gt;
# emulate them on LSB, RH and other systems&lt;br /&gt;
&lt;br /&gt;
# Default: Assume sysvinit binaries exist&lt;br /&gt;
start_daemon() { /sbin/start_daemon ${1+&amp;quot;$@&amp;quot;}; }&lt;br /&gt;
killproc()     { /sbin/killproc     ${1+&amp;quot;$@&amp;quot;}; }&lt;br /&gt;
pidofproc()    { /sbin/pidofproc    ${1+&amp;quot;$@&amp;quot;}; }&lt;br /&gt;
checkproc()    { /sbin/checkproc    ${1+&amp;quot;$@&amp;quot;}; }&lt;br /&gt;
if test -e /etc/rc.status; then&lt;br /&gt;
    # SUSE rc script library&lt;br /&gt;
    . /etc/rc.status&lt;br /&gt;
else&lt;br /&gt;
    export LC_ALL=POSIX&lt;br /&gt;
    _cmd=$1&lt;br /&gt;
    declare -a _SMSG&lt;br /&gt;
    if test &amp;quot;${_cmd}&amp;quot; = &amp;quot;status&amp;quot;; then&lt;br /&gt;
	_SMSG=(running dead dead unused unknown reserved)&lt;br /&gt;
	_RC_UNUSED=3&lt;br /&gt;
    else&lt;br /&gt;
	_SMSG=(done failed failed missed failed skipped unused failed failed reserved)&lt;br /&gt;
	_RC_UNUSED=6&lt;br /&gt;
    fi&lt;br /&gt;
    if test -e /lib/lsb/init-functions; then&lt;br /&gt;
	# LSB    &lt;br /&gt;
    	. /lib/lsb/init-functions&lt;br /&gt;
	echo_rc()&lt;br /&gt;
	{&lt;br /&gt;
	    if test ${_RC_RV} = 0; then&lt;br /&gt;
		log_success_msg &amp;quot;  [${_SMSG[${_RC_RV}]}] &amp;quot;&lt;br /&gt;
	    else&lt;br /&gt;
		log_failure_msg &amp;quot;  [${_SMSG[${_RC_RV}]}] &amp;quot;&lt;br /&gt;
	    fi&lt;br /&gt;
	}&lt;br /&gt;
	# TODO: Add checking for lockfiles&lt;br /&gt;
	checkproc() { return pidofproc ${1+&amp;quot;$@&amp;quot;} &amp;gt;/dev/null 2&amp;gt;&amp;amp;1; }&lt;br /&gt;
    elif test -e /etc/init.d/functions; then&lt;br /&gt;
	# RHAT&lt;br /&gt;
	. /etc/init.d/functions&lt;br /&gt;
	echo_rc()&lt;br /&gt;
	{&lt;br /&gt;
	    #echo -n &amp;quot;  [${_SMSG[${_RC_RV}]}] &amp;quot;&lt;br /&gt;
	    if test ${_RC_RV} = 0; then&lt;br /&gt;
		success &amp;quot;  [${_SMSG[${_RC_RV}]}] &amp;quot;&lt;br /&gt;
	    else&lt;br /&gt;
		failure &amp;quot;  [${_SMSG[${_RC_RV}]}] &amp;quot;&lt;br /&gt;
	    fi&lt;br /&gt;
	}&lt;br /&gt;
	checkproc() { return status ${1+&amp;quot;$@&amp;quot;}; }&lt;br /&gt;
	start_daemon() { return daemon ${1+&amp;quot;$@&amp;quot;}; }&lt;br /&gt;
    else&lt;br /&gt;
	# emulate it&lt;br /&gt;
	echo_rc() { echo &amp;quot;  [${_SMSG[${_RC_RV}]}] &amp;quot;; }&lt;br /&gt;
    fi&lt;br /&gt;
    rc_reset() { _RC_RV=0; }&lt;br /&gt;
    rc_failed()&lt;br /&gt;
    {&lt;br /&gt;
	if test -z &amp;quot;$1&amp;quot;; then &lt;br /&gt;
	    _RC_RV=1;&lt;br /&gt;
	elif test &amp;quot;$1&amp;quot; != &amp;quot;0&amp;quot;; then &lt;br /&gt;
	    _RC_RV=$1; &lt;br /&gt;
    	fi&lt;br /&gt;
	return ${_RC_RV}&lt;br /&gt;
    }&lt;br /&gt;
    rc_check()&lt;br /&gt;
    {&lt;br /&gt;
	return rc_failed $?&lt;br /&gt;
    }	&lt;br /&gt;
    rc_status()&lt;br /&gt;
    {&lt;br /&gt;
	rc_failed $?&lt;br /&gt;
	if test &amp;quot;$1&amp;quot; = &amp;quot;-r&amp;quot;; then _RC_RV=0; shift; fi&lt;br /&gt;
	if test &amp;quot;$1&amp;quot; = &amp;quot;-s&amp;quot;; then rc_failed 5; echo_rc; rc_failed 3; shift; fi&lt;br /&gt;
	if test &amp;quot;$1&amp;quot; = &amp;quot;-u&amp;quot;; then rc_failed ${_RC_UNUSED}; echo_rc; rc_failed 3; shift; fi&lt;br /&gt;
	if test &amp;quot;$1&amp;quot; = &amp;quot;-v&amp;quot;; then echo_rc; shift; fi&lt;br /&gt;
	if test &amp;quot;$1&amp;quot; = &amp;quot;-r&amp;quot;; then _RC_RV=0; shift; fi&lt;br /&gt;
	return ${_RC_RV}&lt;br /&gt;
    }&lt;br /&gt;
    rc_exit() { exit ${_RC_RV}; }&lt;br /&gt;
    rc_active() &lt;br /&gt;
    {&lt;br /&gt;
	if test -z &amp;quot;$RUNLEVEL&amp;quot;; then read RUNLEVEL REST &amp;lt; &amp;lt;(/sbin/runlevel); fi&lt;br /&gt;
	if test -e /etc/init.d/S[0-9][0-9]${1}; then return 0; fi&lt;br /&gt;
	return 1&lt;br /&gt;
    }&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Reset status of this service&lt;br /&gt;
rc_reset&lt;br /&gt;
&lt;br /&gt;
# Return values acc. to LSB for all commands but status:&lt;br /&gt;
# 0	  - success&lt;br /&gt;
# 1       - generic or unspecified error&lt;br /&gt;
# 2       - invalid or excess argument(s)&lt;br /&gt;
# 3       - unimplemented feature (e.g. &amp;quot;reload&amp;quot;)&lt;br /&gt;
# 4       - user had insufficient privileges&lt;br /&gt;
# 5       - program is not installed&lt;br /&gt;
# 6       - program is not configured&lt;br /&gt;
# 7       - program is not running&lt;br /&gt;
# 8--199  - reserved (8--99 LSB, 100--149 distrib, 150--199 appl)&lt;br /&gt;
# &lt;br /&gt;
# Note that starting an already running service, stopping&lt;br /&gt;
# or restarting a not-running service as well as the restart&lt;br /&gt;
# with force-reload (in case signaling is not supported) are&lt;br /&gt;
# considered a success.&lt;br /&gt;
&lt;br /&gt;
tstatus() {&lt;br /&gt;
    if [ ! -f /var/run/$PIDFILE ]; then&lt;br /&gt;
        return 3&lt;br /&gt;
    else&lt;br /&gt;
        read PID &amp;lt; /var/run/$PIDFILE&lt;br /&gt;
        test -z &amp;quot;$PID&amp;quot; &amp;amp;&amp;amp; { echo &amp;quot;unable to read pid&amp;quot;; return 3; }&lt;br /&gt;
        if ! ps $PID &amp;gt; /dev/null; then&lt;br /&gt;
                return 3&lt;br /&gt;
        fi&lt;br /&gt;
    fi&lt;br /&gt;
    return 0&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
case &amp;quot;$1&amp;quot; in&lt;br /&gt;
    start)&lt;br /&gt;
	echo -n &amp;quot;Starting ox push &amp;quot;&lt;br /&gt;
	## Start daemon with startproc(8). If this fails&lt;br /&gt;
	## the return value is set appropriately by startproc.&lt;br /&gt;
	$SOCATBIN $SOCATARGS 2&amp;gt;&amp;amp;1 &amp;amp; echo $! &amp;gt; /var/run/$PIDFILE&lt;br /&gt;
&lt;br /&gt;
	# Remember status and be verbose&lt;br /&gt;
	rc_status -v&lt;br /&gt;
	;;&lt;br /&gt;
    stop)&lt;br /&gt;
	echo -n &amp;quot;Shutting down ox push &amp;quot;&lt;br /&gt;
	## Stop daemon with killproc(8) and if this fails&lt;br /&gt;
	## killproc sets the return value according to LSB.&lt;br /&gt;
&lt;br /&gt;
	if [ ! -f /var/run/$PIDFILE ]; then&lt;br /&gt;
		echo &amp;quot;service not running&amp;quot;&lt;br /&gt;
	else&lt;br /&gt;
		read PID &amp;lt; /var/run/$PIDFILE&lt;br /&gt;
		test -z &amp;quot;$PID&amp;quot; &amp;amp;&amp;amp; { echo &amp;quot;unable to read pid&amp;quot;; exit 1; }&lt;br /&gt;
		if ! ps $PID &amp;gt; /dev/null; then&lt;br /&gt;
			echo &amp;quot;service not running&amp;quot;&lt;br /&gt;
		else&lt;br /&gt;
			kill -TERM $PID&lt;br /&gt;
		fi&lt;br /&gt;
	fi&lt;br /&gt;
&lt;br /&gt;
	# Remember status and be verbose&lt;br /&gt;
	rc_status -v&lt;br /&gt;
	;;&lt;br /&gt;
    try-restart|condrestart)&lt;br /&gt;
	## Do a restart only if the service was active before.&lt;br /&gt;
	## Note: try-restart is now part of LSB (as of 1.9).&lt;br /&gt;
	## RH has a similar command named condrestart.&lt;br /&gt;
	if test &amp;quot;$1&amp;quot; = &amp;quot;condrestart&amp;quot;; then&lt;br /&gt;
		echo &amp;quot;${attn} Use try-restart ${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}&amp;quot;&lt;br /&gt;
	fi&lt;br /&gt;
	$0 status&lt;br /&gt;
	if test $? = 0; then&lt;br /&gt;
		$0 restart&lt;br /&gt;
	else&lt;br /&gt;
		rc_reset	# Not running is not a failure.&lt;br /&gt;
	fi&lt;br /&gt;
	# Remember status and be quiet&lt;br /&gt;
	rc_status&lt;br /&gt;
	;;&lt;br /&gt;
    restart)&lt;br /&gt;
	## Stop the service and regardless of whether it was&lt;br /&gt;
	## running or not, start it again.&lt;br /&gt;
	$0 stop&lt;br /&gt;
	$0 start&lt;br /&gt;
&lt;br /&gt;
	# Remember status and be quiet&lt;br /&gt;
	rc_status&lt;br /&gt;
	;;&lt;br /&gt;
    force-reload)&lt;br /&gt;
	## Signal the daemon to reload its config. Most daemons&lt;br /&gt;
	## do this on signal 1 (SIGHUP).&lt;br /&gt;
	## If it does not support it, restart the service if it&lt;br /&gt;
	## is running.&lt;br /&gt;
&lt;br /&gt;
	echo -n &amp;quot;Reload ox push &amp;quot;&lt;br /&gt;
	## if it supports it:&lt;br /&gt;
	#killproc -p $PIDFILE -HUP $OX_BIN&lt;br /&gt;
	#touch /var/run/FOO.pid&lt;br /&gt;
	#rc_status -v&lt;br /&gt;
&lt;br /&gt;
	## Otherwise:&lt;br /&gt;
	$0 try-restart&lt;br /&gt;
	rc_status&lt;br /&gt;
	;;&lt;br /&gt;
    reload)&lt;br /&gt;
	## Like force-reload, but if daemon does not support&lt;br /&gt;
	## signaling, do nothing (!)&lt;br /&gt;
&lt;br /&gt;
	# If it supports signaling:&lt;br /&gt;
	echo -n &amp;quot;Reload ox push &amp;quot;&lt;br /&gt;
	#killproc -p $PIDFILE -HUP $OX_BIN&lt;br /&gt;
	#touch /var/run/FOO.pid&lt;br /&gt;
	#rc_status -v&lt;br /&gt;
	&lt;br /&gt;
	## Otherwise if it does not support reload:&lt;br /&gt;
	rc_failed 3&lt;br /&gt;
	rc_status -v&lt;br /&gt;
	;;&lt;br /&gt;
    status)&lt;br /&gt;
	echo -n &amp;quot;Checking for ox push &amp;quot;&lt;br /&gt;
	## Check status with checkproc(8), if process is running&lt;br /&gt;
	## checkproc will return with exit status 0.&lt;br /&gt;
&lt;br /&gt;
	# Return value is slightly different for the status command:&lt;br /&gt;
	# 0 - service up and running&lt;br /&gt;
	# 1 - service dead, but /var/run/  pid  file exists&lt;br /&gt;
	# 2 - service dead, but /var/lock/ lock file exists&lt;br /&gt;
	# 3 - service not running (unused)&lt;br /&gt;
	# 4 - service status unknown :-(&lt;br /&gt;
	# 5--199 reserved (5--99 LSB, 100--149 distro, 150--199 appl.)&lt;br /&gt;
	&lt;br /&gt;
	# NOTE: checkproc returns LSB compliant status values.&lt;br /&gt;
	tstatus&lt;br /&gt;
	# NOTE: rc_status knows that we called this init script with&lt;br /&gt;
	# &amp;quot;status&amp;quot; option and adapts its messages accordingly.&lt;br /&gt;
	rc_status -v&lt;br /&gt;
	;;&lt;br /&gt;
    *)&lt;br /&gt;
	echo &amp;quot;Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|}&amp;quot;&lt;br /&gt;
	exit 1&lt;br /&gt;
	;;&lt;br /&gt;
esac&lt;br /&gt;
rc_exit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Shecki</name></author>
	</entry>
</feed>