Index: npl/mailserver/zarafa7/Datux-sendas.patch
===================================================================
--- npl/mailserver/zarafa7/Datux-sendas.patch	(revision c5c522c7ca74a4c1725ca5e3fe0bdcadff80e49a)
+++ npl/mailserver/zarafa7/Datux-sendas.patch	(revision c5c522c7ca74a4c1725ca5e3fe0bdcadff80e49a)
@@ -0,0 +1,25 @@
+diff -u -r zarafa-6.40.3/spooler/Spooler.cpp zarafa-6.40.3.new/spooler/Spooler.cpp
+--- zarafa-6.40.3/spooler/Spooler.cpp	2010-10-20 14:16:24.000000000 +0000
++++ zarafa-6.40.3.new/spooler/Spooler.cpp	2010-11-10 15:58:43.000000000 +0000
+@@ -935,6 +935,7 @@
+ 		{ "fax_domain", "", CONFIGSETTING_RELOADABLE },
+ 		{ "fax_international", "+", CONFIGSETTING_RELOADABLE },
+ 		{ "always_send_delegates", "no", CONFIGSETTING_RELOADABLE },
++		{ "always_send_as", "no", CONFIGSETTING_RELOADABLE },
+ 		{ "always_send_tnef", "no", CONFIGSETTING_RELOADABLE },
+ 		{ "allow_redirect_spoofing", "yes", CONFIGSETTING_RELOADABLE },
+ 		{ "allow_delegate_meeting_request", "yes", CONFIGSETTING_RELOADABLE },
+diff -u -r zarafa-6.40.3/spooler/mailer.cpp zarafa-6.40.3.new/spooler/mailer.cpp
+--- zarafa-6.40.3/spooler/mailer.cpp	2010-10-20 14:16:24.000000000 +0000
++++ zarafa-6.40.3.new/spooler/mailer.cpp	2010-11-10 15:58:09.000000000 +0000
+@@ -1949,6 +1949,10 @@
+ 			HrGetOneProp(lpMessage, PR_AUTO_FORWARDED, &lpAutoForward) == hrSuccess && lpAutoForward->Value.b)
+ 		{
+ 			bAllowSendAs = true;
++		} else if (strcmp(g_lpConfig->GetSetting("always_send_as"), "yes") == 0) {
++			//use alawys_send_as to allow everybody to send as someone else. 
++			//(some users hate the 'on behalf of' text, and dont want to do the extra configuration)
++			bAllowSendAs = true;
+ 		} else {
+ 
+ 			hr = HrGetOneProp(lpUserStore, PR_MAILBOX_OWNER_ENTRYID, &lpPropOwner);
Index: npl/mailserver/zarafa7/Datux-spamhook.patch
===================================================================
--- npl/mailserver/zarafa7/Datux-spamhook.patch	(revision c5c522c7ca74a4c1725ca5e3fe0bdcadff80e49a)
+++ npl/mailserver/zarafa7/Datux-spamhook.patch	(revision c5c522c7ca74a4c1725ca5e3fe0bdcadff80e49a)
@@ -0,0 +1,219 @@
+diff -ru zarafa-7.1.4/provider/libserver/ZarafaCmd.cpp zarafa-7.1.4.spamhook/provider/libserver/ZarafaCmd.cpp
+--- zarafa-7.1.4/provider/libserver/ZarafaCmd.cpp	2013-02-28 17:13:17.000000000 +0100
++++ zarafa-7.1.4.spamhook/provider/libserver/ZarafaCmd.cpp	2013-04-15 11:34:45.018632455 +0200
+@@ -84,6 +84,7 @@
+ #include "StreamUtil.h"
+ #include "CommonUtil.h"
+ #include "StorageUtil.h"
++#include "UnixUtil.h"
+ 
+ #include "ZarafaICS.h"
+ 
+@@ -7655,6 +7656,179 @@
+ 	bool		 bMoved;
+ }COPYITEM;
+ 
++//SPAM HOOK
++//This function parses an e-mail to the /etc/zarafa/userscripts/junklearn script. With 2 arguments:
++//ham or spam
++//message id
++//and pipes the mail header to the script.
++//This script wil be inhaled by MoveObjects();
++/////////////////////////////////////////////////////////////////////////////////////////////////
++int SpamHook(ECDatabase *lpDatabase,int ulId, unsigned int ulDestFolderId)
++{
++
++		ALLOC_DBRESULT();
++		ECRESULT er = erSuccess;
++		std::string shScriptPath = g_lpSessionManager->GetConfig()->GetSetting("junklearn_script");
++		string shMailStatus;
++		entryId* junkFolderEntryId;
++		entryId* wasteBucketEntryId;
++		int shNumRows;
++
++		//dont do anything if the junklearn script doesnt exist:
++		int fCheck=open(shScriptPath.c_str(), O_RDONLY);
++		if (fCheck==0) {
++			g_lpSessionManager->GetLogger()->Log(EC_LOGLEVEL_INFO,"SpamHook: skipping, script "+shScriptPath+" not found");
++			er=erSuccess;
++			goto exit;
++		}
++		close(fCheck);
++
++		//Get store object ID via message object id
++		unsigned int storeId;
++		er = g_lpSessionManager->GetCacheManager()->GetStore(ulId,&storeId,NULL);
++		if(er != erSuccess) 
++		{
++			g_lpSessionManager->GetLogger()->Log(EC_LOGLEVEL_WARNING,"SpamHook: error while retrieve source folder.");
++			goto exit;
++		}
++
++		//get deleted items folder entry id
++		strQuery="SELECT val_binary FROM properties WHERE hierarchyid="+stringify(storeId)+" AND tag="+stringify(PROP_ID(PR_IPM_WASTEBASKET_ENTRYID));
++		er = lpDatabase->DoSelect(strQuery, &lpDBResult);
++		if(er != erSuccess) {
++			g_lpSessionManager->GetLogger()->Log(EC_LOGLEVEL_WARNING,"SpamHook: error while retrieve wastebasket entryid from DB.");
++			goto exit;
++		}
++		lpDBRow = lpDatabase->FetchRow(lpDBResult);
++		lpDBLen = lpDatabase->FetchRowLengths(lpDBResult);
++		shNumRows=lpDatabase->GetNumRows(lpDBResult);
++		if(shNumRows<1)
++		{
++			g_lpSessionManager->GetLogger()->Log(EC_LOGLEVEL_WARNING,"SpamHook: error while retrieve wastebasket entryid, empty DB result.");
++			goto exit;
++		}
++
++		//Convert 'deleted items' entryid to objectid.
++		wasteBucketEntryId = new entryId[0];
++		wasteBucketEntryId->__ptr=(unsigned char*)lpDBRow[0];
++		wasteBucketEntryId->__size=lpDBLen[0];
++		unsigned int wasteBucketFolderId;
++		er=g_lpSessionManager->GetCacheManager()->GetObjectFromEntryId(wasteBucketEntryId,&wasteBucketFolderId);
++		delete wasteBucketEntryId;
++		if(er!=erSuccess)
++		{
++			g_lpSessionManager->GetLogger()->Log(EC_LOGLEVEL_WARNING,"SpamHook: error while retrieve wastebasket entryid, converting to objectID.");
++			goto exit;
++		}
++
++		//Get 'junk folder' entryId.
++		FREE_DBRESULT();
++		strQuery="SELECT val_binary  FROM receivefolder LEFT JOIN mvproperties ON receivefolder.objid=mvproperties.hierarchyid WHERE receivefolder.storeid="+stringify(storeId)+" AND receivefolder.messageclass='IPC' AND mvproperties.tag="+stringify(PROP_ID(PR_ADDITIONAL_REN_ENTRYIDS))+" AND mvproperties.orderid=4";
++		er = lpDatabase->DoSelect(strQuery, &lpDBResult);
++		if(er != erSuccess) {
++			g_lpSessionManager->GetLogger()->Log(EC_LOGLEVEL_WARNING,"SpamHook: error while retrieve junkfolder entryids from DB.");
++			goto exit;
++		}
++		lpDBRow = lpDatabase->FetchRow(lpDBResult);
++		lpDBLen = lpDatabase->FetchRowLengths(lpDBResult);
++		shNumRows=lpDatabase->GetNumRows(lpDBResult);
++		if(shNumRows<1)
++		{
++			g_lpSessionManager->GetLogger()->Log(EC_LOGLEVEL_WARNING,"SpamHook: error while retrieve junkfolder entryid, empty DB result.");
++			goto exit;
++		}
++
++		//Convert 'junk folder' entryid to objectid.
++		junkFolderEntryId = new entryId[0];
++		junkFolderEntryId->__ptr=(unsigned char*)lpDBRow[0];
++		junkFolderEntryId->__size=lpDBLen[0];
++		unsigned int junkFolderId;
++		er=g_lpSessionManager->GetCacheManager()->GetObjectFromEntryId(junkFolderEntryId,&junkFolderId);
++		delete junkFolderEntryId;
++		if(er!=erSuccess)
++		{
++			g_lpSessionManager->GetLogger()->Log(EC_LOGLEVEL_WARNING,"SpamHook: error while retrieve junkfolder entryid, converting to objectID.");
++			goto exit;
++		}
++			
++		//Get source folder object ID. (Actually we should check if mail came from subfolders in the 'deleted items folder', which I think never happens.)
++		unsigned int srcFolderId;
++		er=g_lpSessionManager->GetCacheManager()->GetParent(ulId,&srcFolderId);
++		if(er!=erSuccess)
++		{
++			g_lpSessionManager->GetLogger()->Log(EC_LOGLEVEL_WARNING,"SpamHook: error while retrieve src folder id.");
++			goto exit;
++		}
++
++		//now we can determine if object being moved from or to the junkfolder
++		//if destination folder is junk, mark as spam
++		if(ulDestFolderId==junkFolderId)
++  			shMailStatus="spam";
++		else
++		{
++			//if destination folder is not TRASH and de source folder is JUNK, mark as ham
++			if(ulDestFolderId!=wasteBucketFolderId  &&  srcFolderId==junkFolderId)
++				shMailStatus="ham";
++			else
++				//its just a normal movement, so do nothing.
++				goto exit;
++		}
++
++		//Get the mail from the DB.
++		FREE_DBRESULT();
++		strQuery="SELECT val_string FROM properties WHERE tag="+stringify(PROP_ID(PR_TRANSPORT_MESSAGE_HEADERS))+" AND hierarchyid= "+stringify(ulId);
++		er = lpDatabase->DoSelect(strQuery, &lpDBResult);
++		if(er != erSuccess) {
++			g_lpSessionManager->GetLogger()->Log(EC_LOGLEVEL_WARNING,"SpamHook: db error while retrieve mail header.");
++			goto exit;
++		}
++
++		lpDBRow = lpDatabase->FetchRow(lpDBResult);
++		shNumRows=lpDatabase->GetNumRows(lpDBResult);
++
++		if(shNumRows<=0) {
++			g_lpSessionManager->GetLogger()->Log(EC_LOGLEVEL_WARNING,"SpamHook: warning mail header empty or this object is no e-mail");
++			goto exit;
++		}
++
++		{
++			//now its time to open the spamhook script and pass the mail to it:
++			shScriptPath=shScriptPath+" "+shMailStatus+" "+stringify(ulId);
++			int ulFpWrite = -1;
++			int ulFpRead = -1;
++			int ulCommandRetval;
++
++			//we asume failure, unless we make it all the way though the script
++			er=ZARAFA_E_UNKNOWN;
++
++			pid_t ulCommandPid = unix_popen_rw(g_lpSessionManager->GetLogger(), shScriptPath.c_str(), &ulFpWrite, &ulFpRead, NULL, NULL, true, false);
++			if (ulCommandPid <= 0) {
++				g_lpSessionManager->GetLogger()->Log(EC_LOGLEVEL_WARNING,"SpamHook: error opening subprocess.");
++				goto exit;
++			}
++
++			//pass the data to the subprocess:
++			write(ulFpWrite, lpDBRow[0], strlen(lpDBRow[0]));
++			ulCommandRetval=unix_pclose(ulFpRead, ulFpWrite, ulCommandPid);
++
++			//subprocess is done, check results
++			if (ulCommandRetval<0) {
++				g_lpSessionManager->GetLogger()->Log(EC_LOGLEVEL_WARNING,"SpamHook: error "+shScriptPath+" exits with: "+stringify(WEXITSTATUS(ulCommandRetval)));
++				goto exit;
++			}
++		}
++
++		g_lpSessionManager->GetLogger()->Log(EC_LOGLEVEL_INFO,"SpamHook:  "+shScriptPath+" successfully executed.");
++		er=erSuccess;
++
++	exit:
++		// Free database results
++		FREE_DBRESULT();
++
++		return er;
++}
++
++
+ // Move one or more messages and/or moved a softdeleted message to a normal message
+ ECRESULT MoveObjects(ECSession *lpSession, ECDatabase *lpDatabase, ECListInt* lplObjectIds, unsigned int ulDestFolderId, unsigned int ulSyncId)
+ {
+@@ -8641,6 +8815,16 @@
+ 
+ 	// @note The object type checking wille be done in MoveObjects or CopyObject
+ 
++//SPAMHOOK
++/////////////////////////////////////
++        //Iterate over all mail ids and initiate spamhook.
++	for(iObjectId = lObjectIds.begin(); iObjectId != lObjectIds.end(); iObjectId++)
++	{
++		SpamHook(lpDatabase,*iObjectId,ulDestFolderId);
++	}
++//SPAMHOOK END
++////////////////////////////////////
++	
+ 	//check copy or a move
+ 	if(ulFlags & FOLDER_MOVE ) { // A move
+ 		er = MoveObjects(lpecSession, lpDatabase, &lObjectIds, ulDestFolderId, ulSyncId);
+diff -ru zarafa-7.1.4/provider/server/ECServer.cpp zarafa-7.1.4.spamhook/provider/server/ECServer.cpp
+--- zarafa-7.1.4/provider/server/ECServer.cpp	2013-02-28 17:13:17.000000000 +0100
++++ zarafa-7.1.4.spamhook/provider/server/ECServer.cpp	2013-04-15 11:14:40.000000000 +0200
+@@ -963,6 +963,7 @@
+ 		{ "deletegroup_script",			"/etc/zarafa/userscripts/deletegroup", CONFIGSETTING_RELOADABLE},
+ 		{ "createcompany_script",		"/etc/zarafa/userscripts/createcompany", CONFIGSETTING_RELOADABLE },
+ 		{ "deletecompany_script",		"/etc/zarafa/userscripts/deletecompany", CONFIGSETTING_RELOADABLE },
++		{ "junklearn_script",                   "/etc/zarafa/userscripts/junklearn", CONFIGSETTING_RELOADABLE },
+ 		{ "user_safe_mode",				"no", CONFIGSETTING_RELOADABLE },
+ 
+ 		// Storename format
Index: npl/mailserver/zarafa7/post.zarafa
===================================================================
--- npl/mailserver/zarafa7/post.zarafa	(revision c5c522c7ca74a4c1725ca5e3fe0bdcadff80e49a)
+++ npl/mailserver/zarafa7/post.zarafa	(revision c5c522c7ca74a4c1725ca5e3fe0bdcadff80e49a)
@@ -0,0 +1,20 @@
+# ATTENTION: Put all configuration and upgrade stuff in zarafa_conf please!
+
+#restart apache to activate php mapi extention
+svcrestart /service/apache2
+
+#restart all zarafa modules, in the right order
+svcstop /service/zarafa-gateway
+svcstop /service/zarafa-ical
+svcstop /service/zarafa-monitor
+svcstop /service/zarafa-spooler
+svcstop /service/zarafa-search
+svcrestart /service/zarafa-server
+svcreset /service/zarafa-gateway
+svcreset /service/zarafa-ical
+svcreset /service/zarafa-monitor
+svcreset /service/zarafa-spooler
+svcreset /service/zarafa-search
+
+exit 0
+
Index: npl/mailserver/zarafa7/zarafa-archiver-license-build-depenceny.patch
===================================================================
--- npl/mailserver/zarafa7/zarafa-archiver-license-build-depenceny.patch	(revision c5c522c7ca74a4c1725ca5e3fe0bdcadff80e49a)
+++ npl/mailserver/zarafa7/zarafa-archiver-license-build-depenceny.patch	(revision c5c522c7ca74a4c1725ca5e3fe0bdcadff80e49a)
@@ -0,0 +1,101 @@
+diff -u -r zarafa-7.1.12/ECtools/zarafa-archiver/ArchiverSession.cpp zarafa-7.1.12-licensepatch/ECtools/zarafa-archiver/ArchiverSession.cpp
+--- zarafa-7.1.12/ECtools/zarafa-archiver/ArchiverSession.cpp	2015-05-08 13:09:04.000000000 +0000
++++ zarafa-7.1.12-licensepatch/ECtools/zarafa-archiver/ArchiverSession.cpp	2015-06-04 13:25:20.000000000 +0000
+@@ -50,8 +50,8 @@
+ #include "mapiext.h"
+ #include "userutil.h"
+ #include "ECMsgStore.h"
+-#include "ECLicense.h"
+-#include "ECMAPILicense.h"
++//#include "ECLicense.h"
++//#include "ECMAPILicense.h"
+ 
+ typedef mapi_memory_ptr<ECSERVERLIST> ECServerListPtr;
+ 
+@@ -879,60 +879,5 @@
+ typedef mapi_object_ptr<ECMsgStore, IID_ECMsgStore>	ECMsgStorePtr;
+ 
+ HRESULT ArchiverSession::ValidateArchiverLicense(bool attachnewuser /* = false*/) const {
+-	IMsgStore *lpMsgStore = NULL;
+-	IMsgStore *lpProxedMsgStore = NULL;
+-	UnknownPtr ptrUnknown;
+-	ECMsgStorePtr ptrOnlineStore;
+-
+-	HRESULT hr = HrOpenDefaultStore(GetMAPISession(), MDB_WRITE | MDB_NO_DIALOG | MDB_NO_MAIL | MDB_TEMPORARY, &lpMsgStore);
+-	if (hr != hrSuccess)
+-		goto exit;
+-
+-	hr = GetProxyStoreObject(lpMsgStore, &lpProxedMsgStore);
+-	if (hr != hrSuccess)
+-		goto exit;
+-
+-	hr = lpProxedMsgStore->QueryInterface(IID_ECMsgStoreOnline, &ptrUnknown);
+-	if (hr != hrSuccess)
+-		goto exit;
+-
+-	hr = ptrUnknown->QueryInterface(IID_ECMsgStore, &ptrOnlineStore);
+-	if (hr != hrSuccess) {
+-		m_lpLogger->Log(EC_LOGLEVEL_FATAL, "Unable to validate archived user count. Please check the archiver and licensed log for errors.");
+-		hr = MAPI_E_NO_SUPPORT;
+-		goto exit;
+-	}
+-
+-	hr = HrCheckLicense(&ptrOnlineStore->m_xMsgStore, SERVICE_TYPE_ARCHIVE, ZARAFA_ARCHIVE_DEFAULT);
+-	if (hr != hrSuccess)
+-	{
+-		m_lpLogger->Log(EC_LOGLEVEL_FATAL, "No archiver license found.");
+-		hr = MAPI_E_NO_SUPPORT;
+-	}
+-	else
+-	{
+-		unsigned int ulArchivedUsers = 0;
+-		unsigned int ulMaxUsers = 0;
+-
+-		hr = ValidateArchivedUserCount(m_lpLogger, this->GetMAPISession(), this->GetSSLPath(), this->GetSSLPass(), &ulArchivedUsers, &ulMaxUsers);
+-		if (FAILED(hr)) {
+-			m_lpLogger->Log(EC_LOGLEVEL_FATAL, "Unable to validate archived user count. Please check the archiver and licensed log for errors.");
+-			goto exit;
+-		}
+-
+-		if (ulMaxUsers == 0) {
+-			m_lpLogger->Log(EC_LOGLEVEL_INFO, "Not all commercial features will be available.");
+-			// continue!
+-		} else if (ulArchivedUsers >= ulMaxUsers) {
+-			m_lpLogger->Log(EC_LOGLEVEL_FATAL, "You are over your archived user limit of %d users. Please remove an archived user relation or obtain an additional cal.", ulMaxUsers);
+-			m_lpLogger->Log(EC_LOGLEVEL_FATAL, "Licensed extended archive features will be disabled until the archived user limit is decreased.");
+-			hr = MAPI_E_NOT_FOUND; //@todo which error ?
+-			goto exit;
+-		} else if (ulArchivedUsers + 5 >= ulMaxUsers) { //@todo which warning limit?
+-			m_lpLogger->Log(EC_LOGLEVEL_FATAL, "You almost reached the archived user limit. Archived users %d of %d", ulArchivedUsers, ulMaxUsers);
+-		}
+-	}
+-
+-exit:
+-	return hr;
++	return hrSuccess; 
+ }
+diff -u -r zarafa-7.1.12/ECtools/zarafa-archiver/Makefile.in zarafa-7.1.12-licensepatch/ECtools/zarafa-archiver/Makefile.in
+--- zarafa-7.1.12/ECtools/zarafa-archiver/Makefile.in	2015-05-08 12:21:08.000000000 +0000
++++ zarafa-7.1.12-licensepatch/ECtools/zarafa-archiver/Makefile.in	2015-06-04 13:30:02.000000000 +0000
+@@ -112,9 +112,7 @@
+ libarchiver_la_DEPENDENCIES =  \
+ 	${top_builddir}/mapi4linux/src/libmapi.la \
+ 	${top_builddir}/common/libcommon_mapi.la \
+-	${top_builddir}/common/libcommon_util.la \
+-	${top_builddir}/liblicense/liblicense.la \
+-	${top_builddir}/liblicense/liblicense_mapi.la
++	${top_builddir}/common/libcommon_util.la 
+ am_libarchiver_la_OBJECTS = ArchiverSession.lo archiver-common.lo \
+ 	ArchiveManageImpl.lo ArchiveStateCollector.lo \
+ 	ArchiveStateUpdater.lo ArchiveHelper.lo StoreHelper.lo \
+@@ -403,9 +401,7 @@
+ 
+ libarchiver_la_LIBADD = ${top_builddir}/mapi4linux/src/libmapi.la \
+ 	${top_builddir}/common/libcommon_mapi.la \
+-	${top_builddir}/common/libcommon_util.la \
+-	${top_builddir}/liblicense/liblicense.la \
+-	${top_builddir}/liblicense/liblicense_mapi.la
++	${top_builddir}/common/libcommon_util.la 
+ 
+ libarchiver_la_SOURCES = \
+ 	ArchiverSession.cpp ArchiverSession.h ArchiverSessionPtr.h \
Index: npl/mailserver/zarafa7/zarafa/webportal.desc
===================================================================
--- npl/mailserver/zarafa7/zarafa/webportal.desc	(revision c5c522c7ca74a4c1725ca5e3fe0bdcadff80e49a)
+++ npl/mailserver/zarafa7/zarafa/webportal.desc	(revision c5c522c7ca74a4c1725ca5e3fe0bdcadff80e49a)
@@ -0,0 +1,1 @@
+Zarafa
Index: npl/mailserver/zarafa7/zarafa7.SlackBuild
===================================================================
--- npl/mailserver/zarafa7/zarafa7.SlackBuild	(revision c5c522c7ca74a4c1725ca5e3fe0bdcadff80e49a)
+++ npl/mailserver/zarafa7/zarafa7.SlackBuild	(revision c5c522c7ca74a4c1725ca5e3fe0bdcadff80e49a)
@@ -0,0 +1,206 @@
+#!/bin/bash
+
+
+#DEP:php5
+#DEP:libvmime
+#DEP:libical
+##DEP:clucene
+##DEP:google_perftools
+#DEP:util_linux
+#DEP:e2fsprogs
+#DEP:boost
+##DEP:kyotocabinet
+#DEP:icu4c
+#DEP:python
+#DEP:mysql56
+#DEP:gsoap
+#DEP:swig
+#DEP:openssl
+#DEP:mit_kerberos
+#NEED:linuxdoc_tools
+#NEED:libxslt
+#DEP:openldap
+#DEP:ncurses
+#DEP:zlib
+#DEP:libxml2
+#DEP:curl
+#DEP:Linux_PAM
+#DEP:cyrus_sasl
+
+#Download from:
+#http://download.zarafa.com/community/final/7.1/7.1.7-42779/sourcecode/zcp-7.1.7.tar.gz
+
+#######Essential package info.
+#Change these if autodetection fails.
+
+#Name of the Syn-3 package that we are going to create
+NAME=`basename $0|sed 's/.SlackBuild//'`
+
+#Archive of the sourcefiles to unpack 
+SRC_ARC=`ls *.tar.*`
+#SRC_ARC="zarafa-6.20.6"
+
+#Version of the sourcefiles
+VER=`echo $SRC_ARC| sed 's/.*-//g' | sed 's/\.tar\..*$//g'`
+
+#Directory of the sourcefiles to build (after optional unpacking)
+SRC_DIR=`echo zcp-$VER| sed 's/\.tar\..*$//g'`
+
+#Architecture that the created binaries run on.
+#Use noarch for scripts.
+ARCH=`uname -m`
+
+CWD=`pwd`
+
+
+
+########Build and create the pacakge.
+#Uncomment the stuff that you dont want or need
+
+
+
+#Unpack source 
+#(uncomment if not needed)
+syn3_unpack $SRC_ARC || exit 1
+
+#fix webaccess
+
+#mkdir -p /tmp/pkg/var/www/htdocs/syn3
+#mv $SRC_DIR/php-webclient-ajax /tmp/pkg/var/www/htdocs/syn3/zarafa || exit 1
+
+#mv $SRC_DIR/php-mobile-webaccess /tmp/pkg/var/www/htdocs/syn3/zarafa-mobile || exit 1
+
+#remove configs, if they are there. (they should be in the zarafa_conf package)
+#rm /tmp/pkg/var/www/htdocs/syn3/zarafa-mobile/config.php || true
+#rm /tmp/pkg/var/www/htdocs/syn3/zarafa/config.php || true
+
+
+#remove debug shizzle
+#rm /tmp/pkg/var/www/htdocs/syn3/zarafa*/debug.php || exit 1
+
+#change permissions of stuff
+#mkdir /tmp/pkg/var/www/htdocs/syn3/zarafa/tmp
+#chown nobody:nogroup /tmp/pkg/var/www/htdocs/syn3/zarafa/tmp || exit 1
+
+#mkdir /tmp/pkg/var/www/htdocs/syn3/zarafa-mobile/tmp
+#chown nobody:nogroup /tmp/pkg/var/www/htdocs/syn3/zarafa-mobile/tmp || exit 1
+
+#mkdir  /tmp/pkg/var/www/htdocs/syn3/zarafa-mobile/templates_c
+#chown nobody:nogroup /tmp/pkg/var/www/htdocs/syn3/zarafa-mobile/templates_c || exit 1
+
+#mkdir  /tmp/pkg/var/www/htdocs/syn3/zarafa-mobile/cache
+#chown nobody:nogroup /tmp/pkg/var/www/htdocs/syn3/zarafa-mobile/cache || exit 1
+
+
+
+#webportal files er in
+#cp $CWD/zarafa/* /tmp/pkg/var/www/htdocs/syn3/zarafa || exit 1
+#cp $CWD/zarafa-mobile/* /tmp/pkg/var/www/htdocs/syn3/zarafa-mobile || exit 1
+
+#branding
+#cp $CWD/zarafa_top_logo.gif /tmp/pkg/var/www/htdocs/syn3/zarafa/client/layout/img/ || exit 1
+
+#compile language files
+for PO in `find /tmp/pkg -name '*.po'`; do
+    MO=`echo "$PO" | sed 's/.po$/.mo/'`
+    msgfmt "$PO" -o "$MO" || exit 1
+    #we dont need the 'sources' in our 'binary' package ;)
+    rm "$PO"
+done
+
+#end webaccess
+
+
+
+#apply patches
+#patch -F3 -p1 -d $SRC_DIR < Datux-spamhook.patch || exit 1
+#patch -p1 -d $SRC_DIR < Datux-sendas.patch || exit 1
+
+#a hack to allow mysql>=5.0 to function:
+#DONT DO THIS IN ZARAFA 6.30.x+!
+#sed 's/.*SET max_allowed_packet.*//' -i $SRC_DIR/provider/libserver/ECDatabaseMySQL.cpp || exit 1
+
+#build and install sourcefiles
+#./configure optiones:
+#options for all make commands:
+export MAKE_OPTS=" -j10"
+#skip testing:
+export NOTEST=1
+#extra optiones for the make install command, use with INSTALL_BASE for example:
+export INSTALL_OPTS=""
+export PATH=$PATH:/usr/php5/bin
+
+#AUTOMAKE: Configure
+#Some usefull stuff you sometimes need to set:
+#export LDFLAGS="-L/usr/lib/mysql/"
+#export LD_LIBRARY_PATH=/usr/lib/mysql
+#export VPATH=$LD_LIBRARY_PATH
+pushd $SRC_DIR
+MAKE_OPTS=""
+export CFLAGS="-Wno-error" 
+
+./configure --with-mapi-configdir=/etc/mapi  --sbindir=/usr/bin --enable-swig --prefix=/usr --disable-testtools --enable-release --disable-static --enable-unicode --disable-perl --with-userscript-prefix=/etc/zarafa/userscripts --with-quotatemplate-prefix=/etc/zarafa/quotamail --enable-python || exit 1
+
+#AUTOMAKE: Compile
+make $MAKE_OPTS  || exit 1
+
+make check || exit 1
+
+
+#install bug workaround
+mkdir -p /tmp/pkg//usr/share/doc/zarafa/example-config
+cp ./installer/linux/archiver.cfg  /tmp/pkg//usr/share/doc/zarafa/example-config
+
+#AUTOMAKE: Install
+mkdir -p /tmp/pkg &>/dev/null
+#somehow these are missing in 7.1.9?
+touch doc/zarafa-ws.cfg.5 doc/zarafa-ws.1 doc/zarafa-ws.5
+
+make $MAKE_OPTS install || exit 1 
+make pkgconfigdir=/usr/lib/pkgconfig install_prefix=/tmp/pkg DESTDIR=/tmp/pkg INSTALL_ROOT=/tmp/pkg install_root=/tmp/pkg $MAKE_OPTS install >/dev/null || exit 1
+
+popd
+
+# postinstaller
+mkdir -p /tmp/pkg/etc/postinst.d
+cp post.zarafa /tmp/pkg/etc/postinst.d || exit 1
+chmod +x /tmp/pkg/etc/postinst.d/*
+
+#this endsup there somehow..
+rm -r /tmp/pkg/tmp 2>/dev/null
+
+#we provide our own preconfigured etc stuff in a seperate package
+mv /tmp/pkg/usr/etc /tmp
+
+#fix a php compile error:
+find /tmp/pkg/usr/share/php/mapi -name '*.php' -exec sed 's/<?php?/<?php /' -i "{}" \; || exit 1
+
+#strip bins and other stuff
+syn3_strip /tmp/pkg || exit 1
+
+#zarafa_conf contains this file already
+rm -r /tmp/pkg/etc/php5  || exit 1
+
+#move development stuff and create seperate development package
+syn3_move_dev /tmp/pkg /tmp/pkgdev || exit 1
+#move some extra files for the dev package, special for zarafa_spam
+for FILE in `find .\
+        -name '*.a' -o\
+        -name '*.la' -o\
+        -name '*.h' -o\
+        -name '*.cpp' -o\
+        -type d -name include -o\
+        -type d -name pkgconfig`;
+do
+        if [ -e $FILE ]; then
+		echo $FILE
+                cp $FILE /tmp/pkgdev/usr/include/zarafa
+                #rm -r $FILE || exit 1
+        fi
+done
+syn3_makepkg /tmp/pkgdev $NAME""_dev $VER $ARCH || exit 1
+
+#make main package
+syn3_makepkg /tmp/pkg $NAME $VER $ARCH || exit 1
+
+
Index: npl/mailserver/zarafa7/zarafa7.arch
===================================================================
--- npl/mailserver/zarafa7/zarafa7.arch	(revision c5c522c7ca74a4c1725ca5e3fe0bdcadff80e49a)
+++ npl/mailserver/zarafa7/zarafa7.arch	(revision c5c522c7ca74a4c1725ca5e3fe0bdcadff80e49a)
@@ -0,0 +1,1 @@
+i586
Index: npl/mailserver/zarafa7/zarafa7.depver
===================================================================
--- npl/mailserver/zarafa7/zarafa7.depver	(revision c5c522c7ca74a4c1725ca5e3fe0bdcadff80e49a)
+++ npl/mailserver/zarafa7/zarafa7.depver	(revision c5c522c7ca74a4c1725ca5e3fe0bdcadff80e49a)
@@ -0,0 +1,20 @@
+php5	7
+libvmime	0
+libical	0
+util_linux	0
+e2fsprogs	0
+boost	3
+icu4c	1
+python	2
+mysql56	1
+gsoap	0
+swig	0
+openssl	5
+mit_kerberos	1
+openldap	1
+ncurses	0
+zlib	0
+libxml2	1
+curl	1
+Linux_PAM	1
+cyrus_sasl	0
Index: npl/mailserver/zarafa7/zarafa7.md5
===================================================================
--- npl/mailserver/zarafa7/zarafa7.md5	(revision c5c522c7ca74a4c1725ca5e3fe0bdcadff80e49a)
+++ npl/mailserver/zarafa7/zarafa7.md5	(revision c5c522c7ca74a4c1725ca5e3fe0bdcadff80e49a)
@@ -0,0 +1,13 @@
+93ce90f4b4c47cab0ed61b098eee2772  ./Datux-sendas.patch
+093100621a1857f28b97d4d2f97bc9b5  ./Datux-spamhook.patch
+6079276293c5e47d99eb4542870a4e5f  ./post.zarafa
+4c209a3a025341d489768de4c58da77e  ./zarafa7_dev.pkg
+6bbf718bc1b95cd63fc26265be534f83  ./zarafa7.pkg
+11e79e3323092bf9c26b9cf3da995c39  ./zarafa7.SlackBuild
+56414f4b822f9db09aa37683fefb1ea1  ./zarafa7.SlackBuild.log.gz
+676a6467daf83ecfe39e4c740acc586a  ./zarafa-archiver-license-build-depenceny.patch
+08fe1a59fde0a0edd8a54984050824db  ./zarafa.SlackBuild.log.gz
+37fa49312eb69a25ad9a75d43b98fa4c  ./zarafa_top_logo.gif
+5c42722225ecc73447fa3ac078f6bb9f  ./zarafa/webportal.desc
+b73c5b880b6aadfd92ae7955c863fdf1  ./zarafa/webportal.png
+0790d8314fa4aef9788e5020be832535  ./zcp-7.2.4.29.tar.xz
Index: npl/mailserver/zarafa7/zarafa7.version
===================================================================
--- npl/mailserver/zarafa7/zarafa7.version	(revision c5c522c7ca74a4c1725ca5e3fe0bdcadff80e49a)
+++ npl/mailserver/zarafa7/zarafa7.version	(revision c5c522c7ca74a4c1725ca5e3fe0bdcadff80e49a)
@@ -0,0 +1,1 @@
+7.2.4.29
Index: npl/mailserver/zarafa7/zarafa7_dev.arch
===================================================================
--- npl/mailserver/zarafa7/zarafa7_dev.arch	(revision c5c522c7ca74a4c1725ca5e3fe0bdcadff80e49a)
+++ npl/mailserver/zarafa7/zarafa7_dev.arch	(revision c5c522c7ca74a4c1725ca5e3fe0bdcadff80e49a)
@@ -0,0 +1,1 @@
+i586
Index: npl/mailserver/zarafa7/zarafa7_dev.version
===================================================================
--- npl/mailserver/zarafa7/zarafa7_dev.version	(revision c5c522c7ca74a4c1725ca5e3fe0bdcadff80e49a)
+++ npl/mailserver/zarafa7/zarafa7_dev.version	(revision c5c522c7ca74a4c1725ca5e3fe0bdcadff80e49a)
@@ -0,0 +1,1 @@
+7.2.4.29
