From bdc317a1a482a0f4dfaf80f26c7bfd664e460ebf Mon Sep 17 00:00:00 2001 From: Robert Scheck Date: Mon, 8 Feb 2010 14:21:32 +0000 Subject: [PATCH 01/23] Initial import of Zarafa into Fedora and EPEL --- .cvsignore | 1 + sources | 1 + zarafa-6.30.10-chmod.patch | 13 + zarafa-6.30.10-undefined-symbol.patch | 35 ++ zarafa-6.30.4-brodowski.patch | 774 ++++++++++++++++++++++++ zarafa-6.30.4-package.patch | 48 ++ zarafa-6.30.4-perl.patch | 53 ++ zarafa.ini | 2 + zarafa.spec | 824 ++++++++++++++++++++++++++ 9 files changed, 1751 insertions(+) create mode 100644 zarafa-6.30.10-chmod.patch create mode 100644 zarafa-6.30.10-undefined-symbol.patch create mode 100644 zarafa-6.30.4-brodowski.patch create mode 100644 zarafa-6.30.4-package.patch create mode 100644 zarafa-6.30.4-perl.patch create mode 100644 zarafa.ini create mode 100644 zarafa.spec diff --git a/.cvsignore b/.cvsignore index e69de29..0e7e07b 100644 --- a/.cvsignore +++ b/.cvsignore @@ -0,0 +1 @@ +zarafa-6.30.10.tar.gz diff --git a/sources b/sources index e69de29..2a2ea20 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +da636f09fb149cf60db1c6f91a734ca3 zarafa-6.30.10.tar.gz diff --git a/zarafa-6.30.10-chmod.patch b/zarafa-6.30.10-chmod.patch new file mode 100644 index 0000000..ef7a706 --- /dev/null +++ b/zarafa-6.30.10-chmod.patch @@ -0,0 +1,13 @@ +Patch by Robert Scheck for zarafa >= 6.30.10, which adds a missing include for +the later in the code used chmod() command. Without this include, building on Fedora 13 fails. + +--- zarafa-6.30.10/provider/server/ECSoapServerConnection.cpp 2010-01-26 17:34:51.000000000 +0100 ++++ zarafa-6.30.10/provider/server/ECSoapServerConnection.cpp.chmod 2010-02-06 12:36:22.000000000 +0100 +@@ -51,6 +51,7 @@ + + #include "ECLogger.h" + ++#include + #ifdef HAVE_SYS_UN_H + #include + #endif diff --git a/zarafa-6.30.10-undefined-symbol.patch b/zarafa-6.30.10-undefined-symbol.patch new file mode 100644 index 0000000..c4b2083 --- /dev/null +++ b/zarafa-6.30.10-undefined-symbol.patch @@ -0,0 +1,35 @@ +diff -ur zarafa-6.30.10.orig/mapi4linux/src/m4lguids.cpp zarafa-6.30.10/mapi4linux/src/m4lguids.cpp +--- zarafa-6.30.10.orig/mapi4linux/src/m4lguids.cpp 2010-01-26 17:34:48.000000000 +0100 ++++ zarafa-6.30.10/mapi4linux/src/m4lguids.cpp 2010-02-04 09:53:48.459239670 +0100 +@@ -48,6 +48,7 @@ + */ + + #include "platform.h" ++/*#ifndef WINCE + #define USES_IID_IUnknown + #define USES_IID_IStream + #define USES_IID_ISequentialStream +@@ -60,7 +61,8 @@ + #define USES_IID_IMAPIProp + #define USES_IID_IMAPIFolder + #define USES_IID_IMAPITable ++#endif + #include +- ++*/ + #include "mapiguid.h" + #include "m4l.mapiutil.h" +diff -ur zarafa-6.30.10.orig/mapi4linux/src/Makefile.am zarafa-6.30.10/mapi4linux/src/Makefile.am +--- zarafa-6.30.10.orig/mapi4linux/src/Makefile.am 2010-01-26 12:05:22.000000000 +0100 ++++ zarafa-6.30.10/mapi4linux/src/Makefile.am 2010-02-04 09:51:39.285239878 +0100 +@@ -3,7 +3,9 @@ + AM_CPPFLAGS = $(DEBUGFLAGS) -DLINUX -I$(top_srcdir)/mapi4linux/include -I$(top_srcdir)/provider/common -I${top_srcdir}/common -I${top_srcdir}/libfreebusy + AM_LDFLAGS = $(DL_LIBS) -export-symbols ${top_srcdir}/mapi4linux/src/mapi-exports.sym + +-libmapi_la_LIBADD = ${top_builddir}/common/libcommon_util.la ++libmapi_la_LIBADD = ${top_builddir}/common/libcommon_util.la \ ++ ${top_builddir}/common/libcommon_mapi.la \ ++ $(PROG_LIBS) + + # required because we're exporting extern "C" functions and want to filter with 'export-symbols' + CXXLD=--tag=none gcc diff --git a/zarafa-6.30.4-brodowski.patch b/zarafa-6.30.4-brodowski.patch new file mode 100644 index 0000000..9c97208 --- /dev/null +++ b/zarafa-6.30.4-brodowski.patch @@ -0,0 +1,774 @@ +diff -ruN /usr/src/zarafa/zarafa-6.30.4.17264/php-ext/include/mapi/class.autoarchivesettings.php mapi/class.autoarchivesettings.php +--- /usr/src/zarafa/zarafa-6.30.4.17264/php-ext/include/mapi/class.autoarchivesettings.php Thu Jan 1 01:00:00 1970 ++++ mapi/class.autoarchivesettings.php Sat Aug 8 11:49:05 2009 +@@ -0,0 +1,218 @@ ++. ++ * ++ */ ++ ++?> ++ ++ */ ++ ++class AutoArchiveSettings { ++ ++ var $session; ++ var $store; ++ var $folder; ++ var $proptags; ++ ++ function agingproperties() { ++ $properties = array(); ++ $properties["entryid"] = PR_ENTRYID; ++ $properties["parent_entryid"] = PR_PARENT_ENTRYID; ++ $properties["message_class"] = PR_MESSAGE_CLASS; ++ $properties["icon_index"] = PR_ICON_INDEX; ++ $properties["display_to"] = PR_DISPLAY_TO; ++ $properties["display_cc"] = PR_DISPLAY_CC; ++ $properties["subject"] = PR_SUBJECT; ++ $properties["importance"] = PR_IMPORTANCE; ++ $properties["sent_representing_name"] = PR_SENT_REPRESENTING_NAME; ++ $properties["sent_representing_email_address"] = PR_SENT_REPRESENTING_EMAIL_ADDRESS; ++ $properties["sent_representing_addrtype"] = PR_SENT_REPRESENTING_ADDRTYPE; ++ $properties["sent_representing_entryid"] = PR_SENT_REPRESENTING_ENTRYID; ++ $properties["sender_email_address"] = PR_SENDER_EMAIL_ADDRESS; ++ $properties["sender_name"] = PR_SENDER_NAME; ++ $properties["received_by_name"] = PR_RECEIVED_BY_NAME; ++ $properties["received_by_email_address"] = PR_RECEIVED_BY_EMAIL_ADDRESS; ++ $properties["message_delivery_time"] = PR_MESSAGE_DELIVERY_TIME; ++ $properties["last_modification_time"] = PR_LAST_MODIFICATION_TIME; ++ $properties["last_verb_executed"] = PR_LAST_VERB_EXECUTED; ++ $properties["last_verb_execution_time"] = PR_LAST_VERB_EXECUTION_TIME; ++ $properties["hasattach"] = PR_HASATTACH; ++ $properties["message_size"] = PR_MESSAGE_SIZE; ++ $properties["message_flags"] = PR_MESSAGE_FLAGS; ++ $properties["flag_status"] = PR_FLAG_STATUS; ++ $properties["flag_complete_time"] = PR_FLAG_COMPLETE_TIME; ++ $properties["flag_icon"] = PR_FLAG_ICON; ++ $properties["reminder_time"] = "PT_SYSTIME:PSETID_Common:0x8502"; ++ $properties["reminder_set"] = "PT_BOOLEAN:PSETID_Common:0x8503"; ++ $properties["flag_request"] = "PT_STRING8:PSETID_Common:0x8530"; ++ $properties["flag_due_by"] = "PT_SYSTIME:PSETID_Common:0x8560"; ++ $properties["reply_requested"] = PR_REPLY_REQUESTED; ++ $properties["reply_time"] = PR_REPLY_TIME; ++ $properties["response_requested"] = PR_RESPONSE_REQUESTED; ++ $properties["client_submit_time"] = PR_CLIENT_SUBMIT_TIME; ++ $properties["sensitivity"] = PR_SENSITIVITY; ++ $properties["read_receipt_requested"] = PR_READ_RECEIPT_REQUESTED; ++ $properties["location"] = "PT_STRING8:PSETID_Appointment:0x8208"; ++ $properties["categories"] = "PT_MV_STRING8:PS_PUBLIC_STRINGS:Keywords"; ++ $properties["transport_message_headers"] = PR_TRANSPORT_MESSAGE_HEADERS; ++ $properties["contacts"] = "PT_MV_STRING8:PSETID_Common:0x853A"; ++ $properties["contacts_string"] = "PT_STRING8:PSETID_Common:0x8586"; ++ ++ $properties["aging_period"] = PR_AGING_PERIOD; // max 3 digits ++ $properties["aging_granularity"] = PR_AGING_GRANULARITY; // 0=month, 1=weeks, 2=days ++ $properties["aging_filename"] = PR_AGING_FILENAME; ++ $properties["aging_age_folder"] = PR_AGING_AGE_FOLDER; ++ $properties["aging_deleted_items"] = PR_AGING_DELETE_ITEMS; ++ $properties["aging_dont_age_me"] = PR_AGING_DONT_AGE_ME; ++ $properties["aging_file_name_after9"] = PR_AGING_FILE_NAME_AFTER9; ++ $properties["aging_when_deleted_on_server"] = PR_AGING_WHEN_DELETED_ON_SERVER; ++ $properties["aging_wait_until_expired"] = PR_AGING_WAIT_UNTIL_EXPIRED; ++ $properties["aging_version"] = PR_AGING_VERSION; ++ $properties["aging_default"] = PR_AGING_DEFAULT; ++ ++ $properties["deleted_on"] = PR_DELETED_ON; ++ $properties["updatecounter"] = "PT_LONG:PSETID_Appointment:0x8201"; ++ $properties["hideattachments"] = "PT_BOOLEAN:PSETID_Common:0x8514"; ++ ++ return $properties; ++ } ++ ++ /** ++ * Constuctor ++ * ++ * @param mapi_session $session MAPI Session ++ * @param mapi_folder $folder Folder to use for AutoArchive Settings retrival ++ */ ++ ++ function retrieveSettings($session, $store, $folder, $properties = NULL) ++ { ++ if ($properties == NULL) { ++ $properties = $this->agingproperties(); ++ }; ++ ++ $this->proptags = getPropIdsFromStrings($store, $properties); ++ ++ $this->session = $session; ++ $this->store = $store; ++ $this->folder = $folder; ++ ++ $msg = $this->getMessage(); ++ ++ $props = mapi_getprops($msg,$this->proptags); ++ ++ $data = $props; ++ ++ return $data; ++ } ++ ++ function getMessage() { ++ $table = mapi_folder_getcontentstable($this->folder, MAPI_ASSOCIATED); ++ mapi_table_sort($table, array(PR_RECEIPT_TIME => TABLE_SORT_ASCEND)); ++ $restriction = array ( RES_PROPERTY, ++ array ( RELOP => RELOP_EQ, ++ ULPROPTAG => PR_MESSAGE_CLASS, ++ VALUE => array (PR_MESSAGE_CLASS => "IPC.MS.Outlook.AgingProperties") ++ ) ++ ); ++ $msgs = mapi_table_queryallrows($table,array(PR_ENTRYID),$restriction); ++ if (isset($msgs[0][PR_ENTRYID])) { ++ $msg = mapi_msgstore_openentry($this->store,$msgs[0][PR_ENTRYID]); ++ } else { ++ $this->createMessage(); ++ $msg = $this->getMessage(); ++ } ++ return $msg; ++ } ++ ++ function updateSettings($session, $store, $folder, $uprops) { ++ $properties = $this->agingproperties(); ++ ++ $this->session = $session; ++ $this->store = $store; ++ $this->folder = $folder; ++ ++ $msg = $this->getMessage(); ++ ++ $write_props = array(); ++ ++ if (isset($uprops["aging_period"])) $write_props[$properties["aging_period"]] = $uprops["aging_period"]; ++ if (isset($uprops["aging_granularity"])) $write_props[$properties["aging_granularity"]] = $uprops["aging_granularity"]; ++ if (isset($uprops["aging_age_folder"])) $write_props[$properties["aging_age_folder"]] = $uprops["aging_age_folder"]; ++ if (isset($uprops["aging_deleted_items"])) $write_props[$properties["aging_deleted_items"]] = $uprops["aging_deleted_items"]; ++ if (isset($uprops["aging_filename"])) $write_props[$properties["aging_filename"]] = $uprops["aging_filename"]; ++ if (isset($uprops["aging_file_name_after9"])) $write_props[$properties["aging_file_name_after9"]] = $uprops["aging_file_name_after9"]; ++ if (isset($uprops["aging_version"])) $write_props[$properties["aging_version"]] = $uprops["aging_version"]; ++ if (isset($uprops["aging_default"])) $write_props[$properties["aging_default"]] = $uprops["aging_default"]; ++ ++ mapi_setprops($msg,$write_props); ++ ++ mapi_savechanges($msg); ++ ++ } ++ ++ function createMessage() { ++ ++ $properties = $this->agingproperties(); ++ ++ $write_props = array( $properties["message_class"] => "IPC.MS.Outlook.AgingProperties", ++ $properties["display_to"] => NULL, ++ $properties["display_cc"] => NULL, ++ $properties["aging_period"] => "3", ++ $properties["aging_granularity"] => "0", ++ $properties["aging_age_folder"] => "0", ++ $properties["aging_deleted_items"] => "0", ++ $properties["aging_filename"] => "", ++ $properties["aging_file_name_after9"] => "", ++ $properties["aging_version"] => "2", ++ $properties["aging_default"] => "0" ++ ); ++ ++ $msg = mapi_folder_createmessage($this->folder,MAPI_ASSOCIATED); ++ ++ mapi_setprops($msg,$write_props); ++ ++ mapi_savechanges($msg); ++ ++ } ++ ++} ++?> +diff -ruN /usr/src/zarafa/zarafa-6.30.4.17264/php-ext/include/mapi/class.linkedappointment.php mapi/class.linkedappointment.php +--- /usr/src/zarafa/zarafa-6.30.4.17264/php-ext/include/mapi/class.linkedappointment.php Thu Jan 1 01:00:00 1970 ++++ mapi/class.linkedappointment.php Fri Aug 14 11:16:18 2009 +@@ -0,0 +1,393 @@ ++. ++ * ++ */ ++?> ++ ++ */ ++ ++class linkedAppointment ++{ ++ ++ /** ++ * @var object Mapi Message Store (may be null if readonly) ++ */ ++ var $_store; ++ ++ var $_contactmapping = array ( ++ "fileas" => "PT_STRING8:{00062004-0000-0000-C000-000000000046}:0x8005", ++ "birthday_event_entryid" => "PT_BINARY:{00062004-0000-0000-C000-000000000046}:0x804d", ++ "anniversary_event_entryid" => "PT_BINARY:{00062004-0000-0000-C000-000000000046}:0x804e", ++ "birthday" => PR_BIRTHDAY, ++ "anniversary" => PR_WEDDING_ANNIVERSARY, ++ "entryid" => PR_ENTRYID, ++ "search_key" => PR_SEARCH_KEY ++ ); ++ ++ var $_appointmentmapping = array ( ++ "alldayevent" => "PT_BOOLEAN:{00062002-0000-0000-C000-000000000046}:0x8215", ++ "body" => PR_BODY, ++ "busystatus" => "PT_LONG:{00062002-0000-0000-C000-000000000046}:0x8205", ++ "categories" => "PT_MV_STRING8:{00020329-0000-0000-C000-000000000046}:Keywords", ++ "rtf" => PR_RTF_COMPRESSED, ++ "dtstamp" => PR_LAST_MODIFICATION_TIME, ++ "endtime" => "PT_SYSTIME:{00062002-0000-0000-C000-000000000046}:0x820e", ++ "location" => "PT_STRING8:{00062002-0000-0000-C000-000000000046}:0x8208", ++ "meetingstatus" => "PT_LONG:{00062002-0000-0000-C000-000000000046}:0x8217", ++ "reminder" => "PT_LONG:{00062008-0000-0000-C000-000000000046}:0x8501", ++ "sensitivity" => PR_SENSITIVITY, ++ "subject" => PR_SUBJECT, ++ "starttime" => "PT_SYSTIME:{00062002-0000-0000-C000-000000000046}:0x820d", ++ "uid" => "PT_BINARY:{6ED8DA90-450B-101B-98DA-00AA003F1305}:0x3", ++ // Append the appointment attributes since we need them for appointment creation ++ "label" => "PT_LONG:{00062002-0000-0000-C000-000000000046}:0x8214", ++ "recurring" => "PT_BOOLEAN:{00062002-0000-0000-C000-000000000046}:0x8223", ++ "recurring_data" => "PT_BINARY:{00062002-0000-0000-C000-000000000046}:0x8216", ++ "recurring_pattern" => "PT_STRING8:{00062002-0000-0000-C000-000000000046}:0x8232", ++ "basedate" => "PT_SYSTIME:{00062002-0000-0000-C000-000000000046}:0x8228", ++ "icon_index" => PR_ICON_INDEX, ++ "entryid" => PR_ENTRYID, ++ "message_class" => PR_MESSAGE_CLASS, ++ "parententryid" => PR_PARENT_ENTRYID, ++ "message_flags" => PR_MESSAGE_FLAGS, ++ "importance" => PR_IMPORTANCE, ++ // Append the common attributes since we need them for appointment creation ++ "contacts" => "PT_MV_STRING8:{00062008-0000-0000-C000-000000000046}:0x853a", ++ "contacts_string" => "PT_STRING8:{00062008-0000-0000-C000-000000000046}:0x8586", ++ "commonstart" => "PT_SYSTIME:{00062008-0000-0000-C000-000000000046}:0x8516", ++ "commonend" => "PT_SYSTIME:{00062008-0000-0000-C000-000000000046}:0x8517", ++ "remindertime" => "PT_SYSTIME:{00062008-0000-0000-C000-000000000046}:0x8502", ++ "duration" => "PT_LONG:{00062002-0000-0000-C000-000000000046}:0x8213", ++ "reminder_minutes" => "PT_LONG:{00062008-0000-0000-C000-000000000046}:0x8501", ++ "reminder" => "PT_BOOLEAN:{00062008-0000-0000-C000-000000000046}:0x8503", ++ "flagdueby" => "PT_SYSTIME:{00062008-0000-0000-C000-000000000046}:0x8560", ++ "lid_contact_link_search_key" => "PT_BINARY:{00062008-0000-0000-C000-000000000046}:0x8584", ++ "lid_contact_link_entryid" => "PT_BINARY:{00062008-0000-0000-C000-000000000046}:0x8585" ++ ); ++ ++ /** ++ * Constructor ++ * @param resource $store MAPI Message Store Object ++ * @param resource $message the MAPI Source message ++ */ ++ function linkedAppointment($_store) ++ { ++ $this->_store = $_store; ++ } ++ ++ function setLinkedContact($mapimessage) ++ { ++ // get the linked contact (if any) ++ // Set the appointment attributes ++ $aprops = $this->_appointmentmapping; ++ // Get the id's of the above... ++ foreach ($aprops as $key => $value) { ++ $aprops[$key] = $this->GetPropIDFromString($this->_store, $value); ++ } ++ $appointment = mapi_getprops($mapimessage, $aprops); ++ $recurrence = new Recurrence($this->_store, $mapimessage); ++ $recur = $recurrence->getRecurrence(); ++ if (isset($appointment[$aprops["lid_contact_link_entryid"]])) { ++ // we have a linked contact. so continue here, otherwise exit silently... ++ $entryid = $this->_unpackContactLinkEntryIDS(bin2hex($appointment[$aprops["lid_contact_link_entryid"]])); ++ // Set the contact attributes ++ $cprops = $this->_contactmapping; ++ // Get the id's of the above... ++ foreach ($cprops as $key => $value) { ++ $cprops[$key] = $this->GetPropIDFromString($this->_store, $value); ++ } ++ foreach ($entryid as $value) { ++ if (($contact_msg = mapi_msgstore_openentry($this->_store,$value))) { ++ $contact = mapi_getprops($contact_msg, $cprops); ++ switch ($appointment[$aprops["entryid"]]) { ++ case $contact[$cprops["birthday_event_entryid"]] : ++ if ($contact[$cprops["birthday"]] != $recur["start"]) { ++ mapi_setprops($contact_msg,array($cprops["birthday"] => $recur["start"])); ++ mapi_savechanges($contact_msg); ++ } ++ break; ++ case $contact[$cprops["anniversary_event_entryid"]] : ++ if ($contact[$cprops["anniversary"]] != $recur["start"]) { ++ mapi_setprops($contact_msg,array($cprops["anniversary"] => $recur["start"])); ++ mapi_savechanges($contact_msg); ++ } ++ break; ++ } ++ } ++ } ++ } ++ } ++ // $what 0x01 = birthday 0x02 = anniversary ++ function setLinkedAppointment($mapimessage,$what) ++ { ++ // We love MS for this... ++ $arrayMonth = array(0,44640,84960,129600,172800,217440,260640,305280,348480,393120,437760,480960); ++ ++ // Set the appointment attributes ++ $aprops = $this->_appointmentmapping; ++ // Get the id's of the above... ++ foreach ($aprops as $key => $value) { ++ $aprops[$key] = $this->GetPropIDFromString($this->_store, $value); ++ } ++ ++ // Set the contact attributes ++ $cprops = $this->_contactmapping; ++ // Get the id's of the above... ++ foreach ($cprops as $key => $value) { ++ $cprops[$key] = $this->GetPropIDFromString($this->_store, $value); ++ } ++ ++ // Get the contact properties ++ $contact = mapi_getprops($mapimessage,$cprops); ++ ++ // open root container, if not existing, leave this function... ++ $rootcontainer = mapi_msgstore_openentry($this->_store); ++ if ($rootcontainer) { ++ // find the appointment container, if this fails, leave this function since we cannot proceed... ++ if (($rootcontainerprops = mapi_getprops($rootcontainer, array(PR_IPM_APPOINTMENT_ENTRYID)))) { ++ $parententryid = $rootcontainerprops[PR_IPM_APPOINTMENT_ENTRYID]; ++ ++ $entryid = false; ++ switch ($what) { ++ case 0x01 : if (isset($contact[$cprops["birthday_event_entryid"]])) ++ $entryid = $contact[$cprops["birthday_event_entryid"]]; ++ $entrydate = $contact[$cprops["birthday"]]; ++ $entryprop = $cprops["birthday_event_entryid"]; ++ $entrylabel = 8; ++ $entrysubject = _("Birthday")." "._("of")." ".$contact[$cprops["fileas"]]; ++ break; ++ case 0x02 : if (isset($contact[$cprops["anniversary_event_entryid"]])) ++ $entryid = $contact[$cprops["anniversary_event_entryid"]]; ++ $entrydate = $contact[$cprops["anniversary"]]; ++ $entryprop = $cprops["anniversary_event_entryid"]; ++ $entrylabel = 9; ++ $entrysubject = _("Special Date")." "._("of")." ".$contact[$cprops["fileas"]]; ++ break; ++ } ++ ++ if ($entrydate) { ++ // open if there is a linked appointment and it can be opened (no one deleted it by accident...) ++ // otherwise create it. ++ if ($entryid && ++ ($appointment_msg = mapi_msgstore_openentry($this->_store,$entryid))) { ++ $appointment = mapi_getprops($appointment_msg); ++ } else { ++ // create with base settings ++ $folder = mapi_msgstore_openentry($this->_store,$parententryid); ++ $appointment_msg = mapi_folder_createmessage($folder); ++ $appointment = array($aprops["message_class"] => "IPM.Appointment", ++ $aprops["location"] => "", ++ $aprops["body"] => "", ++ $aprops["busystatus"] => 0 ++ ); ++ mapi_setprops($appointment_msg,$appointment); ++ } ++ // Have the starttime im GMT ++ $starttime = gmmktime(0,0,0, ++ date("m",$entrydate), ++ date("j",$entrydate), ++ date("Y",$entrydate)); ++ // Just update something in case changes occured to reduce amount ++ // of sync activities... ++ ++ if ($entrydate != $appointment[$aprops["starttime"]] || ++ $entrysubject != $appointment[$aprops["subject"]]) { ++ // Reset the subject in case the name has changed ++ $appointment[$aprops["subject"]] = $entrysubject; ++ // Set the label to 8 = birthday and 9 = anniversary ++ $appointment[$aprops["label"]] = $entrylabel; ++ // Instead of having rubbish inside... ++ $appointment[$aprops["recurring_pattern"]] = ""; ++ // Setting the reminder values ++ $appointment[$aprops["reminder"]] = true; ++ $appointment[$aprops["reminder_minutes"]] = 15; ++ $appointment[$aprops["remindertime"]] = $starttime-(15*60); ++ // Setting start & Endtime ++ $appointment[$aprops["starttime"]] = $starttime; ++ $appointment[$aprops["endtime"]] = $starttime + 86400; ++ // Set duration upon diff between start and endtime in minutes. ++ $appointment[$aprops["duration"]] = ($appointment[$aprops["endtime"]] - $appointment[$aprops["starttime"]]) / 60; ++ // Sure... birthdays and anniversaries occur on daily base :-) ++ $appointment[$aprops["recurring"]] = true; ++ $appointment[$aprops["alldayevent"]] = true; ++ // Update the id's and search keys ++ $appointment[$aprops["lid_contact_link_entryid"]] = hex2bin($this->_packContactLinkEntryIDS(array($contact[$cprops["entryid"]]))); ++ $appointment[$aprops["lid_contact_link_search_key"]] = hex2bin($this->_packContactLinkSearchKeys(array($contact[$cprops["search_key"]]))); ++ // Set the changed properties ++ mapi_setprops($appointment_msg,$appointment); ++ $recurrence = new Recurrence($this->_store, $appointment_msg); ++ $tz = array(); ++ $tz["timezone"] = (($entrydate-$starttime)/3600)*60; ++ $tz["timezonedst"] = 0; ++ $tz["dstendmonth"] = 0; ++ $tz["dstendweek"] = 0; ++ $tz["dstendhour"] = 0; ++ $tz["dststartmonth"] = 0; ++ $tz["dststartweek"] = 0; ++ $tz["dststarthour"] = 0; ++ // Set the iconindex to be recurring ++ $appointment[$aprops["icon_index"]] = 1025; ++ // Set the changed properties ++ $appointment = mapi_setprops($appointment_msg,$appointment); ++ // Recurring values ++ $recur["type"] = 13; ++ $recur["subtype"] = 2; ++ $recur["month"] = $arrayMonth[gmdate("m",$starttime)-1]; ++ $recur["everyn"] = 12; ++ $recur["regen"] = 1; ++ $recur["monthday"] = gmdate("j",$starttime); ++ $recur["term"] = 0x23; ++ $recur["numoccur"] = 0; ++ $recur["start"] = $starttime; ++ $recur["end"] = 79870662000; // no end ++ $recur["startocc"] = 0; ++ $recur["endocc"] = 1440; ++ // Let class.recurrence do its job. ++ $recurrence->setRecurrence($tz, $recur); ++ // Save the changes to message ++ mapi_savechanges($appointment_msg); ++ $appointment = mapi_getprops($appointment_msg); ++ mapi_setprops($mapimessage,array($entryprop => $appointment[$aprops['entryid']])); ++ mapi_savechanges($mapimessage); ++ } ++ } ++ } ++ } ++ } ++ /** ++ * unpacks the Contact Link Entry IDs ++ * ++ * @param string in hex with the value ++ * @return array with all binary Contact Link Entry IDS ++ * ++ */ ++ function _unpackContactLinkEntryIDS($value) ++ { ++ $contact_link_entry_ids = unpack("Vcount",hex2bin(substr($value,0,8))); ++ $contact_link_entry_ids["entry_ids"] = array(); ++ $length=8; ++ for ($j=0,$i=8;$j<$contact_link_entry_ids["count"];$j++,$i=$i+$length+8) { ++ $l = unpack("Vlength",hex2bin(substr($value,$i,8))); ++ $length=$l["length"]; ++ $temp = unpack ("VFlags/A16ProviderUID/VVersion/VType/VIndext/Vcbid/A*abeid",hex2bin(substr($value,$i+8,($length*2)))); ++ $temp["abeid"] = hex2bin(substr(bin2hex($temp["abeid"]),0,$temp["cbid"]*2)); ++ $contact_link_entry_ids["entry_ids"][]=$temp["abeid"]; ++ } ++ return $contact_link_entry_ids["entry_ids"]; ++ } ++ ++ /** ++ * packs the Contact Link Entry IDs ++ * ++ * @param array with all binary Contact Link Entry IDs ++ * @return string in hex with the value ++ * ++ */ ++ function _packContactLinkEntryIDS($values) { ++ $temp=""; ++ for ($i=0;$i +diff -ruN /usr/src/zarafa/zarafa-6.30.4.17264/php-ext/include/mapi/class.recurrence.php mapi/class.recurrence.php +--- /usr/src/zarafa/zarafa-6.30.4.17264/php-ext/include/mapi/class.recurrence.php Fri Oct 16 21:05:22 2009 ++++ mapi/class.recurrence.php Tue Oct 20 19:29:54 2009 +@@ -363,9 +363,13 @@ + * @param array $exception_props the exception properties (same properties as normal recurring items) + * @param date $base_date the base date of the exception (actual GMT time of non-exception occurrence) + * @param boolean $delete true - delete occurrence, false - create new exception or modify existing ++ * @param boolean $islocal true - expect the base_date in local time (happens in case basedate is returned from WA! + */ +- function createException($exception_props, $base_date, $delete = false) ++ function createException($exception_props, $base_date, $delete = false, $islocal=false) + { ++ // CHANGED dw2412 to support local base_date as delivered from WebAccess ++ if ($islocal == true) $base_date = $this->toGMT($this->tz, $base_date); ++ + $baseday = $this->dayStartOf($this->fromGMT($this->tz, $base_date)); + $basetime = $baseday + $this->recur["startocc"] * 60; + +@@ -447,8 +451,10 @@ + * Modifies an existing exception, but only updates the given properties + * NOTE: You can't remove properites from an exception, only add new ones + */ +- function modifyException($exception_props, $base_date) ++ function modifyException($exception_props, $base_date, $islocal=false) + { ++ // ADDED dw2412 to support local base_date as delivered from WebAccess ++ if ($islocal == true) $base_date = $this->toGMT($this->tz, $base_date); + if(!$this->isValidExceptionDate($base_date, $exception_props[$this->proptags["startdate"]])) + return false; + +@@ -573,13 +579,17 @@ + + // Returns the start or end time of the occurrence on the given base date. + // This assumes that the basedate you supply is correct .. ! +- function getOccurrenceStart($basedate) { +- $daystart = $this->dayStartOf($this->fromGMT($this->tz, $basedate)); ++ function getOccurrenceStart($basedate, $islocal = false) { ++ // CHANGED dw2412 to support local base_date as delivered from WebAccess ++ if ($islocal == false) $daystart = $this->dayStartOf($this->fromGMT($this->tz, $basedate)); ++ else $daystart = $this->dayStartOf($basedate); + return $this->toGMT($this->tz, $daystart + $this->recur["startocc"] * 60); + } + +- function getOccurrenceEnd($basedate) { +- $daystart = $this->dayStartOf($this->fromGMT($this->tz, $basedate)); ++ function getOccurrenceEnd($basedate, $islocal = false) { ++ // CHANGED dw2412 to support local base_date as delivered from WebAccess ++ if ($islocal == false) $daystart = $this->dayStartOf($this->fromGMT($this->tz, $basedate)); ++ else $daystart = $this->dayStartOf($basedate); + return $this->toGMT($this->tz, $daystart + $this->recur["endocc"] * 60); + } + +@@ -1229,8 +1239,12 @@ + /** + * Returns the exception if there is a CHANGE exception on the given base date, or FALSE otherwise + */ +- function getChangeException($basedate) ++ function getChangeException($basedate, $islocal) + { ++ // CHANGED dw2412 to support local base_date as delivered from WebAccess ++ if ($islocal == true) $basedate = $this->toGMT($this->tz, $basedate); ++ ++ + // Check if the occurrence is modified on the specified date + foreach($this->recur["changed_occurences"] as $changed) + { +@@ -1263,7 +1277,6 @@ + function dayStartOf($date) + { + $time1 = $this->gmtime($date); +- + return gmmktime(0, 0, 0, $time1["tm_mon"] + 1, $time1["tm_mday"], $time1["tm_year"] + 1900); + } + +diff -ruN /usr/src/zarafa/zarafa-6.30.4.17264/php-ext/include/mapi/mapiguid.php mapi/mapiguid.php +--- /usr/src/zarafa/zarafa-6.30.4.17264/php-ext/include/mapi/mapiguid.php Fri Oct 16 21:05:22 2009 ++++ mapi/mapiguid.php Tue Oct 20 19:29:54 2009 +@@ -67,4 +67,7 @@ + define('PS_MAPI', makeguid("{00020328-0000-0000-C000-000000000046}")); + define('PS_PUBLIC_STRINGS', makeguid("{00020329-0000-0000-C000-000000000046}")); + define('PS_INTERNET_HEADERS', makeguid("{00020386-0000-0000-c000-000000000046}")); ++ ++define('MAPIUID_LinkContactEntryID', makeguid("{0aaa42fe-c718-101a-e885-0b651c240000}")); // http://msdn.microsoft.com/en-us/library/bb820924.aspx misc2 in CONTAB structure in Internet This parameter is reserved for Outlook internal use and is not supported. ++ + ?> +diff -ruN /usr/src/zarafa/zarafa-6.30.4.17264/php-ext/include/mapi/mapitags.php mapi/mapitags.php +--- /usr/src/zarafa/zarafa-6.30.4.17264/php-ext/include/mapi/mapitags.php Fri Oct 16 21:05:22 2009 ++++ mapi/mapitags.php Tue Oct 20 19:29:54 2009 +@@ -601,7 +601,25 @@ + define('PR_FINDER_ENTRYID' ,mapi_prop_tag(PT_BINARY, 0x35E7)); + define('PR_IPM_FAVORITES_ENTRYID' ,mapi_prop_tag(PT_BINARY, 0x6630)); + define('PR_IPM_PUBLIC_FOLDERS_ENTRYID' ,mapi_prop_tag(PT_BINARY, 0x6631)); ++//* start: Added dw2412 source www.cdolive.com/cdo10.htm ++define('PR_HAS_RULES' ,mapi_prop_tag(PT_BINARY, 0x663A)); + ++// Outlook AutoArchive Properties ++define('PR_AGING_PERIOD' ,mapi_prop_tag(PT_LONG, 0x36EC)); ++define('PR_AGING_GRANULARITY' ,mapi_prop_tag(PT_LONG, 0x36EE)); ++define('PR_AGING_FILENAME' ,mapi_prop_tag(PT_TSTRING, 0x6856)); ++define('PR_AGING_AGE_FOLDER' ,mapi_prop_tag(PT_BOOLEAN, 0x6857)); ++define('PR_AGING_DELETE_ITEMS' ,mapi_prop_tag(PT_BOOLEAN, 0x6855)); ++define('PR_AGING_FILE_NAME_AFTER9' ,mapi_prop_tag(PT_TSTRING, 0x6859)); ++define('PR_AGING_DONT_AGE_ME' ,mapi_prop_tag(PT_BOOLEAN, 0x6858)); ++define('PR_AGING_WHEN_DELETED_ON_SERVER' ,mapi_prop_tag(PT_BOOLEAN, 0x685B)); ++define('PR_AGING_WAIT_UNTIL_EXPIRED' ,mapi_prop_tag(PT_BOOLEAN, 0x685C)); ++define('PR_AGING_VERSION' ,mapi_prop_tag(PT_LONG, 0x685D)); ++define('PR_AGING_DEFAULT' ,mapi_prop_tag(PT_LONG, 0x685E)); ++ ++ ++ ++//* End : added dw2412 + + /* Proptags 0x35E8-0x35FF reserved for folders "guaranteed" by 'PR_VALID_FOLDER_MASK */ + +@@ -637,6 +655,19 @@ + define('PR_DEFAULT_VIEW_ENTRYID' ,mapi_prop_tag(PT_BINARY, 0x3616)); + define('PR_ASSOC_CONTENT_COUNT' ,mapi_prop_tag(PT_LONG, 0x3617)); + ++//* start: Added dw2412 source www.cdolive.com/cdo10.htm ++define('PR_DEF_FORM_ALLOWED' ,mapi_prop_tag(PT_LONG, 0x3FE2)); ++define('PR_PUBLISH_IN_ADDRESS_BOOK' ,mapi_prop_tag(PT_BOOLEAN, 0x3FE6)); ++define('PR_WEBPAGE' ,mapi_prop_tag(PT_TSTRING, 0x36DF)); ++define('PR_FOLDER_VIEWS_ONLY' ,mapi_prop_tag(PT_LONG, 0x36E1)); ++define('PR_DEF_MSG_CLASS' ,mapi_prop_tag(PT_TSTRING, 0x36E5)); ++define('PR_DEF_FORM_NAME' ,mapi_prop_tag(PT_TSTRING, 0x36E6)); ++define('PR_GENERATE_EXCHANGE_VIEWS' ,mapi_prop_tag(PT_BOOLEAN, 0x36E9)); ++define('PR_VIEW_NAME' ,mapi_prop_tag(PT_TSTRING, 0x7006)); ++define('PR_OFFLINE_FLAG' ,mapi_prop_tag(PT_LONG, 0x663D)); ++define('PR_REPLICA_VERSION' ,mapi_prop_tag(PT_LONG, 0x664B)); ++//* end : Added dw2412 ++ + define('PR_RIGHTS' ,mapi_prop_tag(PT_LONG, 0x6639)); + + /* Reserved 0x36C0-0x36FF */ +@@ -1231,6 +1262,9 @@ + + define('PR_PROCESSED', mapi_prop_tag(PT_BOOLEAN, 0x7D01)); + ++// ADDED dw2412 Contact Photo Attachment ++define('PR_ATTACHMENT_CONTACTPHOTO' ,mapi_prop_tag(PT_BOOLEAN, 0x7FFF)); ++ + // Delegates properties + define('PR_DELEGATES_SEE_PRIVATE', mapi_prop_tag(PT_MV_LONG, 0x686B)); + define('PR_SCHDINFO_DELEGATE_ENTRYIDS', mapi_prop_tag(PT_MV_BINARY, 0x6845)); +--- /usr/src/zarafa/zarafa-6.30.4.17264/php-ext/Makefile.am 2009-10-16 15:55:59.000000000 +0200 ++++ zarafa-6.30.4/php-ext/Makefile.am.brodowski 2009-10-24 23:48:37.000000000 +0200 +@@ -23,7 +23,7 @@ + # and be missing at runtime. + # therefore, we explicitly link mapi.so with -lpthread :( + +-dist_data_DATA = include/mapi/mapicode.php include/mapi/mapidefs.php include/mapi/mapitags.php include/mapi/mapi.util.php include/mapi/class.recurrence.php include/mapi/class.meetingrequest.php include/mapi/class.freebusypublish.php include/mapi/mapiguid.php ++dist_data_DATA = include/mapi/mapicode.php include/mapi/mapidefs.php include/mapi/mapitags.php include/mapi/mapi.util.php include/mapi/class.recurrence.php include/mapi/class.meetingrequest.php include/mapi/class.freebusypublish.php include/mapi/mapiguid.php include/mapi/class.autoarchivesettings.php include/mapi/class.linkedappointment.php + datadir = ${datarootdir}/php/mapi + + mapi_la_SOURCES = main.cpp Session.cpp SessionPool.cpp util.cpp \ diff --git a/zarafa-6.30.4-package.patch b/zarafa-6.30.4-package.patch new file mode 100644 index 0000000..3c42aa1 --- /dev/null +++ b/zarafa-6.30.4-package.patch @@ -0,0 +1,48 @@ +Patch by Robert Scheck for zarafa >= 6.30.4, which only +removes the paths from autoconf/automake related files, that don't exist in the OSS +version of Zarafa. Having these paths not removed causes autoreconf to fail, but a +re-run of autoreconf is needed in order to get the rpaths completely out of all the +libraries and binaries built during the make process. + +--- zarafa-6.30.4/configure.ac 2009-03-17 17:30:45.000000000 +0100 ++++ zarafa-6.30.4/configure.ac.fedora 2009-03-31 20:34:29.000000000 +0200 +@@ -591,17 +591,6 @@ + version + specialbuild + ]) +-dnl non-oss files +-if test -d `dirname $0`/licensed; then +-AC_CONFIG_FILES([ +- liblicense/Makefile +- licensed/Makefile +- ECtools/zarafa-backup/Makefile +- ECtools/zarafa-backup/helpers/Makefile +- ECtools/zarafa-report/Makefile +- debian/zarafa.install +-]) +-fi + + AC_OUTPUT + +--- zarafa-6.30.4/ECtools/Makefile.am 2009-04-23 22:10:44.000000000 +0200 ++++ zarafa-6.30.4/ECtools/Makefile.am.fedora 2009-04-25 21:20:43.000000000 +0200 +@@ -1,7 +1,3 @@ +-if ! OSS_ONLY +-PROSUBS = zarafa-backup zarafa-report +-endif +- + if WITH_TESTTOOLS + TESTSUBS = ECTestTools + endif +--- zarafa-6.30.4/Makefile.am 2009-04-23 22:10:44.000000000 +0200 ++++ zarafa-6.30.4/Makefile.am.fedora 2009-04-25 21:20:26.000000000 +0200 +@@ -1,9 +1,5 @@ + AUTOMAKE_OPTIONS = 1.8 foreign + +-if ! OSS_ONLY +-PROSUBS = liblicense licensed +-endif +- + SUBDIRS = common libfreebusy mapi4linux $(PROSUBS) provider libicalmapi inetmapi php-ext spooler gateway caldav ECtools installer po doc + + if WITH_PERL diff --git a/zarafa-6.30.4-perl.patch b/zarafa-6.30.4-perl.patch new file mode 100644 index 0000000..3c5bed5 --- /dev/null +++ b/zarafa-6.30.4-perl.patch @@ -0,0 +1,53 @@ +Patch by Robert Scheck for Zarafa >= 6.30.3, which +replaces the hardcoded perl directories by correct ones (in a dynamic way). Only +Debian and Ubuntu have ExtUtils in /usr/share, openSUSE, Fedora and RHEL/CentOS +use /usr/lib. So let us use the correct way to detect the directory. + +This patch should be an advantage to OSS users on non-Debian distributions when +using Perl API, as the correct directory will get picked up. + +--- zarafa-6.30.0/configure.ac 2009-07-20 18:41:07.000000000 +0200 ++++ zarafa-6.30.0/configure.ac.perl 2009-10-16 00:23:52.000000000 +0200 +@@ -127,6 +127,22 @@ + # build perl stuff + AC_ARG_ENABLE(perl, AC_HELP_STRING([--enable-perl], [enable building perl bindings]), [want_perl=${enableval}], [want_perl=no]) + AM_CONDITIONAL(WITH_PERL, test "$want_perl" = "yes") ++if test "x$want_perl" = "xyes"; then ++ AC_PATH_PROG([PERL], [perl], [no]) ++ if test "x$PERL" = "xno"; then ++ AC_MSG_ERROR([perl is required for building perl bindings]) ++ fi ++ ++ AC_MSG_CHECKING([for perl installarchlib]) ++ PERL_ARCHLIB=`$PERL -V:installarchlib | sed -e "s/^.*='//" -e "s/';$//"` ++ AC_MSG_RESULT([$PERL_ARCHLIB]) ++ AC_SUBST(PERL_ARCHLIB) ++ ++ AC_MSG_CHECKING([for perl privlib]) ++ PERL_PRIVLIB=`$PERL -V:privlib | sed -e "s/^.*='//" -e "s/';$//"` ++ AC_MSG_RESULT([$PERL_PRIVLIB]) ++ AC_SUBST(PERL_PRIVLIB) ++fi + + # testtools require ncurses + if test "$want_tests" = "yes"; then +--- zarafa-6.30.0/perl/Makefile.am 2009-07-20 18:41:06.000000000 +0200 ++++ zarafa-6.30.0/perl/Makefile.am.perl 2009-10-16 00:24:51.000000000 +0200 +@@ -1,7 +1,6 @@ + lib_LTLIBRARIES = libperlmapi.la + +-PVERSION=5.8.8 +-AM_CPPFLAGS = $(DEBUGFLAGS) -DLINUX -I$(top_srcdir)/mapi4linux/include -I$(top_srcdir)/provider/common -I${top_srcdir}/common -I/usr/lib/perl/$(PVERSION)/CORE ++AM_CPPFLAGS = $(DEBUGFLAGS) -DLINUX -I$(top_srcdir)/mapi4linux/include -I$(top_srcdir)/provider/common -I${top_srcdir}/common -I$(PERL_ARCHLIB)/CORE + + libperlmapi_la_LIBADD = ${top_builddir}/mapi4linux/src/libmapi.la \ + ${top_builddir}/common/libcommon_mapi.la \ +@@ -12,7 +11,7 @@ + CLEANFILES = MAPI.cpp + + .xs.cpp: typemap +- xsubpp -noprototypes -nolinenumbers -C++ -typemap /usr/share/perl/$(PVERSION)/ExtUtils/typemap $< > $@; \ ++ xsubpp -noprototypes -nolinenumbers -C++ -typemap $(PERL_PRIVLIB)/ExtUtils/typemap $< > $@; \ + if [ $$? -ne 0 ]; then rm $@; fi + + check-syntax: diff --git a/zarafa.ini b/zarafa.ini new file mode 100644 index 0000000..160434a --- /dev/null +++ b/zarafa.ini @@ -0,0 +1,2 @@ +; Enable Zarafa mapi extension module +extension=mapi.so diff --git a/zarafa.spec b/zarafa.spec new file mode 100644 index 0000000..a034b78 --- /dev/null +++ b/zarafa.spec @@ -0,0 +1,824 @@ +# +# Releasing with this .spec, for fun and profit; +# +# = Beta Release or Release Candidate = +# +# 1. Set beta_or_rc to 1 +# 2. Set actual_release to the actual_release value of the previous +# build attempt, +1 +# - The release tag in case of a beta_or_rc release is (statically) +# prefixed with "0.", so that the first final release ("1") is always +# newer (in rpm-compver). +# 3. Set the SVN revision to the current SVN revision; +# - This ensures a future SVN revision is always *more* recent in +# rpm-compver +# - Lacking a unique zarafa-.svn.tar.gz source +# tarball, setting the correct SVN revision in the .spec is +# critical in order to be able to determine exactly what was in +# the tarball at the time of this build. You may recover the exact +# SVN revision used from the resulting SRPM and RPMs because it ends +# up in the RPM release tag. +# 4. Update %%changelog, considering the following; +# - Possibly change only the release tag for the most recent changelog +# %%changelog entry, if appropriate +# - Add a message about the changes to either the product or the RPM +# packaging +# 5. Build locally +# 6. Build in mock for; +# a) fedora-rawhide-x86_64, +# b) fedora-12-x86_64, +# c) fedora-11-x86_64, +# d) epel-5-x86_64, +# e) epel-4-x86_64 +# +# or scratch build in koji; +# +# for tag in dist-f13 dist-f12-updates-candidate dist-f11-updates-candidate \ +# dist-5E-epel dist-4E-epel; do +# echo "- $tag: `koji build --scratch --nowait $tag $srpm 2>&1 | grep \"Task info\" | awk '{print $3}'`" +# done +# +# 7. Should builds fail, repeat the process. +# +# = Final Release = +# +# NOTE: A final release of a version, or multiple final releases of the +# same version, of Zarafa 6.30.10 requires one unique tarball, probably +# named similar to zarafa-6.30.10.tar.gz. +# +# Once this tarball is used for an RPM package that is actually released, +# the .tar.gz source should not change anymore. You may, though, include +# patches for the 6.30.10 RPM package in this .spec and bumping the release +# number. +# +# When you do so, however, you will need to take into account upgrade paths +# between distribution versions. E.g., when releasing 6.30.10-2 to F-11, you +# would also need to release 6.30.10-2 to F-12. +# +# An alternative is to release 6.30.10.1 with a zarafa-6.30.10.1.tar.gz (yet +# again ensuring there is an upgrade path to later distribution versions) +# +# The point behind this has to do with reproducibility, though admittedly, +# the Source RPM corresponding to the binary RPM (comparing the +# -.src.rpm vs. the installed +# -..rpm) does reveal the actual SVN revision number, +# and should thus also build the exact same thing running in production (euh, +# at customers, that is). +# +# 1. Set beta_or_rc to 0 +# 2. Set actual_release to 1, or the value of actual_release of +# the previous stable release, +1 in case have already released +# this SVN revision as a stable product. +# 3. Set the SVN revision to the current SVN revision; +# - Lacking a unique zarafa-.svn.tar.gz source +# tarball, setting the correct SVN revision in the .spec is +# critical in order to be able to determine exactly what was in +# the tarball at the time of this build. You may recover the exact +# SVN revision used from the resulting SRPM, as the .spec in that +# SRPM contains the SVN revision number (but not the resulting RPMs +# just for the sake of appearance). +# 4. Update %%changelog, considering the following; +# - Remove all %%changelog stamps that have a beta_or_rc type of versioning, +# again just for appearances sake, possibly preserving the important +# messages from each beta_or_rc type of changelog entries, e.g.: +# +# * Some Time Your Name - 6.30.10-0.1svn12345 +# - Improve packaging +# +# might, in a final release, become: +# +# * Some Time Zarafa Release Engineering - 6.30.10-1 +# - Release 6.30.10 +# - Improve packaging +# +# - Possibly change only the release tag for the most recent changelog +# %%changelog entry, if appropriate. This is assuming there is no +# important or significant changes between the beta_or_rc and the final +# product. +# - Add a message about the changes to either the product or the RPM +# packaging if appropriate. +# 5. Build locally +# 6. Build in mock for; +# a) fedora-rawhide-x86_64, +# b) fedora-12-x86_64, +# c) fedora-11-x86_64, +# d) epel-5-x86_64, +# e) epel-4-x86_64 +# +# or scratch build in koji; +# +# for tag in dist-f13 dist-f12-updates-candidate dist-f11-updates-candidate \ +# dist-5E-epel dist-4E-epel; do +# echo "- $tag: `koji build --scratch --nowait $tag $srpm 2>&1 | grep \"Task info\" | awk '{print $3}'`" +# done +# +# 7. When mock or koji scratch builds fail, repeat the process. +# + +%define beta_or_rc 0 +%define actual_release 1 +%define svnrevision 18495 +%define with_ldap 1 +%define with_xmlto 1 + +Summary: Zarafa Outlook Sharing and Open Source Collaboration +Name: zarafa +Version: 6.30.10 +%if %{beta_or_rc} +Release: 0.%{actual_release}.svn%{svnrevision}%{?dist} +%else +Release: %{actual_release}%{?dist} +%endif +# Red Hat Legal has been advised by email from Zarafa that no license is +# required in order to use the letter string "zarafa" (combined with other +# words) in the package naming, to refer to the software as "Zarafa" to +# indicate its intended purpose, and to modify packages with bug fixes and +# enhancements. +License: AGPLv3 with exceptions +Group: Applications/Productivity +URL: http://www.zarafa.com/ +# http://www.zarafa.com/download-community -> "Zarafa Source Package" +Source0: %{name}-%{version}.tar.gz +Source1: %{name}.ini + +Patch0: zarafa-6.30.4-package.patch +# Patch 1, 2 and 3 were sent to upstream +Patch1: zarafa-6.30.4-perl.patch +Patch2: zarafa-6.30.10-undefined-symbol.patch +Patch3: zarafa-6.30.10-chmod.patch +# http://www.brodowski.org/zarafa/php-mapi/6.30.10.18495/18495_patch.diff +Patch10: zarafa-6.30.4-brodowski.patch + +BuildRequires: bison +BuildRequires: gcc-c++ +BuildRequires: byacc +BuildRequires: flex +BuildRequires: gettext +BuildRequires: libical-devel >= 0.42 +BuildRequires: libvmime07-devel +BuildRequires: libxml2-devel +BuildRequires: mysql-devel >= 4.1 +BuildRequires: ncurses-devel +BuildRequires: pam-devel +BuildRequires: php-devel +BuildRequires: libtool, automake, autoconf + +%if 0%{?fedora} > 8 +BuildRequires: libcurl-devel +BuildRequires: perl-devel +%else +BuildRequires: curl-devel +BuildRequires: perl +%endif + +%if 0%{?fedora} >= 12 +BuildRequires: libuuid-devel +%endif + +%if %{with_ldap} +BuildRequires: openldap-devel +%endif + +%if %{with_xmlto} +BuildRequires: xmlto +%endif + +# The normal zarafa package pulls in all of zarafa +Requires: zarafa(ical) = %{version}-%{release} +Requires: zarafa(dagent) = %{version}-%{release} +Requires: zarafa(gateway) = %{version}-%{release} +Requires: zarafa(monitor) = %{version}-%{release} +Requires: zarafa(server) = %{version}-%{release} +Requires: zarafa(spooler) = %{version}-%{release} +Requires: zarafa(utils) = %{version}-%{release} +Requires: zarafa(config) = %{version}-%{release} + +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) + +%description +Zarafa Outlook Sharing is a Microsoft Exchange replacement. The Open Source +Collaboration provides an integration with your existing Linux mail server, +native mobile phone support by ActiveSync compatiblity and a webaccess with +'Look & Feel' similar to Outlook using Ajax. Including an IMAP4 and a POP3 +gateway as well as an iCal/CalDAV gateway, Zarafa can combine the usability +with the stability and flexibility of a Linux server. + +The proven Zarafa groupware solution is using MAPI objects, provides a MAPI +client library as well as programming interfaces for C++, PHP and Perl. The +other Zarafa related packages need to be installed to gain all the features +and benefits of Zarafa Outlook Sharing and Open Source Collaboration. + +## +## Zarafa Client +## +%package client +Summary: Zarafa Client Library +Group: System Environment/Libraries +Requires: zarafa(common) = %{version}-%{release} +Provides: zarafa(client) = %{version}-%{release} + +%description client +Zarafa client libraries for use with integrated MAPI clients. + +## +## Zarafa Common files +## +%package common +Summary: Zarafa common files +Group: System Environment/Daemons +Requires(pre): shadow-utils +Provides: zarafa(common) = %{version}-%{release} + +%description common +Common files and directories required by most Zarafa packages. + +## +## Zarafa Delivery Agent +## +%package dagent +Summary: Zarafa Delivery Agent +Group: System Environment/Daemons +Requires: zarafa(client) = %{version}-%{release} +Requires: zarafa(common) = %{version}-%{release} +Requires(post): /sbin/chkconfig +Requires(preun): /sbin/service +Requires(preun): /sbin/chkconfig +Requires(postun): /sbin/service +Provides: zarafa(dagent) = %{version}-%{release} +Provides: zarafa(config::dagent) = %{version}-%{release} + +%description dagent +The delivery agent delivers e-mails into the Zarafa server. +It can be used to trigger the local mailer or act as the LMTP +server. + +## +## Zarafa Development Headers +## +%package devel +Summary: Development files for several Zarafa libraries +Group: Development/Libraries +Requires: %{name} = %{version}-%{release}, pkgconfig +Requires: zarafa(common) = %{version}-%{release} +Provides: %{name}-static = %{version}-%{release} + +%description devel +The zarafa-devel package includes header files and libraries necessary for +developing programs which use features from the Zarafa Outlook Sharing and +Open Source Collaboration. The proven Zarafa groupware solution is using +MAPI objects, provides a MAPI client library and programming interfaces for +C++, PHP and Perl. + +## +## Zarafa Gateway +## +%package gateway +Summary: Zarafa Gateway server (POP3/IMAP access) +Group: System Environment/Daemons +Requires: zarafa(client) = %{version}-%{release} +Requires: zarafa(common) = %{version}-%{release} +Requires(post): /sbin/chkconfig +Requires(preun): /sbin/service +Requires(preun): /sbin/chkconfig +Requires(postun): /sbin/service +Provides: zarafa(gateway) = %{version}-%{release} +Provides: zarafa(config::gateway) = %{version}-%{release} + +%description gateway +The gateway enables other e-mail clients to connect through +POP3 or IMAP to the Zarafa server to read their e-mail. With +IMAP, it is also possible to view the contents of shared +folders and subfolders. The gateway can be configured to +listen for POP3, POP3S, IMAP and/or IMAPS. + +## +## Zarafa iCal/CalDAV server +## +%package ical +Summary: The Zarafa iCal/CalDAV gateway +Group: System Environment/Daemons +Requires: zarafa(client) = %{version}-%{release} +Requires: zarafa(common) = %{version}-%{release} +Requires(post): /sbin/chkconfig +Requires(preun): /sbin/service +Requires(preun): /sbin/chkconfig +Requires(postun): /sbin/service +Provides: zarafa(ical) = %{version}-%{release} +Provides: zarafa(caldav) = %{version}-%{release} +Provides: zarafa(config::ical) = %{version}-%{release} +Provides: zarafa(config::caldav) = %{version}-%{release} + +%description ical +The iCal/CalDAV gateway enables users to retrieve their +calendar using iCalendar compliant clients. The iCal/CalDAV +gateway can be configured to listen for HTTP and HTTPS +requests. + +## +## Zarafa CalDAV package, merely an alias for zarafa-ical +## +%package caldav +Summary: The Zarafa iCal/CalDAV gateway +Group: System Environment/Daemons +Requires: zarafa(ical) = %{version}-%{release} + +%description caldav +The iCal/CalDAV gateway enables users to retrieve their +calendar using iCalendar compliant clients. The iCal/CalDAV +gateway can be configured to listen for HTTP and HTTPS +requests. + +## +## Zarafa Monitor Service +## +%package monitor +Summary: Zarafa Monitoring service +Group: System Environment/Daemons +Requires: zarafa(client) = %{version}-%{release} +Requires: zarafa(common) = %{version}-%{release} +Requires(post): /sbin/chkconfig +Requires(preun): /sbin/service +Requires(preun): /sbin/chkconfig +Requires(postun): /sbin/service +Provides: zarafa(monitor) = %{version}-%{release} +Provides: zarafa(config::monitor) = %{version}-%{release} + +%description monitor +The monitor checks user mailbox sizes. When a quotum is reached +the monitor sends a quota notification email. + +## +## Zarafa Backend Server +## +%package server +Summary: Zarafa Backend Server +Group: System Environment/Daemons +Requires: zarafa(common) = %{version}-%{release} +Requires(post): /sbin/chkconfig +Requires(preun): /sbin/service +Requires(preun): /sbin/chkconfig +Requires(postun): /sbin/service +Provides: zarafa(server) = %{version}-%{release} +Provides: zarafa(config) = %{version}-%{release} +Provides: zarafa(config::server) = %{version}-%{release} + +%description server +The Zarafa groupware backend server + +## +## Zarafa Spooler Service +## +%package spooler +Summary: Zarafa Spooler Service +Group: System Environment/Daemons +Requires: zarafa(client) = %{version}-%{release} +Requires: zarafa(common) = %{version}-%{release} +Requires(post): /sbin/chkconfig +Requires(preun): /sbin/service +Requires(preun): /sbin/chkconfig +Requires(postun): /sbin/service +Provides: zarafa(spooler) = %{version}-%{release} +Provides: zarafa(config::spooler) = %{version}-%{release} + +%description spooler +The spooler sends all pending Zarafa e-mail to the recipients, +from the Outbox of a user/all users. + +## +## Zarafa Utilities +## +%package utils +Summary: Zarafa Utilities +Group: Applications/System +Requires: zarafa(client) = %{version}-%{release} +Requires: zarafa(common) = %{version}-%{release} +Provides: zarafa(utils) = %{version}-%{release} + +%description utils +Administration utilities for the Zarafa Groupware environment +including reporting and password management. + +## +## MAPI System Libraries +## +%package -n libmapi +Summary: Mapi libraries by Zarafa +Group: System Environment/Libraries +Requires: zarafa(client) = %{version}-%{release} +Requires(post): /sbin/ldconfig +Requires(postun): /sbin/ldconfig + +%description -n libmapi +MAPI libraries by Zarafa. + +## +## MAPI Perl extension +## +%package -n perl-libmapi +Summary: Perl Mapi extension libraries by Zarafa +Group: System Environment/Libraries +Requires: perl + +%description -n perl-libmapi +Perl MAPI extension libraries by Zarafa. + +## +## MAPI PHP Extension +## +%package -n php-mapi +Summary: A PHP Mapi client by Zarafa +Group: Applications/Communications +# Bug: Without mod_ssl, reloading httpd causes core dump +Requires: mod_ssl +Requires: php >= 4.3 +Provides: php(mapi) = %{version}-%{release} + +%description -n php-mapi +PHP MAPI extension by Zarafa to enable MAPI communication in PHP. + +%prep +%setup -q +%patch0 -p1 -b .package +%patch1 -p1 -b .perl +%patch2 -p1 -b .symbol +%patch3 -p1 -b .chmod +#%%patch10 -p5 -b .brodowski + +# Needed to get rid of rpath +libtoolize --force +autoreconf --force --install + +%build +CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing -g -ggdb" +export CFLAGS +%configure \ + --with-userscript-prefix=%{_sysconfdir}/%{name}/userscripts \ + --with-quotatemplate-prefix=%{_sysconfdir}/%{name}/quotamail \ +%if 0%{?rhel} > 0 + --enable-release \ +%endif + --disable-static \ + --disable-testtools \ + --enable-perl +make %{?_smp_mflags} + +%install +rm -rf $RPM_BUILD_ROOT +make \ +%if 0%{?rhel} > 0 + docdir=%{_datadir}/doc/%{name}/ \ + datarootdir=%{_datadir} \ +%endif + DESTDIR=$RPM_BUILD_ROOT \ + INSTALL='install -p' \ + install + +# Nuke all overlefts from licensed, managed or other proprietary items +rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/report-ca +rm -f $RPM_BUILD_ROOT%{_mandir}/man?/zarafa-{backup,restore,ldapms.cfg,licensed{,.cfg}}.* + +# Move all the initscripts to their appropriate place and +# ensure that all services are off by default at boot time +mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/ +for service in server spooler dagent gateway monitor ical; do + if [ -f $RPM_BUILD_ROOT%{_datadir}/doc/%{name}/%{name}-$service.init.fc ]; then + sed -e 's@345@-@' $RPM_BUILD_ROOT%{_datadir}/doc/%{name}/%{name}-$service.init.fc > \ + $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/%{name}-$service + chmod 755 $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/%{name}-$service + touch -c -r $RPM_BUILD_ROOT{%{_datadir}/doc/%{name}/%{name}-$service.init.fc,%{_sysconfdir}/rc.d/init.d/%{name}-$service} + fi +done + +# Move the configuration files to their correct place and handle +# /usr/lib vs. /usr/lib64 for all architectures correct and set +# run_as_user, run_as_group and local_admin_users values correct +for config in $RPM_BUILD_ROOT%{_datadir}/doc/%{name}/*.cfg; do + config=$(basename $config) + if [ -f $RPM_BUILD_ROOT%{_datadir}/doc/%{name}/$config ]; then + sed -e 's@\(run_as_\(user\|group\)[[:space:]]*=\).*@\1 %{name}@' -e 's@/usr/lib/zarafa@%{_libdir}/%{name}@' \ + -e 's@\(local_admin_users[[:space:]]*=[[:space:]]*root.*\)@\1 %{name}@' \ + $RPM_BUILD_ROOT%{_datadir}/doc/%{name}/$config > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/$config + chmod 640 $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/$config + touch -c -r $RPM_BUILD_ROOT%{_datadir}/doc/%{name}/$config $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/$config + fi +done + +# Move the logrotate configuration file to it's correct place +mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/ +sed -e 's@\(}\)@ create 0644 %{name} %{name}\n\1@' -e '1,6d' \ + $RPM_BUILD_ROOT%{_datadir}/doc/%{name}/%{name}.logrotate > $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/%{name} +touch -c -r $RPM_BUILD_ROOT%{_datadir}/doc/%{name}/%{name}.logrotate $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/%{name} + +# Install the PHP module configuration file appropriate +mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/php.d/ +install -p -m 644 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/php.d/%{name}.ini + +# Create missing userscript directories for packaging them +mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/userscripts/{create,delete}{user,group,company}.d/ + +# Move the userscripts to their correct place and symlink them +mkdir -p $RPM_BUILD_ROOT%{_datadir}/%{name}/userscripts/ +for userscript in companies_common.sh groups_common.sh users_common.sh \ + createcompany creategroup createuser deletecompany deletegroup deleteuser; do + mv -f $RPM_BUILD_ROOT{%{_sysconfdir},%{_datadir}}/%{name}/userscripts/$userscript + ln -sf ../../..%{_datadir}/%{name}/userscripts/$userscript $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/userscripts/$userscript +done + +# Create the data directory and install some files into +mkdir -p $RPM_BUILD_ROOT%{_datadir}/%{name}/ +install -p -m 755 installer/linux/db-{calc-storesize,convert-attachments-to-files} $RPM_BUILD_ROOT%{_datadir}/%{name}/ +install -p -m 755 installer/linux/ssl-certificates.sh $RPM_BUILD_ROOT%{_datadir}/%{name}/ + +# Create the default log and lib directory for packaging +mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/{log,lib}/%{name}/ + +# Remove all libtool .la files to avoid packaging of them +rm -f $RPM_BUILD_ROOT%{_libdir}/{,php/modules,%{name}}/*.la + +# Remove files that are anyway in %doc or %{_datadir}/%{name}/ +rm -rf $RPM_BUILD_ROOT%{_datadir}/doc/%{name}/ + +%find_lang %{name} + +%clean +rm -rf $RPM_BUILD_ROOT + +%pre common +getent group %{name} > /dev/null || %{_sbindir}/groupadd -r %{name} +getent passwd %{name} > /dev/null || %{_sbindir}/useradd -r -g %{name} -d %{_localstatedir}/lib/%{name} -s /sbin/nologin -c "Zarafa Service Account" %{name} +exit 0 + +%post dagent +[ $1 -eq 1 ] && /sbin/chkconfig --add %{name}-dagent +# Ensure correct log file ownership after upgrade from official packages +chown %{name}:%{name} %{_localstatedir}/log/%{name}/dagent.* > /dev/null 2>&1 || : + +%post ical +[ $1 -eq 1 ] && /sbin/chkconfig --add %{name}-ical +# Ensure correct log file ownership after upgrade from official packages +chown %{name}:%{name} %{_localstatedir}/log/%{name}/ical.* > /dev/null 2>&1 || : + +%post gateway +[ $1 -eq 1 ] && /sbin/chkconfig --add %{name}-gateway +# Ensure correct log file ownership after upgrade from official packages +chown %{name}:%{name} %{_localstatedir}/log/%{name}/gateway.* > /dev/null 2>&1 || : + +%post monitor +[ $1 -eq 1 ] && /sbin/chkconfig --add %{name}-monitor +# Ensure correct log file ownership after upgrade from official packages +chown %{name}:%{name} %{_localstatedir}/log/%{name}/monitor.* > /dev/null 2>&1 || : + +%post server +[ $1 -eq 1 ] && /sbin/chkconfig --add %{name}-server +# Ensure correct log file ownership after upgrade from official packages +chown %{name}:%{name} %{_localstatedir}/log/%{name}/server.* > /dev/null 2>&1 || : + +%post spooler +[ $1 -eq 1 ] && /sbin/chkconfig --add %{name}-spooler +# Ensure correct log file ownership after upgrade from official packages +chown %{name}:%{name} %{_localstatedir}/log/%{name}/spooler.* > /dev/null 2>&1 || : + +%post -n libmapi -p /sbin/ldconfig + +%preun dagent +if [ $1 -eq 0 ]; then + /sbin/service %{name}-dagent stop > /dev/null 2>&1 || : + /sbin/chkconfig --del %{name}-dagent +fi + +%preun ical +if [ $1 -eq 0 ]; then + /sbin/service %{name}-ical stop > /dev/null 2>&1 || : + /sbin/chkconfig --del %{name}-ical +fi + +%preun gateway +if [ $1 -eq 0 ]; then + /sbin/service %{name}-gateway stop > /dev/null 2>&1 || : + /sbin/chkconfig --del %{name}-gateway +fi + +%preun monitor +if [ $1 -eq 0 ]; then + /sbin/service %{name}-monitor stop > /dev/null 2>&1 || : + /sbin/chkconfig --del %{name}-monitor +fi + +%preun server +if [ $1 -eq 0 ]; then + /sbin/service %{name}-server stop > /dev/null 2>&1 || : + /sbin/chkconfig --del %{name}-server +fi + +%preun spooler +if [ $1 -eq 0 ]; then + /sbin/service %{name}-spooler stop > /dev/null 2>&1 || : + /sbin/chkconfig --del %{name}-spooler +fi + +%postun dagent +if [ $1 -ne 0 ]; then + /sbin/service %{name}-dagent condrestart > /dev/null 2>&1 || : +fi + +%postun ical +if [ $1 -ne 0 ]; then + /sbin/service %{name}-ical condrestart > /dev/null 2>&1 || : +fi + +%postun gateway +if [ $1 -ne 0 ]; then + /sbin/service %{name}-gateway condrestart > /dev/null 2>&1 || : +fi + +%postun monitor +if [ $1 -ne 0 ]; then + /sbin/service %{name}-monitor condrestart > /dev/null 2>&1 || : +fi + +%postun server +if [ $1 -ne 0 ]; then + /sbin/service %{name}-server condrestart > /dev/null 2>&1 || : +fi + +%postun spooler +if [ $1 -ne 0 ]; then + /sbin/service %{name}-spooler condrestart > /dev/null 2>&1 || : +fi + +%postun -n libmapi -p /sbin/ldconfig + +%files +%defattr(-,root,root,-) +%doc installer/licenseagreement/AGPL-3 + +%files caldav +%defattr(-,root,root,-) +%doc installer/licenseagreement/AGPL-3 + +%files client +%defattr(-,root,root,-) +%doc installer/licenseagreement/AGPL-3 +%{_libdir}/libzarafaclient.so + +%files common +%defattr(-,root,root,-) +%doc installer/licenseagreement/AGPL-3 doc/performance-tuning.txt +%dir %{_sysconfdir}/%{name}/ +%config(noreplace) %{_sysconfdir}/logrotate.d/%{name} +%dir %{_libdir}/%{name}/ +%{_mandir}/man1/%{name}.1* +%dir %{_datadir}/%{name}/ +%dir %attr(0755,%{name},%{name}) %{_localstatedir}/lib/%{name}/ +%dir %attr(0755,%{name},%{name}) %{_localstatedir}/log/%{name}/ + +%files dagent +%defattr(-,root,root,-) +%doc installer/licenseagreement/AGPL-3 installer/linux/createuser.dotforward +%{_bindir}/%{name}-autorespond +%{_bindir}/%{name}-dagent +%config(noreplace) %attr(0640,%{name},%{name}) %{_sysconfdir}/%{name}/dagent.cfg +%{_sysconfdir}/rc.d/init.d/%{name}-dagent +%{_mandir}/man1/%{name}-dagent.1* +%{_mandir}/man5/%{name}-dagent.cfg.5* + +%files devel +%defattr(-,root,root,-) +%doc installer/licenseagreement/AGPL-3 +%{_libdir}/libicalmapi.so +%{_libdir}/libinetmapi.so +%{_libdir}/libmapi.so +%{_libdir}/libperlmapi.so +%{_libdir}/libcommon_mapi.a +%{_libdir}/libcommon_ssl.a +%{_libdir}/libcommon_util.a +%{_libdir}/libfreebusy.a +%{_includedir}/icalmapi/ +%{_includedir}/inetmapi/ +%{_includedir}/mapi4linux/ +%{_includedir}/%{name}/ +%{_libdir}/pkgconfig/%{name}.pc + +%files gateway +%defattr(-,root,root,-) +%doc installer/licenseagreement/AGPL-3 +%{_bindir}/%{name}-gateway +%config(noreplace) %attr(0640,%{name},%{name}) %{_sysconfdir}/%{name}/gateway.cfg +%{_sysconfdir}/rc.d/init.d/%{name}-gateway +%{_mandir}/man1/%{name}-gateway.1* +%{_mandir}/man5/%{name}-gateway.cfg.5* + +%files ical +%defattr(-,root,root,-) +%doc installer/licenseagreement/AGPL-3 +%{_bindir}/%{name}-ical +%config(noreplace) %attr(0640,%{name},%{name}) %{_sysconfdir}/%{name}/ical.cfg +%{_sysconfdir}/rc.d/init.d/%{name}-ical +%{_mandir}/man1/%{name}-ical.1* +%{_mandir}/man5/%{name}-ical.cfg.5* + +%files monitor +%defattr(-,root,root,-) +%doc installer/licenseagreement/AGPL-3 +%{_bindir}/%{name}-monitor +%config(noreplace) %attr(0640,%{name},%{name}) %{_sysconfdir}/%{name}/monitor.cfg +%dir %{_sysconfdir}/%{name}/quotamail/ +%config(noreplace) %{_sysconfdir}/%{name}/quotamail/companyhard.mail +%config(noreplace) %{_sysconfdir}/%{name}/quotamail/companysoft.mail +%config(noreplace) %{_sysconfdir}/%{name}/quotamail/companywarning.mail +%config(noreplace) %{_sysconfdir}/%{name}/quotamail/userhard.mail +%config(noreplace) %{_sysconfdir}/%{name}/quotamail/usersoft.mail +%config(noreplace) %{_sysconfdir}/%{name}/quotamail/userwarning.mail +%{_sysconfdir}/rc.d/init.d/%{name}-monitor +%{_mandir}/man1/%{name}-monitor.1* +%{_mandir}/man5/%{name}-monitor.cfg.5* + +%files server -f %{name}.lang +%defattr(-,root,root,-) +%doc installer/licenseagreement/AGPL-3 +%{_bindir}/%{name}-server +%config(noreplace) %attr(0640,%{name},%{name}) %{_sysconfdir}/%{name}/server.cfg +%config(noreplace) %attr(0640,%{name},%{name}) %{_sysconfdir}/%{name}/unix.cfg +%{_sysconfdir}/rc.d/init.d/%{name}-server +%dir %{_sysconfdir}/%{name}/userscripts/ +%{_sysconfdir}/%{name}/userscripts/createuser +%{_sysconfdir}/%{name}/userscripts/creategroup +%{_sysconfdir}/%{name}/userscripts/createcompany +%{_sysconfdir}/%{name}/userscripts/deleteuser +%{_sysconfdir}/%{name}/userscripts/deletegroup +%{_sysconfdir}/%{name}/userscripts/deletecompany +%{_sysconfdir}/%{name}/userscripts/*common.sh +%dir %{_sysconfdir}/%{name}/userscripts/createuser.d/ +%dir %{_sysconfdir}/%{name}/userscripts/creategroup.d/ +%dir %{_sysconfdir}/%{name}/userscripts/createcompany.d/ +%dir %{_sysconfdir}/%{name}/userscripts/deleteuser.d/ +%dir %{_sysconfdir}/%{name}/userscripts/deletegroup.d/ +%dir %{_sysconfdir}/%{name}/userscripts/deletecompany.d/ +%config(noreplace) %{_sysconfdir}/%{name}/userscripts/createcompany.d/00createpublic +%config(noreplace) %{_sysconfdir}/%{name}/userscripts/createuser.d/00createstore +%{_datadir}/%{name}/userscripts/ +%{_libdir}/%{name}/dbplugin.so +%{_libdir}/%{name}/unixplugin.so +%{_mandir}/man1/%{name}-server.1* +%{_mandir}/man5/%{name}-server.cfg.5* +%{_mandir}/man5/%{name}-unix.cfg.5* +%if %{with_ldap} +%doc installer/ldap/%{name}.schema +%config(noreplace) %attr(0640,%{name},%{name}) %{_sysconfdir}/%{name}/ldap.active-directory.cfg +%config(noreplace) %attr(0640,%{name},%{name}) %{_sysconfdir}/%{name}/ldap.openldap.cfg +%{_libdir}/%{name}/ldapplugin.so +%{_mandir}/man5/%{name}-ldap.cfg.5* +%endif + +%files spooler +%defattr(-,root,root,-) +%doc installer/licenseagreement/AGPL-3 +%{_bindir}/%{name}-spooler +%config(noreplace) %attr(0640,%{name},%{name}) %{_sysconfdir}/%{name}/spooler.cfg +%{_sysconfdir}/rc.d/init.d/%{name}-spooler +%{_mandir}/man1/%{name}-spooler.1* +%{_mandir}/man5/%{name}-spooler.cfg.5* + +%files utils +%defattr(-,root,root,-) +%doc installer/licenseagreement/AGPL-3 +%{_bindir}/%{name}-admin +%{_bindir}/%{name}-fsck +%{_bindir}/%{name}-passwd +%{_bindir}/%{name}-stats +%{_datadir}/%{name}/db-calc-storesize +%{_datadir}/%{name}/db-convert-attachments-to-files +%{_datadir}/%{name}/ssl-certificates.sh +%{_mandir}/man1/%{name}-admin.1* +%{_mandir}/man1/%{name}-fsck.1* +%{_mandir}/man1/%{name}-passwd.1* +%{_mandir}/man1/%{name}-stats.1* + +%files -n libmapi +%defattr(-,root,root,-) +%doc installer/licenseagreement/AGPL-3 +%{_libdir}/libicalmapi.so.* +%{_libdir}/libinetmapi.so.* +%{_libdir}/libmapi.so.* + +%files -n perl-libmapi +%defattr(-,root,root,-) +%doc installer/licenseagreement/AGPL-3 +%{_libdir}/libperlmapi.so.* + +%files -n php-mapi +%defattr(-,root,root,-) +%doc installer/licenseagreement/AGPL-3 +%config(noreplace) %{_sysconfdir}/php.d/%{name}.ini +%{_datadir}/php/mapi/ +%if 0%{?rhel}%{?fedora} > 4 +%{_libdir}/php/modules/mapi.so +%else +%{_libdir}/php4/mapi.so +%endif + +%changelog +* Sat Feb 06 2010 Robert Scheck 6.30.10-1 +- Upgrade to 6.30.10 (#498194) +- Initial spec file for Fedora and Red Hat Enterprise Linux (thanks + to Jeroen van Meeuwen, John van der Kamp and Steve Hardy) From 51e3570083d054f3453c35c4f8c443bfb86b9319 Mon Sep 17 00:00:00 2001 From: Robert Scheck Date: Tue, 23 Feb 2010 21:24:36 +0000 Subject: [PATCH 02/23] - Backported a patch from trunk to avoid the crash of zarafa-server when creating new user with db or unix plugin (#564282, #567262) - Backported another patch from trunk to avoid the crash of httpd caused by PHP mapi.so during the logon in the webaccess (#564129) --- zarafa-6.30.10-fortify.patch | 36 ++++++++++ zarafa-6.30.10-long-ulong.patch | 123 ++++++++++++++++++++++++++++++++ zarafa.spec | 15 +++- 3 files changed, 172 insertions(+), 2 deletions(-) create mode 100644 zarafa-6.30.10-fortify.patch create mode 100644 zarafa-6.30.10-long-ulong.patch diff --git a/zarafa-6.30.10-fortify.patch b/zarafa-6.30.10-fortify.patch new file mode 100644 index 0000000..3a4a4a1 --- /dev/null +++ b/zarafa-6.30.10-fortify.patch @@ -0,0 +1,36 @@ +Remerged changeset of Subversion Revision 18952 from 6.40.0 (trunk) to 6.30.10 + +--- zarafa-6.30.10/provider/common/ZarafaUtil.cpp 2010-01-26 17:34:51.000000000 +0100 ++++ zarafa-6.30.10/provider/common/ZarafaUtil.cpp.fortify 2010-02-22 15:52:11.000000000 +0100 +@@ -355,7 +355,8 @@ + if (!strExternId.empty()) + { + lpUserEid->ulVersion = 1; +- lstrcpy(lpUserEid->szExId, strEncExId.c_str()); ++ // avoid FORTIFY_SOURCE checks in strcpy to an address that the compiler thinks is 1 size large ++ memcpy(lpUserEid->szExId, strEncExId.c_str(), strEncExId.length()+1); + } + + lpsEntryId->__size = ulLen; +--- zarafa-6.30.10/provider/libserver/ECUserManagement.cpp 2010-01-26 17:34:51.000000000 +0100 ++++ zarafa-6.30.10/provider/libserver/ECUserManagement.cpp.fortify 2010-02-22 16:03:33.000000000 +0100 +@@ -4152,7 +4152,8 @@ + if (!strEncExId.empty()) + { + lpAbeid->ulVersion = 1; +- strcpy(lpAbeid->szExId, strEncExId.c_str()); ++ // avoid FORTIFY_SOURCE checks in strcpy to an address that the compiler thinks is 1 size large ++ memcpy(lpAbeid->szExId, strEncExId.c_str(), strEncExId.length()+1); + } + + *lpsSourceKey = SOURCEKEY(ulLen, (char*)lpAbeid); +@@ -4190,7 +4191,8 @@ + memset(lpEid, 0, CbNewABEID(strEncExId.c_str())); + + lpEid->ulVersion = 1; +- lstrcpy(lpEid->szExId, strEncExId.c_str()); ++ // avoid FORTIFY_SOURCE checks in strcpy to an address that the compiler thinks is 1 size large ++ memcpy(lpEid->szExId, strEncExId.c_str(), strEncExId.length()+1); + + } + diff --git a/zarafa-6.30.10-long-ulong.patch b/zarafa-6.30.10-long-ulong.patch new file mode 100644 index 0000000..97e07e0 --- /dev/null +++ b/zarafa-6.30.10-long-ulong.patch @@ -0,0 +1,123 @@ +Remerged changeset of Subversion Revision 18968 from 6.40.0 (trunk) to 6.30.10 + +--- zarafa-6.30.10/php-ext/main.cpp 2010-01-26 17:34:48.000000000 +0100 ++++ zarafa-6.30.10/php-ext/main.cpp.php.long-ulong 2010-02-23 20:39:15.000000000 +0100 +@@ -2125,10 +2125,11 @@ + { + // params + zval * res; +- LPMAPITABLE lpTable = NULL; + zval * sortArray; ++ long ulFlags = 0; ++ // local ++ LPMAPITABLE lpTable = NULL; + LPSSortOrderSet lpSortCriteria = NULL; +- ULONG ulFlags = 0; + + RETVAL_FALSE; + MAPI_G(hr) = hrSuccess; +@@ -2189,10 +2190,11 @@ + { + // params + zval *res; ++ zval *restrictionArray; ++ ulong ulFlags = 0; ++ // local + LPMAPITABLE lpTable = NULL; +- zval *restrictionArray; + LPSRestriction lpRestrict = NULL; +- ULONG ulFlags = 0; + + RETVAL_FALSE; + MAPI_G(hr) = hrSuccess; +@@ -2213,7 +2215,7 @@ + } + } + +- MAPI_G(hr) = lpTable->Restrict(lpRestrict, ulFlags); // TODO: set flags from php? ++ MAPI_G(hr) = lpTable->Restrict(lpRestrict, ulFlags); + if(MAPI_G(hr) != hrSuccess) + goto exit; + +@@ -3696,11 +3698,13 @@ + } + + ZEND_FUNCTION(mapi_folder_getsearchcriteria) { ++ // params + zval *res = NULL; + zval *restriction = NULL; + zval *folderlist = NULL; + LPMAPIFOLDER lpFolder = NULL; + long ulFlags = 0; ++ // local + LPSRestriction lpRestriction = NULL; + LPENTRYLIST lpFolderList = NULL; + ULONG ulSearchState = 0; +@@ -3734,13 +3738,15 @@ + } + + ZEND_FUNCTION(mapi_folder_setsearchcriteria) { +- LPMAPIFOLDER lpFolder = NULL; +- LPENTRYLIST lpFolderList = NULL; +- LPSRestriction lpRestriction = NULL; +- long ulFlags = 0; ++ // param + zval *res = NULL; + zval *restriction = NULL; + zval *folderlist = NULL; ++ long ulFlags = 0; ++ // local ++ LPMAPIFOLDER lpFolder = NULL; ++ LPENTRYLIST lpFolderList = NULL; ++ LPSRestriction lpRestriction = NULL; + + RETVAL_FALSE; + MAPI_G(hr) = hrSuccess; +@@ -6396,9 +6402,11 @@ + + ZEND_FUNCTION(mapi_freebusyupdate_publish) + { ++ // params ++ zval* resFBUpdate = NULL; + zval* aBlocks = NULL; + IFreeBusyUpdate* lpFBUpdate = NULL; +- zval* resFBUpdate = NULL; ++ // local + FBBlock_1* lpBlocks = NULL; + ULONG cBlocks = 0; + HashTable* target_hash = NULL; +@@ -6495,12 +6503,14 @@ + + ZEND_FUNCTION(mapi_freebusyupdate_savechanges) + { +- IFreeBusyUpdate* lpFBUpdate = NULL; ++ // params + zval* resFBUpdate = NULL; +- FILETIME ftmStart; +- FILETIME ftmEnd; + time_t ulUnixStart = 0; + time_t ulUnixEnd = 0; ++ IFreeBusyUpdate* lpFBUpdate = NULL; ++ // local ++ FILETIME ftmStart; ++ FILETIME ftmEnd; + + RETVAL_FALSE; + MAPI_G(hr) = hrSuccess; +@@ -6523,13 +6533,14 @@ + + ZEND_FUNCTION(mapi_favorite_add) + { ++ // params + zval * resSession = NULL; + zval * resFolder = NULL; + Session *lpSession = NULL; +- LPMAPIFOLDER lpShortCutFolder = NULL; +- + LPMAPIFOLDER lpFolder = NULL; + long ulFlags = 0; ++ // local ++ LPMAPIFOLDER lpShortCutFolder = NULL; + ULONG cbAliasName = 0; + LPSTR lpszAliasName = NULL; + diff --git a/zarafa.spec b/zarafa.spec index a034b78..fae8eb8 100644 --- a/zarafa.spec +++ b/zarafa.spec @@ -116,7 +116,7 @@ # %define beta_or_rc 0 -%define actual_release 1 +%define actual_release 2 %define svnrevision 18495 %define with_ldap 1 %define with_xmlto 1 @@ -146,6 +146,9 @@ Patch0: zarafa-6.30.4-package.patch Patch1: zarafa-6.30.4-perl.patch Patch2: zarafa-6.30.10-undefined-symbol.patch Patch3: zarafa-6.30.10-chmod.patch +# Patch 4 and 5 are backports from upstream +Patch4: zarafa-6.30.10-fortify.patch +Patch5: zarafa-6.30.10-long-ulong.patch # http://www.brodowski.org/zarafa/php-mapi/6.30.10.18495/18495_patch.diff Patch10: zarafa-6.30.4-brodowski.patch @@ -198,7 +201,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} - %description Zarafa Outlook Sharing is a Microsoft Exchange replacement. The Open Source Collaboration provides an integration with your existing Linux mail server, -native mobile phone support by ActiveSync compatiblity and a webaccess with +native mobile phone support by ActiveSync compatibility and a webaccess with 'Look & Feel' similar to Outlook using Ajax. Including an IMAP4 and a POP3 gateway as well as an iCal/CalDAV gateway, Zarafa can combine the usability with the stability and flexibility of a Linux server. @@ -442,6 +445,8 @@ PHP MAPI extension by Zarafa to enable MAPI communication in PHP. %patch1 -p1 -b .perl %patch2 -p1 -b .symbol %patch3 -p1 -b .chmod +%patch4 -p1 -b .fortify +%patch5 -p1 -b .long-ulong #%%patch10 -p5 -b .brodowski # Needed to get rid of rpath @@ -818,6 +823,12 @@ fi %endif %changelog +* Tue Feb 23 2010 Robert Scheck 6.30.10-2 +- Backported a patch from trunk to avoid the crash of zarafa-server + when creating new user with db or unix plugin (#564282, #567262) +- Backported another patch from trunk to avoid the crash of httpd + caused by PHP mapi.so during the logon in the webaccess (#564129) + * Sat Feb 06 2010 Robert Scheck 6.30.10-1 - Upgrade to 6.30.10 (#498194) - Initial spec file for Fedora and Red Hat Enterprise Linux (thanks From c5242c3fa371011f2885d6ffcd24d087bd7691de Mon Sep 17 00:00:00 2001 From: Robert Scheck Date: Thu, 18 Mar 2010 23:33:22 +0000 Subject: [PATCH 03/23] Upgrade to 6.30.11 --- .cvsignore | 2 +- sources | 2 +- zarafa.spec | 11 +++++++---- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.cvsignore b/.cvsignore index 0e7e07b..2272e42 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -zarafa-6.30.10.tar.gz +zarafa-6.30.11.tar.gz diff --git a/sources b/sources index 2a2ea20..596764d 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -da636f09fb149cf60db1c6f91a734ca3 zarafa-6.30.10.tar.gz +bb5ba3037499dfd85ae509e02534924b zarafa-6.30.11.tar.gz diff --git a/zarafa.spec b/zarafa.spec index fae8eb8..e3ad186 100644 --- a/zarafa.spec +++ b/zarafa.spec @@ -116,14 +116,14 @@ # %define beta_or_rc 0 -%define actual_release 2 -%define svnrevision 18495 +%define actual_release 1 +%define svnrevision 18984 %define with_ldap 1 %define with_xmlto 1 Summary: Zarafa Outlook Sharing and Open Source Collaboration Name: zarafa -Version: 6.30.10 +Version: 6.30.11 %if %{beta_or_rc} Release: 0.%{actual_release}.svn%{svnrevision}%{?dist} %else @@ -480,7 +480,7 @@ make \ # Nuke all overlefts from licensed, managed or other proprietary items rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/report-ca -rm -f $RPM_BUILD_ROOT%{_mandir}/man?/zarafa-{backup,restore,ldapms.cfg,licensed{,.cfg}}.* +rm -f $RPM_BUILD_ROOT%{_mandir}/man?/zarafa-{backup,restore,report,ldapms.cfg,licensed{,.cfg}}.* # Move all the initscripts to their appropriate place and # ensure that all services are off by default at boot time @@ -823,6 +823,9 @@ fi %endif %changelog +* Fri Mar 19 2010 Robert Scheck 6.30.11-1 +- Upgrade to 6.30.11 + * Tue Feb 23 2010 Robert Scheck 6.30.10-2 - Backported a patch from trunk to avoid the crash of zarafa-server when creating new user with db or unix plugin (#564282, #567262) From e00d77bd882d3df0242624687eb9bc6e7e6f0dbb Mon Sep 17 00:00:00 2001 From: Robert Scheck Date: Sat, 20 Mar 2010 11:54:39 +0000 Subject: [PATCH 04/23] Upgrade to 6.30.12 --- .cvsignore | 2 +- sources | 2 +- zarafa.spec | 7 +++++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.cvsignore b/.cvsignore index 2272e42..69f5881 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -zarafa-6.30.11.tar.gz +zarafa-6.30.12.tar.gz diff --git a/sources b/sources index 596764d..d2e9a9a 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -bb5ba3037499dfd85ae509e02534924b zarafa-6.30.11.tar.gz +959801e02912fbc6b74dd2b3ac3a599d zarafa-6.30.12.tar.gz diff --git a/zarafa.spec b/zarafa.spec index e3ad186..8f1cb99 100644 --- a/zarafa.spec +++ b/zarafa.spec @@ -117,13 +117,13 @@ %define beta_or_rc 0 %define actual_release 1 -%define svnrevision 18984 +%define svnrevision 19435 %define with_ldap 1 %define with_xmlto 1 Summary: Zarafa Outlook Sharing and Open Source Collaboration Name: zarafa -Version: 6.30.11 +Version: 6.30.12 %if %{beta_or_rc} Release: 0.%{actual_release}.svn%{svnrevision}%{?dist} %else @@ -823,6 +823,9 @@ fi %endif %changelog +* Sat Mar 20 2010 Robert Scheck 6.30.12-1 +- Upgrade to 6.30.12 + * Fri Mar 19 2010 Robert Scheck 6.30.11-1 - Upgrade to 6.30.11 From aea372d81c4923ca66674dc438acab573728e772 Mon Sep 17 00:00:00 2001 From: Robert Scheck Date: Sun, 25 Apr 2010 17:06:16 +0000 Subject: [PATCH 05/23] - Upgrade to 6.30.13 - Moved zarafa.schema file from %doc to %{_datadir}/%{name} --- .cvsignore | 2 +- sources | 2 +- zarafa-6.30.10-fortify.patch | 36 ---------- zarafa-6.30.10-long-ulong.patch | 123 -------------------------------- zarafa.spec | 16 ++--- 5 files changed, 10 insertions(+), 169 deletions(-) delete mode 100644 zarafa-6.30.10-fortify.patch delete mode 100644 zarafa-6.30.10-long-ulong.patch diff --git a/.cvsignore b/.cvsignore index 69f5881..d2059e6 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -zarafa-6.30.12.tar.gz +zarafa-6.30.13.tar.gz diff --git a/sources b/sources index d2e9a9a..7519e15 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -959801e02912fbc6b74dd2b3ac3a599d zarafa-6.30.12.tar.gz +50b4399ace1499bc9175fcaa26571c7b zarafa-6.30.13.tar.gz diff --git a/zarafa-6.30.10-fortify.patch b/zarafa-6.30.10-fortify.patch deleted file mode 100644 index 3a4a4a1..0000000 --- a/zarafa-6.30.10-fortify.patch +++ /dev/null @@ -1,36 +0,0 @@ -Remerged changeset of Subversion Revision 18952 from 6.40.0 (trunk) to 6.30.10 - ---- zarafa-6.30.10/provider/common/ZarafaUtil.cpp 2010-01-26 17:34:51.000000000 +0100 -+++ zarafa-6.30.10/provider/common/ZarafaUtil.cpp.fortify 2010-02-22 15:52:11.000000000 +0100 -@@ -355,7 +355,8 @@ - if (!strExternId.empty()) - { - lpUserEid->ulVersion = 1; -- lstrcpy(lpUserEid->szExId, strEncExId.c_str()); -+ // avoid FORTIFY_SOURCE checks in strcpy to an address that the compiler thinks is 1 size large -+ memcpy(lpUserEid->szExId, strEncExId.c_str(), strEncExId.length()+1); - } - - lpsEntryId->__size = ulLen; ---- zarafa-6.30.10/provider/libserver/ECUserManagement.cpp 2010-01-26 17:34:51.000000000 +0100 -+++ zarafa-6.30.10/provider/libserver/ECUserManagement.cpp.fortify 2010-02-22 16:03:33.000000000 +0100 -@@ -4152,7 +4152,8 @@ - if (!strEncExId.empty()) - { - lpAbeid->ulVersion = 1; -- strcpy(lpAbeid->szExId, strEncExId.c_str()); -+ // avoid FORTIFY_SOURCE checks in strcpy to an address that the compiler thinks is 1 size large -+ memcpy(lpAbeid->szExId, strEncExId.c_str(), strEncExId.length()+1); - } - - *lpsSourceKey = SOURCEKEY(ulLen, (char*)lpAbeid); -@@ -4190,7 +4191,8 @@ - memset(lpEid, 0, CbNewABEID(strEncExId.c_str())); - - lpEid->ulVersion = 1; -- lstrcpy(lpEid->szExId, strEncExId.c_str()); -+ // avoid FORTIFY_SOURCE checks in strcpy to an address that the compiler thinks is 1 size large -+ memcpy(lpEid->szExId, strEncExId.c_str(), strEncExId.length()+1); - - } - diff --git a/zarafa-6.30.10-long-ulong.patch b/zarafa-6.30.10-long-ulong.patch deleted file mode 100644 index 97e07e0..0000000 --- a/zarafa-6.30.10-long-ulong.patch +++ /dev/null @@ -1,123 +0,0 @@ -Remerged changeset of Subversion Revision 18968 from 6.40.0 (trunk) to 6.30.10 - ---- zarafa-6.30.10/php-ext/main.cpp 2010-01-26 17:34:48.000000000 +0100 -+++ zarafa-6.30.10/php-ext/main.cpp.php.long-ulong 2010-02-23 20:39:15.000000000 +0100 -@@ -2125,10 +2125,11 @@ - { - // params - zval * res; -- LPMAPITABLE lpTable = NULL; - zval * sortArray; -+ long ulFlags = 0; -+ // local -+ LPMAPITABLE lpTable = NULL; - LPSSortOrderSet lpSortCriteria = NULL; -- ULONG ulFlags = 0; - - RETVAL_FALSE; - MAPI_G(hr) = hrSuccess; -@@ -2189,10 +2190,11 @@ - { - // params - zval *res; -+ zval *restrictionArray; -+ ulong ulFlags = 0; -+ // local - LPMAPITABLE lpTable = NULL; -- zval *restrictionArray; - LPSRestriction lpRestrict = NULL; -- ULONG ulFlags = 0; - - RETVAL_FALSE; - MAPI_G(hr) = hrSuccess; -@@ -2213,7 +2215,7 @@ - } - } - -- MAPI_G(hr) = lpTable->Restrict(lpRestrict, ulFlags); // TODO: set flags from php? -+ MAPI_G(hr) = lpTable->Restrict(lpRestrict, ulFlags); - if(MAPI_G(hr) != hrSuccess) - goto exit; - -@@ -3696,11 +3698,13 @@ - } - - ZEND_FUNCTION(mapi_folder_getsearchcriteria) { -+ // params - zval *res = NULL; - zval *restriction = NULL; - zval *folderlist = NULL; - LPMAPIFOLDER lpFolder = NULL; - long ulFlags = 0; -+ // local - LPSRestriction lpRestriction = NULL; - LPENTRYLIST lpFolderList = NULL; - ULONG ulSearchState = 0; -@@ -3734,13 +3738,15 @@ - } - - ZEND_FUNCTION(mapi_folder_setsearchcriteria) { -- LPMAPIFOLDER lpFolder = NULL; -- LPENTRYLIST lpFolderList = NULL; -- LPSRestriction lpRestriction = NULL; -- long ulFlags = 0; -+ // param - zval *res = NULL; - zval *restriction = NULL; - zval *folderlist = NULL; -+ long ulFlags = 0; -+ // local -+ LPMAPIFOLDER lpFolder = NULL; -+ LPENTRYLIST lpFolderList = NULL; -+ LPSRestriction lpRestriction = NULL; - - RETVAL_FALSE; - MAPI_G(hr) = hrSuccess; -@@ -6396,9 +6402,11 @@ - - ZEND_FUNCTION(mapi_freebusyupdate_publish) - { -+ // params -+ zval* resFBUpdate = NULL; - zval* aBlocks = NULL; - IFreeBusyUpdate* lpFBUpdate = NULL; -- zval* resFBUpdate = NULL; -+ // local - FBBlock_1* lpBlocks = NULL; - ULONG cBlocks = 0; - HashTable* target_hash = NULL; -@@ -6495,12 +6503,14 @@ - - ZEND_FUNCTION(mapi_freebusyupdate_savechanges) - { -- IFreeBusyUpdate* lpFBUpdate = NULL; -+ // params - zval* resFBUpdate = NULL; -- FILETIME ftmStart; -- FILETIME ftmEnd; - time_t ulUnixStart = 0; - time_t ulUnixEnd = 0; -+ IFreeBusyUpdate* lpFBUpdate = NULL; -+ // local -+ FILETIME ftmStart; -+ FILETIME ftmEnd; - - RETVAL_FALSE; - MAPI_G(hr) = hrSuccess; -@@ -6523,13 +6533,14 @@ - - ZEND_FUNCTION(mapi_favorite_add) - { -+ // params - zval * resSession = NULL; - zval * resFolder = NULL; - Session *lpSession = NULL; -- LPMAPIFOLDER lpShortCutFolder = NULL; -- - LPMAPIFOLDER lpFolder = NULL; - long ulFlags = 0; -+ // local -+ LPMAPIFOLDER lpShortCutFolder = NULL; - ULONG cbAliasName = 0; - LPSTR lpszAliasName = NULL; - diff --git a/zarafa.spec b/zarafa.spec index 8f1cb99..719f618 100644 --- a/zarafa.spec +++ b/zarafa.spec @@ -117,13 +117,13 @@ %define beta_or_rc 0 %define actual_release 1 -%define svnrevision 19435 +%define svnrevision 19788 %define with_ldap 1 %define with_xmlto 1 Summary: Zarafa Outlook Sharing and Open Source Collaboration Name: zarafa -Version: 6.30.12 +Version: 6.30.13 %if %{beta_or_rc} Release: 0.%{actual_release}.svn%{svnrevision}%{?dist} %else @@ -146,9 +146,6 @@ Patch0: zarafa-6.30.4-package.patch Patch1: zarafa-6.30.4-perl.patch Patch2: zarafa-6.30.10-undefined-symbol.patch Patch3: zarafa-6.30.10-chmod.patch -# Patch 4 and 5 are backports from upstream -Patch4: zarafa-6.30.10-fortify.patch -Patch5: zarafa-6.30.10-long-ulong.patch # http://www.brodowski.org/zarafa/php-mapi/6.30.10.18495/18495_patch.diff Patch10: zarafa-6.30.4-brodowski.patch @@ -445,8 +442,6 @@ PHP MAPI extension by Zarafa to enable MAPI communication in PHP. %patch1 -p1 -b .perl %patch2 -p1 -b .symbol %patch3 -p1 -b .chmod -%patch4 -p1 -b .fortify -%patch5 -p1 -b .long-ulong #%%patch10 -p5 -b .brodowski # Needed to get rid of rpath @@ -533,6 +528,7 @@ done mkdir -p $RPM_BUILD_ROOT%{_datadir}/%{name}/ install -p -m 755 installer/linux/db-{calc-storesize,convert-attachments-to-files} $RPM_BUILD_ROOT%{_datadir}/%{name}/ install -p -m 755 installer/linux/ssl-certificates.sh $RPM_BUILD_ROOT%{_datadir}/%{name}/ +install -p -m 644 installer/ldap/%{name}.schema $RPM_BUILD_ROOT%{_datadir}/%{name}/ # Create the default log and lib directory for packaging mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/{log,lib}/%{name}/ @@ -768,7 +764,7 @@ fi %{_mandir}/man5/%{name}-server.cfg.5* %{_mandir}/man5/%{name}-unix.cfg.5* %if %{with_ldap} -%doc installer/ldap/%{name}.schema +%{_datadir}/%{name}/%{name}.schema %config(noreplace) %attr(0640,%{name},%{name}) %{_sysconfdir}/%{name}/ldap.active-directory.cfg %config(noreplace) %attr(0640,%{name},%{name}) %{_sysconfdir}/%{name}/ldap.openldap.cfg %{_libdir}/%{name}/ldapplugin.so @@ -823,6 +819,10 @@ fi %endif %changelog +* Sun Apr 25 2010 Robert Scheck 6.30.13-1 +- Upgrade to 6.30.13 +- Moved zarafa.schema file from %%doc to %%{_datadir}/%%{name} + * Sat Mar 20 2010 Robert Scheck 6.30.12-1 - Upgrade to 6.30.12 From 66ffd749955c7e5b1f35e7a2f240c71312999bc5 Mon Sep 17 00:00:00 2001 From: Robert Scheck Date: Sat, 1 May 2010 12:14:13 +0000 Subject: [PATCH 06/23] Upgrade to 6.30.14 --- .cvsignore | 2 +- sources | 2 +- zarafa.spec | 7 +++++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.cvsignore b/.cvsignore index d2059e6..7bd5793 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -zarafa-6.30.13.tar.gz +zarafa-6.30.14.tar.gz diff --git a/sources b/sources index 7519e15..8af1e15 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -50b4399ace1499bc9175fcaa26571c7b zarafa-6.30.13.tar.gz +fa3183f71027b8025373b05f27aaf742 zarafa-6.30.14.tar.gz diff --git a/zarafa.spec b/zarafa.spec index 719f618..ea52ca7 100644 --- a/zarafa.spec +++ b/zarafa.spec @@ -117,13 +117,13 @@ %define beta_or_rc 0 %define actual_release 1 -%define svnrevision 19788 +%define svnrevision 20002 %define with_ldap 1 %define with_xmlto 1 Summary: Zarafa Outlook Sharing and Open Source Collaboration Name: zarafa -Version: 6.30.13 +Version: 6.30.14 %if %{beta_or_rc} Release: 0.%{actual_release}.svn%{svnrevision}%{?dist} %else @@ -819,6 +819,9 @@ fi %endif %changelog +* Sat May 01 2010 Robert Scheck 6.30.14-1 +- Upgrade to 6.30.14 + * Sun Apr 25 2010 Robert Scheck 6.30.13-1 - Upgrade to 6.30.13 - Moved zarafa.schema file from %%doc to %%{_datadir}/%%{name} From ed8b9ffbb52b642afa5756aee4b6856d6921a886 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Sat, 8 May 2010 02:30:00 +0000 Subject: [PATCH 07/23] Initialize branch EL-6 for zarafa --- branch | 1 + 1 file changed, 1 insertion(+) create mode 100644 branch diff --git a/branch b/branch new file mode 100644 index 0000000..46381b9 --- /dev/null +++ b/branch @@ -0,0 +1 @@ +EL-6 From 6b6e7ac724ced325c9b7ff6c6e4068416c3bcf8d Mon Sep 17 00:00:00 2001 From: Robert Scheck Date: Wed, 19 May 2010 21:39:14 +0000 Subject: [PATCH 08/23] Replace the upcoming %if/%else macro stuff by what is really required --- zarafa.spec | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/zarafa.spec b/zarafa.spec index ea52ca7..9673ffb 100644 --- a/zarafa.spec +++ b/zarafa.spec @@ -162,18 +162,9 @@ BuildRequires: ncurses-devel BuildRequires: pam-devel BuildRequires: php-devel BuildRequires: libtool, automake, autoconf - -%if 0%{?fedora} > 8 -BuildRequires: libcurl-devel -BuildRequires: perl-devel -%else -BuildRequires: curl-devel -BuildRequires: perl -%endif - -%if 0%{?fedora} >= 12 -BuildRequires: libuuid-devel -%endif +BuildRequires: %{_includedir}/uuid/uuid.h +BuildRequires: %{_includedir}/curl/curl.h +BuildRequires: %{_bindir}/xsubpp %if %{with_ldap} BuildRequires: openldap-devel From a8e3bdc46e26a337713149d63fd7e27ed1e74d3f Mon Sep 17 00:00:00 2001 From: Robert Scheck Date: Thu, 10 Jun 2010 22:13:44 +0000 Subject: [PATCH 09/23] - Added patch to ensure -pthread for -lclucene configure test - Upgrade to 6.40.0 (#564135, #565252, #600993) --- .cvsignore | 2 +- sources | 2 +- zarafa-6.30.10-chmod.patch | 13 - zarafa-6.30.10-undefined-symbol.patch | 35 -- zarafa-6.30.4-brodowski.patch | 774 -------------------------- zarafa-6.30.4-package.patch | 48 -- zarafa-6.30.4-perl.patch | 53 -- zarafa-6.40.0-clucene.patch | 56 ++ zarafa-6.40.0-krb5.patch | 20 + zarafa-6.40.0-openssl.patch | 23 + zarafa-6.40.0-package.patch | 61 ++ zarafa-6.40.0-pthread.patch | 59 ++ zarafa-6.40.0-undefined-symbol.patch | 42 ++ zarafa-webaccess.conf | 32 ++ zarafa.logrotate | 13 + zarafa.spec | 501 ++++++++++++----- 16 files changed, 655 insertions(+), 1079 deletions(-) delete mode 100644 zarafa-6.30.10-chmod.patch delete mode 100644 zarafa-6.30.10-undefined-symbol.patch delete mode 100644 zarafa-6.30.4-brodowski.patch delete mode 100644 zarafa-6.30.4-package.patch delete mode 100644 zarafa-6.30.4-perl.patch create mode 100644 zarafa-6.40.0-clucene.patch create mode 100644 zarafa-6.40.0-krb5.patch create mode 100644 zarafa-6.40.0-openssl.patch create mode 100644 zarafa-6.40.0-package.patch create mode 100644 zarafa-6.40.0-pthread.patch create mode 100644 zarafa-6.40.0-undefined-symbol.patch create mode 100644 zarafa-webaccess.conf create mode 100644 zarafa.logrotate diff --git a/.cvsignore b/.cvsignore index 7bd5793..86578d6 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -zarafa-6.30.14.tar.gz +zarafa-6.40.0.tar.gz diff --git a/sources b/sources index 8af1e15..5c51e95 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -fa3183f71027b8025373b05f27aaf742 zarafa-6.30.14.tar.gz +389d195eb7659ccd05769208686e4b0d zarafa-6.40.0.tar.gz diff --git a/zarafa-6.30.10-chmod.patch b/zarafa-6.30.10-chmod.patch deleted file mode 100644 index ef7a706..0000000 --- a/zarafa-6.30.10-chmod.patch +++ /dev/null @@ -1,13 +0,0 @@ -Patch by Robert Scheck for zarafa >= 6.30.10, which adds a missing include for -the later in the code used chmod() command. Without this include, building on Fedora 13 fails. - ---- zarafa-6.30.10/provider/server/ECSoapServerConnection.cpp 2010-01-26 17:34:51.000000000 +0100 -+++ zarafa-6.30.10/provider/server/ECSoapServerConnection.cpp.chmod 2010-02-06 12:36:22.000000000 +0100 -@@ -51,6 +51,7 @@ - - #include "ECLogger.h" - -+#include - #ifdef HAVE_SYS_UN_H - #include - #endif diff --git a/zarafa-6.30.10-undefined-symbol.patch b/zarafa-6.30.10-undefined-symbol.patch deleted file mode 100644 index c4b2083..0000000 --- a/zarafa-6.30.10-undefined-symbol.patch +++ /dev/null @@ -1,35 +0,0 @@ -diff -ur zarafa-6.30.10.orig/mapi4linux/src/m4lguids.cpp zarafa-6.30.10/mapi4linux/src/m4lguids.cpp ---- zarafa-6.30.10.orig/mapi4linux/src/m4lguids.cpp 2010-01-26 17:34:48.000000000 +0100 -+++ zarafa-6.30.10/mapi4linux/src/m4lguids.cpp 2010-02-04 09:53:48.459239670 +0100 -@@ -48,6 +48,7 @@ - */ - - #include "platform.h" -+/*#ifndef WINCE - #define USES_IID_IUnknown - #define USES_IID_IStream - #define USES_IID_ISequentialStream -@@ -60,7 +61,8 @@ - #define USES_IID_IMAPIProp - #define USES_IID_IMAPIFolder - #define USES_IID_IMAPITable -+#endif - #include -- -+*/ - #include "mapiguid.h" - #include "m4l.mapiutil.h" -diff -ur zarafa-6.30.10.orig/mapi4linux/src/Makefile.am zarafa-6.30.10/mapi4linux/src/Makefile.am ---- zarafa-6.30.10.orig/mapi4linux/src/Makefile.am 2010-01-26 12:05:22.000000000 +0100 -+++ zarafa-6.30.10/mapi4linux/src/Makefile.am 2010-02-04 09:51:39.285239878 +0100 -@@ -3,7 +3,9 @@ - AM_CPPFLAGS = $(DEBUGFLAGS) -DLINUX -I$(top_srcdir)/mapi4linux/include -I$(top_srcdir)/provider/common -I${top_srcdir}/common -I${top_srcdir}/libfreebusy - AM_LDFLAGS = $(DL_LIBS) -export-symbols ${top_srcdir}/mapi4linux/src/mapi-exports.sym - --libmapi_la_LIBADD = ${top_builddir}/common/libcommon_util.la -+libmapi_la_LIBADD = ${top_builddir}/common/libcommon_util.la \ -+ ${top_builddir}/common/libcommon_mapi.la \ -+ $(PROG_LIBS) - - # required because we're exporting extern "C" functions and want to filter with 'export-symbols' - CXXLD=--tag=none gcc diff --git a/zarafa-6.30.4-brodowski.patch b/zarafa-6.30.4-brodowski.patch deleted file mode 100644 index 9c97208..0000000 --- a/zarafa-6.30.4-brodowski.patch +++ /dev/null @@ -1,774 +0,0 @@ -diff -ruN /usr/src/zarafa/zarafa-6.30.4.17264/php-ext/include/mapi/class.autoarchivesettings.php mapi/class.autoarchivesettings.php ---- /usr/src/zarafa/zarafa-6.30.4.17264/php-ext/include/mapi/class.autoarchivesettings.php Thu Jan 1 01:00:00 1970 -+++ mapi/class.autoarchivesettings.php Sat Aug 8 11:49:05 2009 -@@ -0,0 +1,218 @@ -+. -+ * -+ */ -+ -+?> -+ -+ */ -+ -+class AutoArchiveSettings { -+ -+ var $session; -+ var $store; -+ var $folder; -+ var $proptags; -+ -+ function agingproperties() { -+ $properties = array(); -+ $properties["entryid"] = PR_ENTRYID; -+ $properties["parent_entryid"] = PR_PARENT_ENTRYID; -+ $properties["message_class"] = PR_MESSAGE_CLASS; -+ $properties["icon_index"] = PR_ICON_INDEX; -+ $properties["display_to"] = PR_DISPLAY_TO; -+ $properties["display_cc"] = PR_DISPLAY_CC; -+ $properties["subject"] = PR_SUBJECT; -+ $properties["importance"] = PR_IMPORTANCE; -+ $properties["sent_representing_name"] = PR_SENT_REPRESENTING_NAME; -+ $properties["sent_representing_email_address"] = PR_SENT_REPRESENTING_EMAIL_ADDRESS; -+ $properties["sent_representing_addrtype"] = PR_SENT_REPRESENTING_ADDRTYPE; -+ $properties["sent_representing_entryid"] = PR_SENT_REPRESENTING_ENTRYID; -+ $properties["sender_email_address"] = PR_SENDER_EMAIL_ADDRESS; -+ $properties["sender_name"] = PR_SENDER_NAME; -+ $properties["received_by_name"] = PR_RECEIVED_BY_NAME; -+ $properties["received_by_email_address"] = PR_RECEIVED_BY_EMAIL_ADDRESS; -+ $properties["message_delivery_time"] = PR_MESSAGE_DELIVERY_TIME; -+ $properties["last_modification_time"] = PR_LAST_MODIFICATION_TIME; -+ $properties["last_verb_executed"] = PR_LAST_VERB_EXECUTED; -+ $properties["last_verb_execution_time"] = PR_LAST_VERB_EXECUTION_TIME; -+ $properties["hasattach"] = PR_HASATTACH; -+ $properties["message_size"] = PR_MESSAGE_SIZE; -+ $properties["message_flags"] = PR_MESSAGE_FLAGS; -+ $properties["flag_status"] = PR_FLAG_STATUS; -+ $properties["flag_complete_time"] = PR_FLAG_COMPLETE_TIME; -+ $properties["flag_icon"] = PR_FLAG_ICON; -+ $properties["reminder_time"] = "PT_SYSTIME:PSETID_Common:0x8502"; -+ $properties["reminder_set"] = "PT_BOOLEAN:PSETID_Common:0x8503"; -+ $properties["flag_request"] = "PT_STRING8:PSETID_Common:0x8530"; -+ $properties["flag_due_by"] = "PT_SYSTIME:PSETID_Common:0x8560"; -+ $properties["reply_requested"] = PR_REPLY_REQUESTED; -+ $properties["reply_time"] = PR_REPLY_TIME; -+ $properties["response_requested"] = PR_RESPONSE_REQUESTED; -+ $properties["client_submit_time"] = PR_CLIENT_SUBMIT_TIME; -+ $properties["sensitivity"] = PR_SENSITIVITY; -+ $properties["read_receipt_requested"] = PR_READ_RECEIPT_REQUESTED; -+ $properties["location"] = "PT_STRING8:PSETID_Appointment:0x8208"; -+ $properties["categories"] = "PT_MV_STRING8:PS_PUBLIC_STRINGS:Keywords"; -+ $properties["transport_message_headers"] = PR_TRANSPORT_MESSAGE_HEADERS; -+ $properties["contacts"] = "PT_MV_STRING8:PSETID_Common:0x853A"; -+ $properties["contacts_string"] = "PT_STRING8:PSETID_Common:0x8586"; -+ -+ $properties["aging_period"] = PR_AGING_PERIOD; // max 3 digits -+ $properties["aging_granularity"] = PR_AGING_GRANULARITY; // 0=month, 1=weeks, 2=days -+ $properties["aging_filename"] = PR_AGING_FILENAME; -+ $properties["aging_age_folder"] = PR_AGING_AGE_FOLDER; -+ $properties["aging_deleted_items"] = PR_AGING_DELETE_ITEMS; -+ $properties["aging_dont_age_me"] = PR_AGING_DONT_AGE_ME; -+ $properties["aging_file_name_after9"] = PR_AGING_FILE_NAME_AFTER9; -+ $properties["aging_when_deleted_on_server"] = PR_AGING_WHEN_DELETED_ON_SERVER; -+ $properties["aging_wait_until_expired"] = PR_AGING_WAIT_UNTIL_EXPIRED; -+ $properties["aging_version"] = PR_AGING_VERSION; -+ $properties["aging_default"] = PR_AGING_DEFAULT; -+ -+ $properties["deleted_on"] = PR_DELETED_ON; -+ $properties["updatecounter"] = "PT_LONG:PSETID_Appointment:0x8201"; -+ $properties["hideattachments"] = "PT_BOOLEAN:PSETID_Common:0x8514"; -+ -+ return $properties; -+ } -+ -+ /** -+ * Constuctor -+ * -+ * @param mapi_session $session MAPI Session -+ * @param mapi_folder $folder Folder to use for AutoArchive Settings retrival -+ */ -+ -+ function retrieveSettings($session, $store, $folder, $properties = NULL) -+ { -+ if ($properties == NULL) { -+ $properties = $this->agingproperties(); -+ }; -+ -+ $this->proptags = getPropIdsFromStrings($store, $properties); -+ -+ $this->session = $session; -+ $this->store = $store; -+ $this->folder = $folder; -+ -+ $msg = $this->getMessage(); -+ -+ $props = mapi_getprops($msg,$this->proptags); -+ -+ $data = $props; -+ -+ return $data; -+ } -+ -+ function getMessage() { -+ $table = mapi_folder_getcontentstable($this->folder, MAPI_ASSOCIATED); -+ mapi_table_sort($table, array(PR_RECEIPT_TIME => TABLE_SORT_ASCEND)); -+ $restriction = array ( RES_PROPERTY, -+ array ( RELOP => RELOP_EQ, -+ ULPROPTAG => PR_MESSAGE_CLASS, -+ VALUE => array (PR_MESSAGE_CLASS => "IPC.MS.Outlook.AgingProperties") -+ ) -+ ); -+ $msgs = mapi_table_queryallrows($table,array(PR_ENTRYID),$restriction); -+ if (isset($msgs[0][PR_ENTRYID])) { -+ $msg = mapi_msgstore_openentry($this->store,$msgs[0][PR_ENTRYID]); -+ } else { -+ $this->createMessage(); -+ $msg = $this->getMessage(); -+ } -+ return $msg; -+ } -+ -+ function updateSettings($session, $store, $folder, $uprops) { -+ $properties = $this->agingproperties(); -+ -+ $this->session = $session; -+ $this->store = $store; -+ $this->folder = $folder; -+ -+ $msg = $this->getMessage(); -+ -+ $write_props = array(); -+ -+ if (isset($uprops["aging_period"])) $write_props[$properties["aging_period"]] = $uprops["aging_period"]; -+ if (isset($uprops["aging_granularity"])) $write_props[$properties["aging_granularity"]] = $uprops["aging_granularity"]; -+ if (isset($uprops["aging_age_folder"])) $write_props[$properties["aging_age_folder"]] = $uprops["aging_age_folder"]; -+ if (isset($uprops["aging_deleted_items"])) $write_props[$properties["aging_deleted_items"]] = $uprops["aging_deleted_items"]; -+ if (isset($uprops["aging_filename"])) $write_props[$properties["aging_filename"]] = $uprops["aging_filename"]; -+ if (isset($uprops["aging_file_name_after9"])) $write_props[$properties["aging_file_name_after9"]] = $uprops["aging_file_name_after9"]; -+ if (isset($uprops["aging_version"])) $write_props[$properties["aging_version"]] = $uprops["aging_version"]; -+ if (isset($uprops["aging_default"])) $write_props[$properties["aging_default"]] = $uprops["aging_default"]; -+ -+ mapi_setprops($msg,$write_props); -+ -+ mapi_savechanges($msg); -+ -+ } -+ -+ function createMessage() { -+ -+ $properties = $this->agingproperties(); -+ -+ $write_props = array( $properties["message_class"] => "IPC.MS.Outlook.AgingProperties", -+ $properties["display_to"] => NULL, -+ $properties["display_cc"] => NULL, -+ $properties["aging_period"] => "3", -+ $properties["aging_granularity"] => "0", -+ $properties["aging_age_folder"] => "0", -+ $properties["aging_deleted_items"] => "0", -+ $properties["aging_filename"] => "", -+ $properties["aging_file_name_after9"] => "", -+ $properties["aging_version"] => "2", -+ $properties["aging_default"] => "0" -+ ); -+ -+ $msg = mapi_folder_createmessage($this->folder,MAPI_ASSOCIATED); -+ -+ mapi_setprops($msg,$write_props); -+ -+ mapi_savechanges($msg); -+ -+ } -+ -+} -+?> -diff -ruN /usr/src/zarafa/zarafa-6.30.4.17264/php-ext/include/mapi/class.linkedappointment.php mapi/class.linkedappointment.php ---- /usr/src/zarafa/zarafa-6.30.4.17264/php-ext/include/mapi/class.linkedappointment.php Thu Jan 1 01:00:00 1970 -+++ mapi/class.linkedappointment.php Fri Aug 14 11:16:18 2009 -@@ -0,0 +1,393 @@ -+. -+ * -+ */ -+?> -+ -+ */ -+ -+class linkedAppointment -+{ -+ -+ /** -+ * @var object Mapi Message Store (may be null if readonly) -+ */ -+ var $_store; -+ -+ var $_contactmapping = array ( -+ "fileas" => "PT_STRING8:{00062004-0000-0000-C000-000000000046}:0x8005", -+ "birthday_event_entryid" => "PT_BINARY:{00062004-0000-0000-C000-000000000046}:0x804d", -+ "anniversary_event_entryid" => "PT_BINARY:{00062004-0000-0000-C000-000000000046}:0x804e", -+ "birthday" => PR_BIRTHDAY, -+ "anniversary" => PR_WEDDING_ANNIVERSARY, -+ "entryid" => PR_ENTRYID, -+ "search_key" => PR_SEARCH_KEY -+ ); -+ -+ var $_appointmentmapping = array ( -+ "alldayevent" => "PT_BOOLEAN:{00062002-0000-0000-C000-000000000046}:0x8215", -+ "body" => PR_BODY, -+ "busystatus" => "PT_LONG:{00062002-0000-0000-C000-000000000046}:0x8205", -+ "categories" => "PT_MV_STRING8:{00020329-0000-0000-C000-000000000046}:Keywords", -+ "rtf" => PR_RTF_COMPRESSED, -+ "dtstamp" => PR_LAST_MODIFICATION_TIME, -+ "endtime" => "PT_SYSTIME:{00062002-0000-0000-C000-000000000046}:0x820e", -+ "location" => "PT_STRING8:{00062002-0000-0000-C000-000000000046}:0x8208", -+ "meetingstatus" => "PT_LONG:{00062002-0000-0000-C000-000000000046}:0x8217", -+ "reminder" => "PT_LONG:{00062008-0000-0000-C000-000000000046}:0x8501", -+ "sensitivity" => PR_SENSITIVITY, -+ "subject" => PR_SUBJECT, -+ "starttime" => "PT_SYSTIME:{00062002-0000-0000-C000-000000000046}:0x820d", -+ "uid" => "PT_BINARY:{6ED8DA90-450B-101B-98DA-00AA003F1305}:0x3", -+ // Append the appointment attributes since we need them for appointment creation -+ "label" => "PT_LONG:{00062002-0000-0000-C000-000000000046}:0x8214", -+ "recurring" => "PT_BOOLEAN:{00062002-0000-0000-C000-000000000046}:0x8223", -+ "recurring_data" => "PT_BINARY:{00062002-0000-0000-C000-000000000046}:0x8216", -+ "recurring_pattern" => "PT_STRING8:{00062002-0000-0000-C000-000000000046}:0x8232", -+ "basedate" => "PT_SYSTIME:{00062002-0000-0000-C000-000000000046}:0x8228", -+ "icon_index" => PR_ICON_INDEX, -+ "entryid" => PR_ENTRYID, -+ "message_class" => PR_MESSAGE_CLASS, -+ "parententryid" => PR_PARENT_ENTRYID, -+ "message_flags" => PR_MESSAGE_FLAGS, -+ "importance" => PR_IMPORTANCE, -+ // Append the common attributes since we need them for appointment creation -+ "contacts" => "PT_MV_STRING8:{00062008-0000-0000-C000-000000000046}:0x853a", -+ "contacts_string" => "PT_STRING8:{00062008-0000-0000-C000-000000000046}:0x8586", -+ "commonstart" => "PT_SYSTIME:{00062008-0000-0000-C000-000000000046}:0x8516", -+ "commonend" => "PT_SYSTIME:{00062008-0000-0000-C000-000000000046}:0x8517", -+ "remindertime" => "PT_SYSTIME:{00062008-0000-0000-C000-000000000046}:0x8502", -+ "duration" => "PT_LONG:{00062002-0000-0000-C000-000000000046}:0x8213", -+ "reminder_minutes" => "PT_LONG:{00062008-0000-0000-C000-000000000046}:0x8501", -+ "reminder" => "PT_BOOLEAN:{00062008-0000-0000-C000-000000000046}:0x8503", -+ "flagdueby" => "PT_SYSTIME:{00062008-0000-0000-C000-000000000046}:0x8560", -+ "lid_contact_link_search_key" => "PT_BINARY:{00062008-0000-0000-C000-000000000046}:0x8584", -+ "lid_contact_link_entryid" => "PT_BINARY:{00062008-0000-0000-C000-000000000046}:0x8585" -+ ); -+ -+ /** -+ * Constructor -+ * @param resource $store MAPI Message Store Object -+ * @param resource $message the MAPI Source message -+ */ -+ function linkedAppointment($_store) -+ { -+ $this->_store = $_store; -+ } -+ -+ function setLinkedContact($mapimessage) -+ { -+ // get the linked contact (if any) -+ // Set the appointment attributes -+ $aprops = $this->_appointmentmapping; -+ // Get the id's of the above... -+ foreach ($aprops as $key => $value) { -+ $aprops[$key] = $this->GetPropIDFromString($this->_store, $value); -+ } -+ $appointment = mapi_getprops($mapimessage, $aprops); -+ $recurrence = new Recurrence($this->_store, $mapimessage); -+ $recur = $recurrence->getRecurrence(); -+ if (isset($appointment[$aprops["lid_contact_link_entryid"]])) { -+ // we have a linked contact. so continue here, otherwise exit silently... -+ $entryid = $this->_unpackContactLinkEntryIDS(bin2hex($appointment[$aprops["lid_contact_link_entryid"]])); -+ // Set the contact attributes -+ $cprops = $this->_contactmapping; -+ // Get the id's of the above... -+ foreach ($cprops as $key => $value) { -+ $cprops[$key] = $this->GetPropIDFromString($this->_store, $value); -+ } -+ foreach ($entryid as $value) { -+ if (($contact_msg = mapi_msgstore_openentry($this->_store,$value))) { -+ $contact = mapi_getprops($contact_msg, $cprops); -+ switch ($appointment[$aprops["entryid"]]) { -+ case $contact[$cprops["birthday_event_entryid"]] : -+ if ($contact[$cprops["birthday"]] != $recur["start"]) { -+ mapi_setprops($contact_msg,array($cprops["birthday"] => $recur["start"])); -+ mapi_savechanges($contact_msg); -+ } -+ break; -+ case $contact[$cprops["anniversary_event_entryid"]] : -+ if ($contact[$cprops["anniversary"]] != $recur["start"]) { -+ mapi_setprops($contact_msg,array($cprops["anniversary"] => $recur["start"])); -+ mapi_savechanges($contact_msg); -+ } -+ break; -+ } -+ } -+ } -+ } -+ } -+ // $what 0x01 = birthday 0x02 = anniversary -+ function setLinkedAppointment($mapimessage,$what) -+ { -+ // We love MS for this... -+ $arrayMonth = array(0,44640,84960,129600,172800,217440,260640,305280,348480,393120,437760,480960); -+ -+ // Set the appointment attributes -+ $aprops = $this->_appointmentmapping; -+ // Get the id's of the above... -+ foreach ($aprops as $key => $value) { -+ $aprops[$key] = $this->GetPropIDFromString($this->_store, $value); -+ } -+ -+ // Set the contact attributes -+ $cprops = $this->_contactmapping; -+ // Get the id's of the above... -+ foreach ($cprops as $key => $value) { -+ $cprops[$key] = $this->GetPropIDFromString($this->_store, $value); -+ } -+ -+ // Get the contact properties -+ $contact = mapi_getprops($mapimessage,$cprops); -+ -+ // open root container, if not existing, leave this function... -+ $rootcontainer = mapi_msgstore_openentry($this->_store); -+ if ($rootcontainer) { -+ // find the appointment container, if this fails, leave this function since we cannot proceed... -+ if (($rootcontainerprops = mapi_getprops($rootcontainer, array(PR_IPM_APPOINTMENT_ENTRYID)))) { -+ $parententryid = $rootcontainerprops[PR_IPM_APPOINTMENT_ENTRYID]; -+ -+ $entryid = false; -+ switch ($what) { -+ case 0x01 : if (isset($contact[$cprops["birthday_event_entryid"]])) -+ $entryid = $contact[$cprops["birthday_event_entryid"]]; -+ $entrydate = $contact[$cprops["birthday"]]; -+ $entryprop = $cprops["birthday_event_entryid"]; -+ $entrylabel = 8; -+ $entrysubject = _("Birthday")." "._("of")." ".$contact[$cprops["fileas"]]; -+ break; -+ case 0x02 : if (isset($contact[$cprops["anniversary_event_entryid"]])) -+ $entryid = $contact[$cprops["anniversary_event_entryid"]]; -+ $entrydate = $contact[$cprops["anniversary"]]; -+ $entryprop = $cprops["anniversary_event_entryid"]; -+ $entrylabel = 9; -+ $entrysubject = _("Special Date")." "._("of")." ".$contact[$cprops["fileas"]]; -+ break; -+ } -+ -+ if ($entrydate) { -+ // open if there is a linked appointment and it can be opened (no one deleted it by accident...) -+ // otherwise create it. -+ if ($entryid && -+ ($appointment_msg = mapi_msgstore_openentry($this->_store,$entryid))) { -+ $appointment = mapi_getprops($appointment_msg); -+ } else { -+ // create with base settings -+ $folder = mapi_msgstore_openentry($this->_store,$parententryid); -+ $appointment_msg = mapi_folder_createmessage($folder); -+ $appointment = array($aprops["message_class"] => "IPM.Appointment", -+ $aprops["location"] => "", -+ $aprops["body"] => "", -+ $aprops["busystatus"] => 0 -+ ); -+ mapi_setprops($appointment_msg,$appointment); -+ } -+ // Have the starttime im GMT -+ $starttime = gmmktime(0,0,0, -+ date("m",$entrydate), -+ date("j",$entrydate), -+ date("Y",$entrydate)); -+ // Just update something in case changes occured to reduce amount -+ // of sync activities... -+ -+ if ($entrydate != $appointment[$aprops["starttime"]] || -+ $entrysubject != $appointment[$aprops["subject"]]) { -+ // Reset the subject in case the name has changed -+ $appointment[$aprops["subject"]] = $entrysubject; -+ // Set the label to 8 = birthday and 9 = anniversary -+ $appointment[$aprops["label"]] = $entrylabel; -+ // Instead of having rubbish inside... -+ $appointment[$aprops["recurring_pattern"]] = ""; -+ // Setting the reminder values -+ $appointment[$aprops["reminder"]] = true; -+ $appointment[$aprops["reminder_minutes"]] = 15; -+ $appointment[$aprops["remindertime"]] = $starttime-(15*60); -+ // Setting start & Endtime -+ $appointment[$aprops["starttime"]] = $starttime; -+ $appointment[$aprops["endtime"]] = $starttime + 86400; -+ // Set duration upon diff between start and endtime in minutes. -+ $appointment[$aprops["duration"]] = ($appointment[$aprops["endtime"]] - $appointment[$aprops["starttime"]]) / 60; -+ // Sure... birthdays and anniversaries occur on daily base :-) -+ $appointment[$aprops["recurring"]] = true; -+ $appointment[$aprops["alldayevent"]] = true; -+ // Update the id's and search keys -+ $appointment[$aprops["lid_contact_link_entryid"]] = hex2bin($this->_packContactLinkEntryIDS(array($contact[$cprops["entryid"]]))); -+ $appointment[$aprops["lid_contact_link_search_key"]] = hex2bin($this->_packContactLinkSearchKeys(array($contact[$cprops["search_key"]]))); -+ // Set the changed properties -+ mapi_setprops($appointment_msg,$appointment); -+ $recurrence = new Recurrence($this->_store, $appointment_msg); -+ $tz = array(); -+ $tz["timezone"] = (($entrydate-$starttime)/3600)*60; -+ $tz["timezonedst"] = 0; -+ $tz["dstendmonth"] = 0; -+ $tz["dstendweek"] = 0; -+ $tz["dstendhour"] = 0; -+ $tz["dststartmonth"] = 0; -+ $tz["dststartweek"] = 0; -+ $tz["dststarthour"] = 0; -+ // Set the iconindex to be recurring -+ $appointment[$aprops["icon_index"]] = 1025; -+ // Set the changed properties -+ $appointment = mapi_setprops($appointment_msg,$appointment); -+ // Recurring values -+ $recur["type"] = 13; -+ $recur["subtype"] = 2; -+ $recur["month"] = $arrayMonth[gmdate("m",$starttime)-1]; -+ $recur["everyn"] = 12; -+ $recur["regen"] = 1; -+ $recur["monthday"] = gmdate("j",$starttime); -+ $recur["term"] = 0x23; -+ $recur["numoccur"] = 0; -+ $recur["start"] = $starttime; -+ $recur["end"] = 79870662000; // no end -+ $recur["startocc"] = 0; -+ $recur["endocc"] = 1440; -+ // Let class.recurrence do its job. -+ $recurrence->setRecurrence($tz, $recur); -+ // Save the changes to message -+ mapi_savechanges($appointment_msg); -+ $appointment = mapi_getprops($appointment_msg); -+ mapi_setprops($mapimessage,array($entryprop => $appointment[$aprops['entryid']])); -+ mapi_savechanges($mapimessage); -+ } -+ } -+ } -+ } -+ } -+ /** -+ * unpacks the Contact Link Entry IDs -+ * -+ * @param string in hex with the value -+ * @return array with all binary Contact Link Entry IDS -+ * -+ */ -+ function _unpackContactLinkEntryIDS($value) -+ { -+ $contact_link_entry_ids = unpack("Vcount",hex2bin(substr($value,0,8))); -+ $contact_link_entry_ids["entry_ids"] = array(); -+ $length=8; -+ for ($j=0,$i=8;$j<$contact_link_entry_ids["count"];$j++,$i=$i+$length+8) { -+ $l = unpack("Vlength",hex2bin(substr($value,$i,8))); -+ $length=$l["length"]; -+ $temp = unpack ("VFlags/A16ProviderUID/VVersion/VType/VIndext/Vcbid/A*abeid",hex2bin(substr($value,$i+8,($length*2)))); -+ $temp["abeid"] = hex2bin(substr(bin2hex($temp["abeid"]),0,$temp["cbid"]*2)); -+ $contact_link_entry_ids["entry_ids"][]=$temp["abeid"]; -+ } -+ return $contact_link_entry_ids["entry_ids"]; -+ } -+ -+ /** -+ * packs the Contact Link Entry IDs -+ * -+ * @param array with all binary Contact Link Entry IDs -+ * @return string in hex with the value -+ * -+ */ -+ function _packContactLinkEntryIDS($values) { -+ $temp=""; -+ for ($i=0;$i -diff -ruN /usr/src/zarafa/zarafa-6.30.4.17264/php-ext/include/mapi/class.recurrence.php mapi/class.recurrence.php ---- /usr/src/zarafa/zarafa-6.30.4.17264/php-ext/include/mapi/class.recurrence.php Fri Oct 16 21:05:22 2009 -+++ mapi/class.recurrence.php Tue Oct 20 19:29:54 2009 -@@ -363,9 +363,13 @@ - * @param array $exception_props the exception properties (same properties as normal recurring items) - * @param date $base_date the base date of the exception (actual GMT time of non-exception occurrence) - * @param boolean $delete true - delete occurrence, false - create new exception or modify existing -+ * @param boolean $islocal true - expect the base_date in local time (happens in case basedate is returned from WA! - */ -- function createException($exception_props, $base_date, $delete = false) -+ function createException($exception_props, $base_date, $delete = false, $islocal=false) - { -+ // CHANGED dw2412 to support local base_date as delivered from WebAccess -+ if ($islocal == true) $base_date = $this->toGMT($this->tz, $base_date); -+ - $baseday = $this->dayStartOf($this->fromGMT($this->tz, $base_date)); - $basetime = $baseday + $this->recur["startocc"] * 60; - -@@ -447,8 +451,10 @@ - * Modifies an existing exception, but only updates the given properties - * NOTE: You can't remove properites from an exception, only add new ones - */ -- function modifyException($exception_props, $base_date) -+ function modifyException($exception_props, $base_date, $islocal=false) - { -+ // ADDED dw2412 to support local base_date as delivered from WebAccess -+ if ($islocal == true) $base_date = $this->toGMT($this->tz, $base_date); - if(!$this->isValidExceptionDate($base_date, $exception_props[$this->proptags["startdate"]])) - return false; - -@@ -573,13 +579,17 @@ - - // Returns the start or end time of the occurrence on the given base date. - // This assumes that the basedate you supply is correct .. ! -- function getOccurrenceStart($basedate) { -- $daystart = $this->dayStartOf($this->fromGMT($this->tz, $basedate)); -+ function getOccurrenceStart($basedate, $islocal = false) { -+ // CHANGED dw2412 to support local base_date as delivered from WebAccess -+ if ($islocal == false) $daystart = $this->dayStartOf($this->fromGMT($this->tz, $basedate)); -+ else $daystart = $this->dayStartOf($basedate); - return $this->toGMT($this->tz, $daystart + $this->recur["startocc"] * 60); - } - -- function getOccurrenceEnd($basedate) { -- $daystart = $this->dayStartOf($this->fromGMT($this->tz, $basedate)); -+ function getOccurrenceEnd($basedate, $islocal = false) { -+ // CHANGED dw2412 to support local base_date as delivered from WebAccess -+ if ($islocal == false) $daystart = $this->dayStartOf($this->fromGMT($this->tz, $basedate)); -+ else $daystart = $this->dayStartOf($basedate); - return $this->toGMT($this->tz, $daystart + $this->recur["endocc"] * 60); - } - -@@ -1229,8 +1239,12 @@ - /** - * Returns the exception if there is a CHANGE exception on the given base date, or FALSE otherwise - */ -- function getChangeException($basedate) -+ function getChangeException($basedate, $islocal) - { -+ // CHANGED dw2412 to support local base_date as delivered from WebAccess -+ if ($islocal == true) $basedate = $this->toGMT($this->tz, $basedate); -+ -+ - // Check if the occurrence is modified on the specified date - foreach($this->recur["changed_occurences"] as $changed) - { -@@ -1263,7 +1277,6 @@ - function dayStartOf($date) - { - $time1 = $this->gmtime($date); -- - return gmmktime(0, 0, 0, $time1["tm_mon"] + 1, $time1["tm_mday"], $time1["tm_year"] + 1900); - } - -diff -ruN /usr/src/zarafa/zarafa-6.30.4.17264/php-ext/include/mapi/mapiguid.php mapi/mapiguid.php ---- /usr/src/zarafa/zarafa-6.30.4.17264/php-ext/include/mapi/mapiguid.php Fri Oct 16 21:05:22 2009 -+++ mapi/mapiguid.php Tue Oct 20 19:29:54 2009 -@@ -67,4 +67,7 @@ - define('PS_MAPI', makeguid("{00020328-0000-0000-C000-000000000046}")); - define('PS_PUBLIC_STRINGS', makeguid("{00020329-0000-0000-C000-000000000046}")); - define('PS_INTERNET_HEADERS', makeguid("{00020386-0000-0000-c000-000000000046}")); -+ -+define('MAPIUID_LinkContactEntryID', makeguid("{0aaa42fe-c718-101a-e885-0b651c240000}")); // http://msdn.microsoft.com/en-us/library/bb820924.aspx misc2 in CONTAB structure in Internet This parameter is reserved for Outlook internal use and is not supported. -+ - ?> -diff -ruN /usr/src/zarafa/zarafa-6.30.4.17264/php-ext/include/mapi/mapitags.php mapi/mapitags.php ---- /usr/src/zarafa/zarafa-6.30.4.17264/php-ext/include/mapi/mapitags.php Fri Oct 16 21:05:22 2009 -+++ mapi/mapitags.php Tue Oct 20 19:29:54 2009 -@@ -601,7 +601,25 @@ - define('PR_FINDER_ENTRYID' ,mapi_prop_tag(PT_BINARY, 0x35E7)); - define('PR_IPM_FAVORITES_ENTRYID' ,mapi_prop_tag(PT_BINARY, 0x6630)); - define('PR_IPM_PUBLIC_FOLDERS_ENTRYID' ,mapi_prop_tag(PT_BINARY, 0x6631)); -+//* start: Added dw2412 source www.cdolive.com/cdo10.htm -+define('PR_HAS_RULES' ,mapi_prop_tag(PT_BINARY, 0x663A)); - -+// Outlook AutoArchive Properties -+define('PR_AGING_PERIOD' ,mapi_prop_tag(PT_LONG, 0x36EC)); -+define('PR_AGING_GRANULARITY' ,mapi_prop_tag(PT_LONG, 0x36EE)); -+define('PR_AGING_FILENAME' ,mapi_prop_tag(PT_TSTRING, 0x6856)); -+define('PR_AGING_AGE_FOLDER' ,mapi_prop_tag(PT_BOOLEAN, 0x6857)); -+define('PR_AGING_DELETE_ITEMS' ,mapi_prop_tag(PT_BOOLEAN, 0x6855)); -+define('PR_AGING_FILE_NAME_AFTER9' ,mapi_prop_tag(PT_TSTRING, 0x6859)); -+define('PR_AGING_DONT_AGE_ME' ,mapi_prop_tag(PT_BOOLEAN, 0x6858)); -+define('PR_AGING_WHEN_DELETED_ON_SERVER' ,mapi_prop_tag(PT_BOOLEAN, 0x685B)); -+define('PR_AGING_WAIT_UNTIL_EXPIRED' ,mapi_prop_tag(PT_BOOLEAN, 0x685C)); -+define('PR_AGING_VERSION' ,mapi_prop_tag(PT_LONG, 0x685D)); -+define('PR_AGING_DEFAULT' ,mapi_prop_tag(PT_LONG, 0x685E)); -+ -+ -+ -+//* End : added dw2412 - - /* Proptags 0x35E8-0x35FF reserved for folders "guaranteed" by 'PR_VALID_FOLDER_MASK */ - -@@ -637,6 +655,19 @@ - define('PR_DEFAULT_VIEW_ENTRYID' ,mapi_prop_tag(PT_BINARY, 0x3616)); - define('PR_ASSOC_CONTENT_COUNT' ,mapi_prop_tag(PT_LONG, 0x3617)); - -+//* start: Added dw2412 source www.cdolive.com/cdo10.htm -+define('PR_DEF_FORM_ALLOWED' ,mapi_prop_tag(PT_LONG, 0x3FE2)); -+define('PR_PUBLISH_IN_ADDRESS_BOOK' ,mapi_prop_tag(PT_BOOLEAN, 0x3FE6)); -+define('PR_WEBPAGE' ,mapi_prop_tag(PT_TSTRING, 0x36DF)); -+define('PR_FOLDER_VIEWS_ONLY' ,mapi_prop_tag(PT_LONG, 0x36E1)); -+define('PR_DEF_MSG_CLASS' ,mapi_prop_tag(PT_TSTRING, 0x36E5)); -+define('PR_DEF_FORM_NAME' ,mapi_prop_tag(PT_TSTRING, 0x36E6)); -+define('PR_GENERATE_EXCHANGE_VIEWS' ,mapi_prop_tag(PT_BOOLEAN, 0x36E9)); -+define('PR_VIEW_NAME' ,mapi_prop_tag(PT_TSTRING, 0x7006)); -+define('PR_OFFLINE_FLAG' ,mapi_prop_tag(PT_LONG, 0x663D)); -+define('PR_REPLICA_VERSION' ,mapi_prop_tag(PT_LONG, 0x664B)); -+//* end : Added dw2412 -+ - define('PR_RIGHTS' ,mapi_prop_tag(PT_LONG, 0x6639)); - - /* Reserved 0x36C0-0x36FF */ -@@ -1231,6 +1262,9 @@ - - define('PR_PROCESSED', mapi_prop_tag(PT_BOOLEAN, 0x7D01)); - -+// ADDED dw2412 Contact Photo Attachment -+define('PR_ATTACHMENT_CONTACTPHOTO' ,mapi_prop_tag(PT_BOOLEAN, 0x7FFF)); -+ - // Delegates properties - define('PR_DELEGATES_SEE_PRIVATE', mapi_prop_tag(PT_MV_LONG, 0x686B)); - define('PR_SCHDINFO_DELEGATE_ENTRYIDS', mapi_prop_tag(PT_MV_BINARY, 0x6845)); ---- /usr/src/zarafa/zarafa-6.30.4.17264/php-ext/Makefile.am 2009-10-16 15:55:59.000000000 +0200 -+++ zarafa-6.30.4/php-ext/Makefile.am.brodowski 2009-10-24 23:48:37.000000000 +0200 -@@ -23,7 +23,7 @@ - # and be missing at runtime. - # therefore, we explicitly link mapi.so with -lpthread :( - --dist_data_DATA = include/mapi/mapicode.php include/mapi/mapidefs.php include/mapi/mapitags.php include/mapi/mapi.util.php include/mapi/class.recurrence.php include/mapi/class.meetingrequest.php include/mapi/class.freebusypublish.php include/mapi/mapiguid.php -+dist_data_DATA = include/mapi/mapicode.php include/mapi/mapidefs.php include/mapi/mapitags.php include/mapi/mapi.util.php include/mapi/class.recurrence.php include/mapi/class.meetingrequest.php include/mapi/class.freebusypublish.php include/mapi/mapiguid.php include/mapi/class.autoarchivesettings.php include/mapi/class.linkedappointment.php - datadir = ${datarootdir}/php/mapi - - mapi_la_SOURCES = main.cpp Session.cpp SessionPool.cpp util.cpp \ diff --git a/zarafa-6.30.4-package.patch b/zarafa-6.30.4-package.patch deleted file mode 100644 index 3c42aa1..0000000 --- a/zarafa-6.30.4-package.patch +++ /dev/null @@ -1,48 +0,0 @@ -Patch by Robert Scheck for zarafa >= 6.30.4, which only -removes the paths from autoconf/automake related files, that don't exist in the OSS -version of Zarafa. Having these paths not removed causes autoreconf to fail, but a -re-run of autoreconf is needed in order to get the rpaths completely out of all the -libraries and binaries built during the make process. - ---- zarafa-6.30.4/configure.ac 2009-03-17 17:30:45.000000000 +0100 -+++ zarafa-6.30.4/configure.ac.fedora 2009-03-31 20:34:29.000000000 +0200 -@@ -591,17 +591,6 @@ - version - specialbuild - ]) --dnl non-oss files --if test -d `dirname $0`/licensed; then --AC_CONFIG_FILES([ -- liblicense/Makefile -- licensed/Makefile -- ECtools/zarafa-backup/Makefile -- ECtools/zarafa-backup/helpers/Makefile -- ECtools/zarafa-report/Makefile -- debian/zarafa.install --]) --fi - - AC_OUTPUT - ---- zarafa-6.30.4/ECtools/Makefile.am 2009-04-23 22:10:44.000000000 +0200 -+++ zarafa-6.30.4/ECtools/Makefile.am.fedora 2009-04-25 21:20:43.000000000 +0200 -@@ -1,7 +1,3 @@ --if ! OSS_ONLY --PROSUBS = zarafa-backup zarafa-report --endif -- - if WITH_TESTTOOLS - TESTSUBS = ECTestTools - endif ---- zarafa-6.30.4/Makefile.am 2009-04-23 22:10:44.000000000 +0200 -+++ zarafa-6.30.4/Makefile.am.fedora 2009-04-25 21:20:26.000000000 +0200 -@@ -1,9 +1,5 @@ - AUTOMAKE_OPTIONS = 1.8 foreign - --if ! OSS_ONLY --PROSUBS = liblicense licensed --endif -- - SUBDIRS = common libfreebusy mapi4linux $(PROSUBS) provider libicalmapi inetmapi php-ext spooler gateway caldav ECtools installer po doc - - if WITH_PERL diff --git a/zarafa-6.30.4-perl.patch b/zarafa-6.30.4-perl.patch deleted file mode 100644 index 3c5bed5..0000000 --- a/zarafa-6.30.4-perl.patch +++ /dev/null @@ -1,53 +0,0 @@ -Patch by Robert Scheck for Zarafa >= 6.30.3, which -replaces the hardcoded perl directories by correct ones (in a dynamic way). Only -Debian and Ubuntu have ExtUtils in /usr/share, openSUSE, Fedora and RHEL/CentOS -use /usr/lib. So let us use the correct way to detect the directory. - -This patch should be an advantage to OSS users on non-Debian distributions when -using Perl API, as the correct directory will get picked up. - ---- zarafa-6.30.0/configure.ac 2009-07-20 18:41:07.000000000 +0200 -+++ zarafa-6.30.0/configure.ac.perl 2009-10-16 00:23:52.000000000 +0200 -@@ -127,6 +127,22 @@ - # build perl stuff - AC_ARG_ENABLE(perl, AC_HELP_STRING([--enable-perl], [enable building perl bindings]), [want_perl=${enableval}], [want_perl=no]) - AM_CONDITIONAL(WITH_PERL, test "$want_perl" = "yes") -+if test "x$want_perl" = "xyes"; then -+ AC_PATH_PROG([PERL], [perl], [no]) -+ if test "x$PERL" = "xno"; then -+ AC_MSG_ERROR([perl is required for building perl bindings]) -+ fi -+ -+ AC_MSG_CHECKING([for perl installarchlib]) -+ PERL_ARCHLIB=`$PERL -V:installarchlib | sed -e "s/^.*='//" -e "s/';$//"` -+ AC_MSG_RESULT([$PERL_ARCHLIB]) -+ AC_SUBST(PERL_ARCHLIB) -+ -+ AC_MSG_CHECKING([for perl privlib]) -+ PERL_PRIVLIB=`$PERL -V:privlib | sed -e "s/^.*='//" -e "s/';$//"` -+ AC_MSG_RESULT([$PERL_PRIVLIB]) -+ AC_SUBST(PERL_PRIVLIB) -+fi - - # testtools require ncurses - if test "$want_tests" = "yes"; then ---- zarafa-6.30.0/perl/Makefile.am 2009-07-20 18:41:06.000000000 +0200 -+++ zarafa-6.30.0/perl/Makefile.am.perl 2009-10-16 00:24:51.000000000 +0200 -@@ -1,7 +1,6 @@ - lib_LTLIBRARIES = libperlmapi.la - --PVERSION=5.8.8 --AM_CPPFLAGS = $(DEBUGFLAGS) -DLINUX -I$(top_srcdir)/mapi4linux/include -I$(top_srcdir)/provider/common -I${top_srcdir}/common -I/usr/lib/perl/$(PVERSION)/CORE -+AM_CPPFLAGS = $(DEBUGFLAGS) -DLINUX -I$(top_srcdir)/mapi4linux/include -I$(top_srcdir)/provider/common -I${top_srcdir}/common -I$(PERL_ARCHLIB)/CORE - - libperlmapi_la_LIBADD = ${top_builddir}/mapi4linux/src/libmapi.la \ - ${top_builddir}/common/libcommon_mapi.la \ -@@ -12,7 +11,7 @@ - CLEANFILES = MAPI.cpp - - .xs.cpp: typemap -- xsubpp -noprototypes -nolinenumbers -C++ -typemap /usr/share/perl/$(PVERSION)/ExtUtils/typemap $< > $@; \ -+ xsubpp -noprototypes -nolinenumbers -C++ -typemap $(PERL_PRIVLIB)/ExtUtils/typemap $< > $@; \ - if [ $$? -ne 0 ]; then rm $@; fi - - check-syntax: diff --git a/zarafa-6.40.0-clucene.patch b/zarafa-6.40.0-clucene.patch new file mode 100644 index 0000000..2badd27 --- /dev/null +++ b/zarafa-6.40.0-clucene.patch @@ -0,0 +1,56 @@ +Patch by Robert Scheck for zarafa >= 6.40.0, which adds +some more flexibility to detect CLucene headers and libraries. Right now, Zarafa is +linking static to CLucene, which is a no-go at Fedora. That means CLucene on Fedora +doesn't provide static library files at all. To keep Zarafa's behaviour for their +own builds, the patch looks for "libclucene.a" and links static; otherwise (Fedora) +it links dynamically using -lclucene. More details about static linking and Fedora: +http://fedoraproject.org/wiki/Packaging:Guidelines#Packaging_Static_Libraries + +Zarafa's internal CLucene build for Zarafa seems to violate upstream's decision, as +CLucene upstream decided with 0.9.20 release to put "CLucene/clucene-config.h" file +into /usr/lib{,64}/CLucene/clucene-config.h because of arch-specific values. Fedora +is shipping CLucene using upstream's decision, thus ./configure needs to handle the +include path with GCC CPP, too. To avoid CPP telling "rejected by the preprocessor" +as of the missing include path (/usr/include is standard, but /usr/lib{,64} isn't), +$CXXCPP needs to be temporarily extended to contain this special path as well. + +--- zarafa-6.40.0/configure.ac 2010-06-06 14:47:37.000000000 +0200 ++++ zarafa-6.40.0/configure.ac.clucene 2010-06-06 15:16:18.000000000 +0200 +@@ -394,17 +394,26 @@ + [CLUCENE_INCLUDE_PREFIX=${withval}],[CLUCENE_INCLUDE_PREFIX=/usr/include]) + cflags_keep=$CFLAGS + cxxflags_keep=$CXXFLAGS ++cxxcpp_keep=$CXXCPP + if test "x$CLUCENE_LIB_PREFIX" != "x"; then + CFLAGS="$CFLAGS -I$CLUCENE_LIB_PREFIX" + CXXFLAGS="$CFLAGS -I$CLUCENE_LIB_PREFIX" ++ CXXCPP="$CXXCPP -I$CLUCENE_LIB_PREFIX" + fi + if test "x$CLUCENE_INCLUDE_PREFIX" != "x"; then + CFLAGS="$CFLAGS -I$CLUCENE_INCLUDE_PREFIX" + CXXFLAGS="$CFLAGS -I$CLUCENE_INCLUDE_PREFIX" ++ CXXCPP="$CXXCPP -I$CLUCENE_INCLUDE_PREFIX" ++fi ++if test -e "${CLUCENE_LIB_PREFIX}/libclucene.a"; then ++ AC_CHECK_LIB(clucene, [open], ++ [ CLUCENE_LIBS="${CLUCENE_LIB_PREFIX}/libclucene.a" ], ++ [ WITH_CLUCENE=no ]) ++else ++ AC_CHECK_LIB(clucene, [open], ++ [ CLUCENE_LIBS="-lclucene" ], ++ [ WITH_CLUCENE=no ]) + fi +-AC_CHECK_LIB(clucene, [open], +- [ CLUCENE_LIBS="${CLUCENE_LIB_PREFIX}/libclucene.a" ], +- [ WITH_CLUCENE=no ]) + AC_CHECK_HEADERS([CLucene.h], + [ CLUCENE_CFLAGS="-DLUCENE_DISABLE_MEMTRACKING" ], + [ WITH_CLUCENE=no ]) +@@ -419,6 +428,7 @@ + AC_SUBST(CLUCENE_LIBS) + CFLAGS=$cflags_keep + CXXFLAGS=$cxxflags_keep ++CXXCPP=$cxxcpp_keep + AC_LANG_POP + + # Check for google perftools tcmalloc availability diff --git a/zarafa-6.40.0-krb5.patch b/zarafa-6.40.0-krb5.patch new file mode 100644 index 0000000..b7016df --- /dev/null +++ b/zarafa-6.40.0-krb5.patch @@ -0,0 +1,20 @@ +Patch by Robert Scheck for zarafa >= 6.40.0, which removes a +wrong include causing a build failure on native Fedora 11 and/or later as well as on RHEL +4 and/or later. According to some Kerberos people, "com_err.h" is already included by the +"krb5.h" include and thus doesn't need to be included once more. + +The build failure on RHEL/Fedora is caused due the non-existence of this include, on RHEL/ +Fedora, only "" would be available. If you really need the "com_err.h" for +some other Linux distributions (where I didn't find a real difference so far), you have to +conditionalize the include using preprocessor flags after detection in ./configure. + +--- zarafa-6.40.0/provider/libserver/ECKrbAuth.cpp 2010-05-31 19:28:59.000000000 +0200 ++++ zarafa-6.40.0/provider/libserver/ECKrbAuth.cpp.krb5 2010-06-05 21:48:51.000000000 +0200 +@@ -58,7 +58,6 @@ + // error_message() is wrongly typed in c++ context + extern "C" { + #include +-#include + } + + ECRESULT ECKrb5AuthenticateUser(const std::string &strUsername, const std::string &strPassword, std::string *lpstrError) diff --git a/zarafa-6.40.0-openssl.patch b/zarafa-6.40.0-openssl.patch new file mode 100644 index 0000000..23219a1 --- /dev/null +++ b/zarafa-6.40.0-openssl.patch @@ -0,0 +1,23 @@ +Patch by Robert Scheck for zarafa >= 6.40.0, which adds some +forward compatibility regarding OpenSSL 1.0.0. Without this patch, compiling while using +OpenSSL 1.0.0 will fail with "stdsoap2.cpp:4095: error: invalid conversion from 'const +X509V3_EXT_METHOD*' to 'X509V3_EXT_METHOD*'". Right now, Fedora 12 and/or later as well +as RHEL 6 and/or later are using OpenSSL 1.0.0 and thus depend on this patch. In order to +get OpenSSL 0.9.x and OpenSSL 1.0.0 working, the preprocessor condition is required. + +--- zarafa-6.40.0/provider/soap/stdsoap2.cpp 2010-05-31 19:28:55.000000000 +0200 ++++ zarafa-6.40.0/provider/soap/stdsoap2.cpp.openssl 2010-06-05 21:29:00.000000000 +0200 +@@ -4092,7 +4092,12 @@ + { X509_EXTENSION *ext = X509_get_ext(peer, i); + const char *ext_str = OBJ_nid2sn(OBJ_obj2nid(X509_EXTENSION_get_object(ext))); + if (ext_str && !strcmp(ext_str, "subjectAltName")) +- { X509V3_EXT_METHOD *meth = X509V3_EXT_get(ext); ++ { ++#if (OPENSSL_VERSION_NUMBER >= 0x10000000L) ++ const X509V3_EXT_METHOD *meth = X509V3_EXT_get(ext); ++#else ++ X509V3_EXT_METHOD *meth = X509V3_EXT_get(ext); ++#endif + void *ext_data; + #if (OPENSSL_VERSION_NUMBER >= 0x0090800fL) + const unsigned char *data; diff --git a/zarafa-6.40.0-package.patch b/zarafa-6.40.0-package.patch new file mode 100644 index 0000000..1a4877e --- /dev/null +++ b/zarafa-6.40.0-package.patch @@ -0,0 +1,61 @@ +Patch by Robert Scheck for zarafa >= 6.40.0, which only +removes the paths from autoconf/automake related files, that don't exist in the OSS +version of Zarafa. Having these paths not removed causes autoreconf to fail, but a +re-run of autoreconf is needed in order to get the rpaths completely out of all the +libraries and binaries built during the make process. + +--- zarafa-6.40.0/configure.ac 2010-05-31 15:45:19.000000000 +0200 ++++ zarafa-6.40.0/configure.ac.package 2010-06-06 02:48:22.000000000 +0200 +@@ -772,19 +772,6 @@ + version + specialbuild + ]) +-dnl non-oss files +-if test -d `dirname $0`/licensed; then +-AC_CONFIG_FILES([ +- liblicense/Makefile +- licensed/Makefile +- ECtools/zarafa-backup/Makefile +- ECtools/zarafa-backup/helpers/Makefile +- ECtools/zarafa-report/Makefile +- ECtools/libarchiver/Makefile +- ECtools/zarafa-archiver/Makefile +- debian/zarafa.install +-]) +-fi + + AC_OUTPUT + +--- zarafa-6.40.0/Makefile.am 2010-05-31 15:45:19.000000000 +0200 ++++ zarafa-6.40.0/Makefile.am.package 2010-06-06 02:51:29.000000000 +0200 +@@ -1,9 +1,5 @@ + AUTOMAKE_OPTIONS = 1.9 foreign + +-if ! OSS_ONLY +-PROSUBS = liblicense licensed +-endif +- + SUBDIRS = common libfreebusy zarafa-libsync mapi4linux $(PROSUBS) provider libicalmapi inetmapi php-ext spooler gateway caldav ECtools installer po doc + + if WITH_PERL +@@ -17,10 +13,6 @@ + common/ecversion.h: versionheader.sh + sh ${top_srcdir}/versionheader.sh > common/ecversion.h + +-if ! OSS_ONLY +-CLEANFILES=common/ecversion.h +-endif +- + dist-hook: + find $(distdir) -type d -name .svn -exec rm -rf {} \; 2>/dev/null || true + if OSS_ONLY +--- zarafa-6.40.0/ECtools/Makefile.am 2010-05-31 15:45:18.000000000 +0200 ++++ zarafa-6.40.0/ECtools/Makefile.am.package 2010-06-06 02:48:37.000000000 +0200 +@@ -1,7 +1,3 @@ +-if ! OSS_ONLY +-PROSUBS = zarafa-backup zarafa-report libarchiver zarafa-archiver +-endif +- + if WITH_TESTTOOLS + TESTSUBS = ECTestTools + endif diff --git a/zarafa-6.40.0-pthread.patch b/zarafa-6.40.0-pthread.patch new file mode 100644 index 0000000..4908fc5 --- /dev/null +++ b/zarafa-6.40.0-pthread.patch @@ -0,0 +1,59 @@ +Patch by Robert Scheck for zarafa >= 6.40.0, which adds +the missing -pthread linking to $CXXFLAGS for the later compile check whether open +is in -lclucene/libclucene.a. Unfortunately, Fedora was shipping CLucene 0.9.21 so +far; today the update to the important 0.9.21b happened. If -pthread is not passed +to $CXXFLAGS, the g++ compiling check fails simply with "undefined reference to +`pthread_mutexattr_settype'" and "undefined reference to `pthread_mutexattr_init'" +on Fedora >= 12 and RHEL >= 6. + +Beside of that, the -pthread check must be moved before the CLucene check or the +CLucene check must be moved post -pthread. This patch is completing the previously +suggested and applied zarafa-6.40.0-clucene.patch. + +--- zarafa-6.40.0/configure.ac 2010-06-10 23:12:32.000000000 +0200 ++++ zarafa-6.40.0/configure.ac.pthread 2010-06-10 23:54:21.000000000 +0200 +@@ -384,6 +384,14 @@ + AC_SUBST(ICAL_LIBS) + CFLAGS=$cflags_keep + ++# Everything links with pthread ++libs_keep=$LIBS ++# check lib, but do not set in link list ++AC_CHECK_LIB([pthread], [pthread_create],, AC_MSG_ERROR([required library libpthread missing or unusable])) ++LIBS=$libs_keep ++# because it seems this is better... (gnu c/c++ only?) ++CXXFLAGS="$CXXFLAGS -pthread" ++ + # Check for CLucene availability + AC_LANG_PUSH(C++) + AC_ARG_WITH(clucene-lib-prefix, +@@ -397,12 +405,12 @@ + cxxcpp_keep=$CXXCPP + if test "x$CLUCENE_LIB_PREFIX" != "x"; then + CFLAGS="$CFLAGS -I$CLUCENE_LIB_PREFIX" +- CXXFLAGS="$CFLAGS -I$CLUCENE_LIB_PREFIX" ++ CXXFLAGS="$CFLAGS $CXXFLAGS -I$CLUCENE_LIB_PREFIX" + CXXCPP="$CXXCPP -I$CLUCENE_LIB_PREFIX" + fi + if test "x$CLUCENE_INCLUDE_PREFIX" != "x"; then + CFLAGS="$CFLAGS -I$CLUCENE_INCLUDE_PREFIX" +- CXXFLAGS="$CFLAGS -I$CLUCENE_INCLUDE_PREFIX" ++ CXXFLAGS="$CFLAGS $CXXFLAGS -I$CLUCENE_INCLUDE_PREFIX" + CXXCPP="$CXXCPP -I$CLUCENE_INCLUDE_PREFIX" + fi + if test -e "${CLUCENE_LIB_PREFIX}/libclucene.a"; then +@@ -546,14 +554,6 @@ + LIBS=$libs_keep + AC_SUBST(CRYPT_LIBS) + +-# Everything links with pthread +-libs_keep=$LIBS +-# check lib, but do not set in link list +-AC_CHECK_LIB([pthread], [pthread_create],, AC_MSG_ERROR([required library libpthread missing or unusable])) +-LIBS=$libs_keep +-# because it seems this is better... (gnu c/c++ only?) +-CXXFLAGS="$CXXFLAGS -pthread" +- + # Only specific links with uuid and dl, clients only with crypto and ssl for ssl connections + libs_keep=$LIBS + AC_CHECK_LIB([crypto], [BIO_accept],, AC_MSG_ERROR([required library libcrypto missing or unusable])) diff --git a/zarafa-6.40.0-undefined-symbol.patch b/zarafa-6.40.0-undefined-symbol.patch new file mode 100644 index 0000000..0e569fe --- /dev/null +++ b/zarafa-6.40.0-undefined-symbol.patch @@ -0,0 +1,42 @@ +Re-merged patch by Robert Scheck for zarafa >= 6.40.0, which corrects +the linking between the libraries. Without this patch, any PHP usage causes the PHP error message +"undefined symbol: _ZN10ECMemTable6CreateEP14_SPropTagArrayjPPS_". The second hunk is required to +avoid linking errors like "(.rodata+0x0): multiple definition of `IID_IUnknown'". This patch was +originally by Michel de Ron (Zarafa); http://forums.zarafa.com/viewtopic.php?f=1&t=2418&start=15 +is providing some more details and information. + +--- zarafa-6.40.0/mapi4linux/src/Makefile.am 2010-05-31 15:44:42.000000000 +0200 ++++ zarafa-6.40.0/mapi4linux/src/Makefile.am.undefined-symbol 2010-06-08 22:32:12.000000000 +0200 +@@ -3,7 +3,9 @@ + AM_CPPFLAGS = $(DEBUGFLAGS) -DLINUX -I$(top_srcdir)/mapi4linux/include -I$(top_srcdir)/provider/common -I${top_srcdir}/common -I${top_srcdir}/libfreebusy + AM_LDFLAGS = $(DL_LIBS) -export-symbols ${top_srcdir}/mapi4linux/src/mapi-exports.sym + +-libmapi_la_LIBADD = ${top_builddir}/common/libcommon_util.la ++libmapi_la_LIBADD = ${top_builddir}/common/libcommon_util.la \ ++ ${top_builddir}/common/libcommon_mapi.la \ ++ $(PROG_LIBS) + + # required because we're exporting extern "C" functions and want to filter with 'export-symbols' + CXXLD=--tag=none gcc +--- zarafa-6.40.0/mapi4linux/src/m4lguids.cpp 2010-05-31 19:28:56.000000000 +0200 ++++ zarafa-6.40.0/mapi4linux/src/m4lguids.cpp.undefined-symbol 2010-06-08 22:47:30.000000000 +0200 +@@ -48,19 +48,5 @@ + */ + + #include "platform.h" +-#define USES_IID_IUnknown +-#define USES_IID_IStream +-#define USES_IID_ISequentialStream +-#define USES_IID_IProfAdmin +-#define USES_IID_IProviderAdmin +-#define USES_IID_IMAPIAdviseSink +-#define USES_IID_IMsgServiceAdmin +-#define USES_IID_IProfSect +-#define USES_IID_IMAPISession +-#define USES_IID_IMAPIProp +-#define USES_IID_IMAPIFolder +-#define USES_IID_IMAPITable +-#include +- + #include "mapiguid.h" + #include "m4l.mapiutil.h" diff --git a/zarafa-webaccess.conf b/zarafa-webaccess.conf new file mode 100644 index 0000000..7e6a7f6 --- /dev/null +++ b/zarafa-webaccess.conf @@ -0,0 +1,32 @@ +# +# Zarafa Webaccess featuring a 'Look & Feel' similar to Outlook +# + +Alias /webaccess /usr/share/zarafa-webaccess/ + +# Following Apache and PHP settings need to be set to work correct +# + + # Some apache settings + Options -Indexes +FollowSymLinks + + # Register globals must be off + php_flag register_globals off + + # Magic quotes must be off + php_flag magic_quotes_gpc off + php_flag magic_quotes_runtime off + + # The maximum POST limit. To upload large files, this value must + # be larger than upload_max_filesize. + php_value post_max_size 31M + php_value upload_max_filesize 30M + + # Short open tags must be on + php_flag short_open_tag on + + # Uncomment for debugging purposes only. Make sure Apache/PHP can + # write to this file or no errors will be logged! +# php_flag log_errors on +# php_value error_log /var/lib/zarafa-webaccess/error_log + diff --git a/zarafa.logrotate b/zarafa.logrotate new file mode 100644 index 0000000..f2a0b80 --- /dev/null +++ b/zarafa.logrotate @@ -0,0 +1,13 @@ +/var/log/zarafa/SERVICE.log { + weekly + missingok + rotate 52 + compress + delaycompress + notifempty + postrotate + killall -HUP zarafa-SERVICE 2> /dev/null || true + endscript + create 0644 zarafa zarafa +} + diff --git a/zarafa.spec b/zarafa.spec index 9673ffb..2691d59 100644 --- a/zarafa.spec +++ b/zarafa.spec @@ -26,15 +26,15 @@ # 5. Build locally # 6. Build in mock for; # a) fedora-rawhide-x86_64, -# b) fedora-12-x86_64, -# c) fedora-11-x86_64, -# d) epel-5-x86_64, -# e) epel-4-x86_64 +# b) fedora-13-x86_64, +# c) fedora-12-x86_64, +# d) epel-6-x86_64, +# e) epel-5-x86_64 # # or scratch build in koji; # -# for tag in dist-f13 dist-f12-updates-candidate dist-f11-updates-candidate \ -# dist-5E-epel dist-4E-epel; do +# for tag in dist-f14 dist-f13-updates-candidate dist-f12-updates-candidate \ +# dist-6E-epel dist-5E-epel; do # echo "- $tag: `koji build --scratch --nowait $tag $srpm 2>&1 | grep \"Task info\" | awk '{print $3}'`" # done # @@ -43,19 +43,19 @@ # = Final Release = # # NOTE: A final release of a version, or multiple final releases of the -# same version, of Zarafa 6.30.10 requires one unique tarball, probably -# named similar to zarafa-6.30.10.tar.gz. +# same version, of Zarafa 6.40.0 requires one unique tarball, probably +# named similar to zarafa-6.40.0.tar.gz. # # Once this tarball is used for an RPM package that is actually released, # the .tar.gz source should not change anymore. You may, though, include -# patches for the 6.30.10 RPM package in this .spec and bumping the release +# patches for the 6.40.0 RPM package in this .spec and bumping the release # number. # # When you do so, however, you will need to take into account upgrade paths -# between distribution versions. E.g., when releasing 6.30.10-2 to F-11, you -# would also need to release 6.30.10-2 to F-12. +# between distribution versions. E.g., when releasing 6.40.0-2 to F-12, you +# would also need to release 6.40.0-2 to F-13. # -# An alternative is to release 6.30.10.1 with a zarafa-6.30.10.1.tar.gz (yet +# An alternative is to release 6.40.1 with a zarafa-6.40.1.tar.gz (yet # again ensuring there is an upgrade path to later distribution versions) # # The point behind this has to do with reproducibility, though admittedly, @@ -82,13 +82,13 @@ # again just for appearances sake, possibly preserving the important # messages from each beta_or_rc type of changelog entries, e.g.: # -# * Some Time Your Name - 6.30.10-0.1svn12345 +# * Some Time Your Name - 6.40.0-0.1svn12345 # - Improve packaging # # might, in a final release, become: # -# * Some Time Zarafa Release Engineering - 6.30.10-1 -# - Release 6.30.10 +# * Some Time Zarafa Release Engineering - 6.40.0-1 +# - Release 6.40.0 # - Improve packaging # # - Possibly change only the release tag for the most recent changelog @@ -100,15 +100,15 @@ # 5. Build locally # 6. Build in mock for; # a) fedora-rawhide-x86_64, -# b) fedora-12-x86_64, -# c) fedora-11-x86_64, -# d) epel-5-x86_64, -# e) epel-4-x86_64 +# b) fedora-13-x86_64, +# c) fedora-12-x86_64, +# d) epel-6-x86_64, +# e) epel-5-x86_64 # # or scratch build in koji; # -# for tag in dist-f13 dist-f12-updates-candidate dist-f11-updates-candidate \ -# dist-5E-epel dist-4E-epel; do +# for tag in dist-f14 dist-f13-updates-candidate dist-f12-updates-candidate \ +# dist-6E-epel dist-5E-epel; do # echo "- $tag: `koji build --scratch --nowait $tag $srpm 2>&1 | grep \"Task info\" | awk '{print $3}'`" # done # @@ -116,14 +116,16 @@ # %define beta_or_rc 0 -%define actual_release 1 -%define svnrevision 20002 +%define actual_release 2 +%define svnrevision 20653 +%define with_clucene 0 %define with_ldap 1 %define with_xmlto 1 +%define php_apiver %((echo 0; php -i 2>/dev/null | sed -n 's/^PHP API => //p') | tail -1) -Summary: Zarafa Outlook Sharing and Open Source Collaboration +Summary: The Open Source Zarafa Collaboration Platform Name: zarafa -Version: 6.30.14 +Version: 6.40.0 %if %{beta_or_rc} Release: 0.%{actual_release}.svn%{svnrevision}%{?dist} %else @@ -140,14 +142,16 @@ URL: http://www.zarafa.com/ # http://www.zarafa.com/download-community -> "Zarafa Source Package" Source0: %{name}-%{version}.tar.gz Source1: %{name}.ini +Source2: %{name}.logrotate +Source3: %{name}-webaccess.conf -Patch0: zarafa-6.30.4-package.patch -# Patch 1, 2 and 3 were sent to upstream -Patch1: zarafa-6.30.4-perl.patch -Patch2: zarafa-6.30.10-undefined-symbol.patch -Patch3: zarafa-6.30.10-chmod.patch -# http://www.brodowski.org/zarafa/php-mapi/6.30.10.18495/18495_patch.diff -Patch10: zarafa-6.30.4-brodowski.patch +Patch0: zarafa-6.40.0-package.patch +# Patch 1, 2, 3, 4 and 5 were sent to upstream +Patch1: zarafa-6.40.0-undefined-symbol.patch +Patch2: zarafa-6.40.0-openssl.patch +Patch3: zarafa-6.40.0-krb5.patch +Patch4: zarafa-6.40.0-clucene.patch +Patch5: zarafa-6.40.0-pthread.patch BuildRequires: bison BuildRequires: gcc-c++ @@ -160,12 +164,16 @@ BuildRequires: libxml2-devel BuildRequires: mysql-devel >= 4.1 BuildRequires: ncurses-devel BuildRequires: pam-devel -BuildRequires: php-devel +BuildRequires: php-devel >= 4.3 BuildRequires: libtool, automake, autoconf BuildRequires: %{_includedir}/uuid/uuid.h BuildRequires: %{_includedir}/curl/curl.h BuildRequires: %{_bindir}/xsubpp +%if %{with_clucene} +BuildRequires: clucene-core-devel >= 0.9.21b-1 +%endif + %if %{with_ldap} BuildRequires: openldap-devel %endif @@ -174,7 +182,7 @@ BuildRequires: openldap-devel BuildRequires: xmlto %endif -# The normal zarafa package pulls in all of zarafa +# The normal zarafa package pulls in all of zarafa except indexer Requires: zarafa(ical) = %{version}-%{release} Requires: zarafa(dagent) = %{version}-%{release} Requires: zarafa(gateway) = %{version}-%{release} @@ -187,49 +195,56 @@ Requires: zarafa(config) = %{version}-%{release} BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) %description -Zarafa Outlook Sharing is a Microsoft Exchange replacement. The Open Source -Collaboration provides an integration with your existing Linux mail server, -native mobile phone support by ActiveSync compatibility and a webaccess with -'Look & Feel' similar to Outlook using Ajax. Including an IMAP4 and a POP3 -gateway as well as an iCal/CalDAV gateway, Zarafa can combine the usability -with the stability and flexibility of a Linux server. +The Zarafa Collaboration Platform is a Microsoft Exchange replacement. The +Open Source Collaboration provides an integration with your existing Linux +mail server, native mobile phone support by ActiveSync compatibility and a +webaccess with 'Look & Feel' similar to Outlook using Ajax. Including an +IMAP and a POP3 gateway as well as an iCal/CalDAV gateway, the Zarafa Open +Source Collaboration can combine the usability with the stability and the +flexibility of a Linux server. The proven Zarafa groupware solution is using MAPI objects, provides a MAPI client library as well as programming interfaces for C++, PHP and Perl. The other Zarafa related packages need to be installed to gain all the features -and benefits of Zarafa Outlook Sharing and Open Source Collaboration. +and benefits of the Zarafa Collaboration Platform (ZCP). ## -## Zarafa Client +## Zarafa Client library ## %package client -Summary: Zarafa Client Library +Summary: The Zarafa Client library Group: System Environment/Libraries Requires: zarafa(common) = %{version}-%{release} Provides: zarafa(client) = %{version}-%{release} %description client -Zarafa client libraries for use with integrated MAPI clients. +The zarafa-client package provides the Zarafa Client library, which gets +used by the Open Source MAPI (Messaging Application Programming Interface) +implementation of Zarafa as provider between MAPI and Zarafa. ## -## Zarafa Common files +## Common Zarafa files and directories ## %package common -Summary: Zarafa common files -Group: System Environment/Daemons +Summary: Common Zarafa files and directories +Group: Applications/Productivity Requires(pre): shadow-utils Provides: zarafa(common) = %{version}-%{release} +%if 0%{?rhel}%{?fedora} > 5 +BuildArch: noarch +%endif %description common -Common files and directories required by most Zarafa packages. +The zarafa-common package provides the filesystem structure and includes +common files required by most other Zarafa packages. It also provides the +creation of the zarafa user for the different Zarafa services. ## ## Zarafa Delivery Agent ## %package dagent -Summary: Zarafa Delivery Agent +Summary: The Zarafa Delivery Agent Group: System Environment/Daemons -Requires: zarafa(client) = %{version}-%{release} Requires: zarafa(common) = %{version}-%{release} Requires(post): /sbin/chkconfig Requires(preun): /sbin/service @@ -239,12 +254,13 @@ Provides: zarafa(dagent) = %{version}-%{release} Provides: zarafa(config::dagent) = %{version}-%{release} %description dagent -The delivery agent delivers e-mails into the Zarafa server. -It can be used to trigger the local mailer or act as the LMTP +The zarafa-dagent package includes the Zarafa Delivery Agent to import +e-mail messages from Internet Mail format to Zarafa. The Zarafa Delivery +Agent can be used trigger the local mailer (MDA) or even act as the LMTP server. ## -## Zarafa Development Headers +## Zarafa development files ## %package devel Summary: Development files for several Zarafa libraries @@ -255,18 +271,16 @@ Provides: %{name}-static = %{version}-%{release} %description devel The zarafa-devel package includes header files and libraries necessary for -developing programs which use features from the Zarafa Outlook Sharing and -Open Source Collaboration. The proven Zarafa groupware solution is using -MAPI objects, provides a MAPI client library and programming interfaces for -C++, PHP and Perl. +developing own programs which use functions and interfaces from the Zarafa +Collaboration Platform. The Zarafa Open Source Collaboration is using MAPI +objects, provides a MAPI client library and a C++ programming interface. ## -## Zarafa Gateway +## Zarafa POP3/IMAP Gateway service ## %package gateway -Summary: Zarafa Gateway server (POP3/IMAP access) +Summary: The Zarafa POP3/IMAP Gateway service Group: System Environment/Daemons -Requires: zarafa(client) = %{version}-%{release} Requires: zarafa(common) = %{version}-%{release} Requires(post): /sbin/chkconfig Requires(preun): /sbin/service @@ -276,19 +290,19 @@ Provides: zarafa(gateway) = %{version}-%{release} Provides: zarafa(config::gateway) = %{version}-%{release} %description gateway -The gateway enables other e-mail clients to connect through -POP3 or IMAP to the Zarafa server to read their e-mail. With -IMAP, it is also possible to view the contents of shared -folders and subfolders. The gateway can be configured to -listen for POP3, POP3S, IMAP and/or IMAPS. +The zarafa-gateway package includes the Zarafa POP3/IMAP Gateway service +to enable regular non-MAPI e-mail clients to connect through POP3 or IMAP +to the Zarafa server to access their e-mails. Using IMAP, it is possible +as well to view the contents of shared folders and subfolders. The Zarafa +POP3/IMAP Gateway service can be configured to listen for POP3, POP3S, +IMAP and/or IMAPS. ## -## Zarafa iCal/CalDAV server +## Zarafa iCal/CalDAV gateway ## %package ical Summary: The Zarafa iCal/CalDAV gateway Group: System Environment/Daemons -Requires: zarafa(client) = %{version}-%{release} Requires: zarafa(common) = %{version}-%{release} Requires(post): /sbin/chkconfig Requires(preun): /sbin/service @@ -300,13 +314,37 @@ Provides: zarafa(config::ical) = %{version}-%{release} Provides: zarafa(config::caldav) = %{version}-%{release} %description ical -The iCal/CalDAV gateway enables users to retrieve their -calendar using iCalendar compliant clients. The iCal/CalDAV -gateway can be configured to listen for HTTP and HTTPS -requests. +The zarafa-ical package includes the Zarafa iCal/CalDAV gateway service +to enable users to access their calendar using iCalendar (RFC 2445/5545) +or CalDAV (RFC 4791) compliant clients. The iCal/CalDAV gateway service +can be configured to listen for HTTP and HTTPS requests. + +%if %{with_clucene} +## +## Zarafa Indexing service +## +%package indexer +Summary: The Zarafa Indexing service +Group: System Environment/Daemons +Requires: zarafa(common) = %{version}-%{release}, file +Requires: catdoc, libxslt, lynx, unzip, %{_bindir}/pdftotext +Requires(post): /sbin/chkconfig +Requires(preun): /sbin/service +Requires(preun): /sbin/chkconfig +Requires(postun): /sbin/service +Provides: zarafa(indexer) = %{version}-%{release} +Provides: zarafa(config::indexer) = %{version}-%{release} + +%description indexer +The zarafa-indexer package includes the Zarafa Indexing service for fast +and full-text searching. Using CLucene search engine, this service makes +an index per user of messages and attachments for the Zarafa server. At +search queries, the server will use this index to quickly find messages, +items and even in contents of attached documents. +%endif ## -## Zarafa CalDAV package, merely an alias for zarafa-ical +## Zarafa CalDAV gateway (merely an alias for zarafa-ical) ## %package caldav Summary: The Zarafa iCal/CalDAV gateway @@ -314,18 +352,17 @@ Group: System Environment/Daemons Requires: zarafa(ical) = %{version}-%{release} %description caldav -The iCal/CalDAV gateway enables users to retrieve their -calendar using iCalendar compliant clients. The iCal/CalDAV -gateway can be configured to listen for HTTP and HTTPS -requests. +The zarafa-caldav package includes the Zarafa CalDAV gateway service to +enable users to access their calendar using iCalendar (RFC 2445/5545) or +CalDAV (RFC 4791) compliant clients. The iCal/CalDAV gateway service can +be configured to listen for HTTP and HTTPS requests. ## -## Zarafa Monitor Service +## Zarafa Monitoring service ## %package monitor -Summary: Zarafa Monitoring service +Summary: The Zarafa Monitoring service Group: System Environment/Daemons -Requires: zarafa(client) = %{version}-%{release} Requires: zarafa(common) = %{version}-%{release} Requires(post): /sbin/chkconfig Requires(preun): /sbin/service @@ -335,14 +372,15 @@ Provides: zarafa(monitor) = %{version}-%{release} Provides: zarafa(config::monitor) = %{version}-%{release} %description monitor -The monitor checks user mailbox sizes. When a quotum is reached -the monitor sends a quota notification email. +The zarafa-monitor package includes the Zarafa Monitoring service which +is responsible for checking the users store (mailbox) size, and sending +them (and administrators) a warning e-mail when limits are exceeded. ## -## Zarafa Backend Server +## Zarafa Server service ## %package server -Summary: Zarafa Backend Server +Summary: The main Zarafa Server service Group: System Environment/Daemons Requires: zarafa(common) = %{version}-%{release} Requires(post): /sbin/chkconfig @@ -354,15 +392,17 @@ Provides: zarafa(config) = %{version}-%{release} Provides: zarafa(config::server) = %{version}-%{release} %description server -The Zarafa groupware backend server +The zarafa-server package includes the main Zarafa Server and Storage +process. It contacts a database server and provides services to Zarafa +clients. The user base can be either retrieved from an external source +or can be setup with a separate list of users. ## -## Zarafa Spooler Service +## Zarafa Spooler service ## %package spooler -Summary: Zarafa Spooler Service +Summary: The Zarafa Spooler service Group: System Environment/Daemons -Requires: zarafa(client) = %{version}-%{release} Requires: zarafa(common) = %{version}-%{release} Requires(post): /sbin/chkconfig Requires(preun): /sbin/service @@ -372,80 +412,131 @@ Provides: zarafa(spooler) = %{version}-%{release} Provides: zarafa(config::spooler) = %{version}-%{release} %description spooler -The spooler sends all pending Zarafa e-mail to the recipients, -from the Outbox of a user/all users. +The zarafa-spooler package includes the Zarafa Spooler service which is +responsible for converting the Zarafa e-mails from outboxes to Internet +Mail and send it using the configured SMTP server to the recipients. ## ## Zarafa Utilities ## %package utils -Summary: Zarafa Utilities +Summary: Zarafa Utilities for administration and management Group: Applications/System -Requires: zarafa(client) = %{version}-%{release} Requires: zarafa(common) = %{version}-%{release} Provides: zarafa(utils) = %{version}-%{release} %description utils -Administration utilities for the Zarafa Groupware environment -including reporting and password management. +The zarafa-utils package includes various administration and management +utilities for the Zarafa Open Source Collaboration environment including +reporting, user and password management. ## -## MAPI System Libraries +## Zarafa Webaccess +## +%package webaccess +Summary: Zarafa Webaccess featuring a 'Look & Feel' similar to Outlook +Group: Applications/Productivity +Requires: httpd +Requires: php >= 4.3 +Requires: php(mapi) = %{version}-%{release} +%if 0%{?rhel}%{?fedora} > 5 +BuildArch: noarch +%endif + +%description webaccess +Zarafa Webaccess features the familiar Outlook 'Look & Feel' interface +and you can keep using the features in Outlook that have always allowed +you to work efficiently. View your e-mail, calendar and contacts via a +web browser. And opening your colleagues calendar or sending a meeting +request is only a piece of cake. The Zarafa Webaccess is using the ajax +technology to give a more interactive feeling to the users. + +## +## MAPI library ## %package -n libmapi -Summary: Mapi libraries by Zarafa +Summary: MAPI implementation and library by Zarafa Group: System Environment/Libraries Requires: zarafa(client) = %{version}-%{release} Requires(post): /sbin/ldconfig Requires(postun): /sbin/ldconfig %description -n libmapi -MAPI libraries by Zarafa. +The libmapi package provides the Open Source MAPI (Messaging Application +Programming Interface) implementation by Zarafa. The MAPI is a messaging +architecture and a Component Object Model based API for Microsoft Windows +which allows control over the messaging system on the client computer, +creation and management of messages, management of the client mailbox, +service providers, etc. This MAPI implementation by Zarafa is also known +as MAPI4Linux. ## -## MAPI Perl extension +## Perl MAPI extension ## -%package -n perl-libmapi -Summary: Perl Mapi extension libraries by Zarafa -Group: System Environment/Libraries -Requires: perl +%package -n perl-MAPI +Summary: The Perl MAPI extension by Zarafa +Group: Development/Libraries +Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) +Provides: perl-libmapi = %{version}-%{release} +Obsoletes: perl-libmapi < 6.40.0-1 -%description -n perl-libmapi -Perl MAPI extension libraries by Zarafa. +%description -n perl-MAPI +The perl-MAPI package contains the Perl MAPI extension to provide access +to Microsoft MAPI functions while using Perl. ## -## MAPI PHP Extension +## PHP MAPI extension ## %package -n php-mapi -Summary: A PHP Mapi client by Zarafa -Group: Applications/Communications +Summary: The PHP MAPI extension by Zarafa +Group: Development/Languages # Bug: Without mod_ssl, reloading httpd causes core dump Requires: mod_ssl +%if 0%{?rhel}%{?fedora} > 4 +%if 0%{?php_zend_api} +Requires: php(zend-abi) = %{php_zend_api}, php(api) = %{php_core_api} +%else +Requires: php-api = %{php_apiver} +%endif +%else Requires: php >= 4.3 +%endif Provides: php(mapi) = %{version}-%{release} %description -n php-mapi -PHP MAPI extension by Zarafa to enable MAPI communication in PHP. +The php-mapi package contains the PHP MAPI extension to provide access to +Microsoft MAPI functions while using PHP. Although not all MAPI functions +and interfaces are supported so far, most functions have a PHP counterpart +in this extension. Using this PHP MAPI extension, developers can create +e.g. webbased e-mail and calendaring systems and interfaces with existing +PHP projects, using the MAPI functions like a normal MAPI program. %prep %setup -q %patch0 -p1 -b .package -%patch1 -p1 -b .perl -%patch2 -p1 -b .symbol -%patch3 -p1 -b .chmod -#%%patch10 -p5 -b .brodowski +%patch1 -p1 -b .undefined-symbol +%patch2 -p1 -b .openssl +%patch3 -p1 -b .krb5 +%patch4 -p1 -b .clucene +%patch5 -p1 -b .pthread # Needed to get rid of rpath libtoolize --force autoreconf --force --install %build -CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing -g -ggdb" -export CFLAGS +export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing -g -ggdb" %configure \ --with-userscript-prefix=%{_sysconfdir}/%{name}/userscripts \ --with-quotatemplate-prefix=%{_sysconfdir}/%{name}/quotamail \ -%if 0%{?rhel} > 0 + --with-indexerscripts-prefix=%{_datadir}/%{name}/indexerscripts \ +%if %{with_clucene} + --with-clucene-lib-prefix=%{_libdir} \ + --with-clucene-include-prefix=%{_includedir} \ +%else + --with-clucene-lib-prefix= \ +%endif +%if 0%{?rhel}%{?fedora} < 6 --enable-release \ %endif --disable-static \ @@ -456,56 +547,52 @@ make %{?_smp_mflags} %install rm -rf $RPM_BUILD_ROOT make \ -%if 0%{?rhel} > 0 +%if 0%{?rhel}%{?fedora} < 6 docdir=%{_datadir}/doc/%{name}/ \ datarootdir=%{_datadir} \ %endif DESTDIR=$RPM_BUILD_ROOT \ INSTALL='install -p' \ - install + install \ + install-ajax-webaccess # Nuke all overlefts from licensed, managed or other proprietary items -rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/report-ca +rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{license,licensed.cfg,report-ca} rm -f $RPM_BUILD_ROOT%{_mandir}/man?/zarafa-{backup,restore,report,ldapms.cfg,licensed{,.cfg}}.* # Move all the initscripts to their appropriate place and # ensure that all services are off by default at boot time +rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/init.d/ mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/ -for service in server spooler dagent gateway monitor ical; do - if [ -f $RPM_BUILD_ROOT%{_datadir}/doc/%{name}/%{name}-$service.init.fc ]; then - sed -e 's@345@-@' $RPM_BUILD_ROOT%{_datadir}/doc/%{name}/%{name}-$service.init.fc > \ +for service in dagent gateway ical indexer monitor server spooler; do + if [ -f installer/linux/%{name}-$service.init.rhel ]; then + sed -e 's@345@-@' installer/linux/%{name}-$service.init.rhel > \ $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/%{name}-$service chmod 755 $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/%{name}-$service - touch -c -r $RPM_BUILD_ROOT{%{_datadir}/doc/%{name}/%{name}-$service.init.fc,%{_sysconfdir}/rc.d/init.d/%{name}-$service} + touch -c -r installer/linux/%{name}-$service.init.rhel $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/%{name}-$service fi done # Move the configuration files to their correct place and handle # /usr/lib vs. /usr/lib64 for all architectures correct and set # run_as_user, run_as_group and local_admin_users values correct -for config in $RPM_BUILD_ROOT%{_datadir}/doc/%{name}/*.cfg; do +for config in $RPM_BUILD_ROOT%{_datadir}/doc/%{name}/example-config/*.cfg; do config=$(basename $config) - if [ -f $RPM_BUILD_ROOT%{_datadir}/doc/%{name}/$config ]; then + if [ -f $RPM_BUILD_ROOT%{_datadir}/doc/%{name}/example-config/$config ]; then sed -e 's@\(run_as_\(user\|group\)[[:space:]]*=\).*@\1 %{name}@' -e 's@/usr/lib/zarafa@%{_libdir}/%{name}@' \ -e 's@\(local_admin_users[[:space:]]*=[[:space:]]*root.*\)@\1 %{name}@' \ - $RPM_BUILD_ROOT%{_datadir}/doc/%{name}/$config > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/$config + $RPM_BUILD_ROOT%{_datadir}/doc/%{name}/example-config/$config > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/$config chmod 640 $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/$config - touch -c -r $RPM_BUILD_ROOT%{_datadir}/doc/%{name}/$config $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/$config + touch -c -r $RPM_BUILD_ROOT%{_datadir}/doc/%{name}/example-config/$config $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/$config fi done -# Move the logrotate configuration file to it's correct place -mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/ -sed -e 's@\(}\)@ create 0644 %{name} %{name}\n\1@' -e '1,6d' \ - $RPM_BUILD_ROOT%{_datadir}/doc/%{name}/%{name}.logrotate > $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/%{name} -touch -c -r $RPM_BUILD_ROOT%{_datadir}/doc/%{name}/%{name}.logrotate $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/%{name} - -# Install the PHP module configuration file appropriate -mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/php.d/ -install -p -m 644 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/php.d/%{name}.ini - -# Create missing userscript directories for packaging them -mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/userscripts/{create,delete}{user,group,company}.d/ +# Move the logrotate configuration file to its correct place +rm -f $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/* +for service in dagent gateway ical indexer licensed monitor server spooler; do + sed -e "s@SERVICE@$service@" %{SOURCE2} >> $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/%{name} +done +touch -c -r %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/%{name} # Move the userscripts to their correct place and symlink them mkdir -p $RPM_BUILD_ROOT%{_datadir}/%{name}/userscripts/ @@ -517,18 +604,56 @@ done # Create the data directory and install some files into mkdir -p $RPM_BUILD_ROOT%{_datadir}/%{name}/ -install -p -m 755 installer/linux/db-{calc-storesize,convert-attachments-to-files} $RPM_BUILD_ROOT%{_datadir}/%{name}/ -install -p -m 755 installer/linux/ssl-certificates.sh $RPM_BUILD_ROOT%{_datadir}/%{name}/ +install -p -m 644 installer/linux/db-{calc-storesize,convert-attachments-to-files} $RPM_BUILD_ROOT%{_datadir}/%{name}/ +install -p -m 644 installer/linux/ssl-certificates.sh $RPM_BUILD_ROOT%{_datadir}/%{name}/ +%if %{with_ldap} +install -p -m 644 installer/linux/{db-upgrade-objectsid-to-objectguid,ldap-switch-sendas}.pl $RPM_BUILD_ROOT%{_datadir}/%{name}/ install -p -m 644 installer/ldap/%{name}.schema $RPM_BUILD_ROOT%{_datadir}/%{name}/ +%else +rm -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/ldap.{active-directory,openldap,propmap}.cfg +rm -f $RPM_BUILD_ROOT%{_mandir}/man5/%{name}-ldap.cfg.5* +%endif # Create the default log and lib directory for packaging mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/{log,lib}/%{name}/ # Remove all libtool .la files to avoid packaging of them -rm -f $RPM_BUILD_ROOT%{_libdir}/{,php/modules,%{name}}/*.la +rm -f $RPM_BUILD_ROOT{%{_libdir}/{,php/modules,php4,%{name}},%{perl_vendorarch}/auto/MAPI}/*.la # Remove files that are anyway in %doc or %{_datadir}/%{name}/ -rm -rf $RPM_BUILD_ROOT%{_datadir}/doc/%{name}/ +rm -rf $RPM_BUILD_ROOT%{_datadir}/doc/%{name}{,-indexer}/ + +# Remove unwanted/unused files that shouldn't exist anyway... +rm -f $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/%{name}-indexer + +# Move Indexer/CLucene related files to its correct places +%if %{with_clucene} +mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/indexerscripts/ +mv -f $RPM_BUILD_ROOT{%{_datadir},%{_sysconfdir}}/%{name}/indexerscripts/attachments_parser.db +for helper in attachments_parser xmltotext.xslt zmktemp; do + ln -s ../../..%{_datadir}/%{name}/indexerscripts/$helper $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/indexerscripts/$helper +done +%else +rm -f $RPM_BUILD_ROOT{%{_sysconfdir}/{rc.d/init.d,sysconfig},%{_mandir}/man?}/%{name}-indexer* +rm -rf $RPM_BUILD_ROOT{%{_sysconfdir}/%{name}/indexer.cfg,%{_datadir}/%{name}/indexerscripts/} +%endif + +# Move the webaccess configuration file to its correct place +mv -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/webaccess{-ajax,} +rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}-webaccess/config.php +ln -sf ../../..%{_sysconfdir}/%{name}/webaccess/config.php $RPM_BUILD_ROOT%{_datadir}/%{name}-webaccess/config.php + +# Install the apache configuration file for webaccess +mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d/ +install -p -m 644 %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d/%{name}-webaccess.conf + +# Move the webaccess plugins directory to its correct place +rm -rf $RPM_BUILD_ROOT{%{_datadir},%{_localstatedir}/lib}/%{name}-webaccess/plugins +mkdir -p $RPM_BUILD_ROOT%{_datadir}/%{name}-webaccess/plugins/ + +# Remove unwanted language connectors and webaccess files +rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}-webaccess/client/widgets/fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.{cfm,pl} +rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}-webaccess/{.htaccess,%{name}-webaccess.conf} %find_lang %{name} @@ -545,15 +670,22 @@ exit 0 # Ensure correct log file ownership after upgrade from official packages chown %{name}:%{name} %{_localstatedir}/log/%{name}/dagent.* > /dev/null 2>&1 || : +%post gateway +[ $1 -eq 1 ] && /sbin/chkconfig --add %{name}-gateway +# Ensure correct log file ownership after upgrade from official packages +chown %{name}:%{name} %{_localstatedir}/log/%{name}/gateway.* > /dev/null 2>&1 || : + %post ical [ $1 -eq 1 ] && /sbin/chkconfig --add %{name}-ical # Ensure correct log file ownership after upgrade from official packages chown %{name}:%{name} %{_localstatedir}/log/%{name}/ical.* > /dev/null 2>&1 || : -%post gateway -[ $1 -eq 1 ] && /sbin/chkconfig --add %{name}-gateway +%if %{with_clucene} +%post indexer +[ $1 -eq 1 ] && /sbin/chkconfig --add %{name}-indexer # Ensure correct log file ownership after upgrade from official packages -chown %{name}:%{name} %{_localstatedir}/log/%{name}/gateway.* > /dev/null 2>&1 || : +chown %{name}:%{name} %{_localstatedir}/log/%{name}/indexer.* > /dev/null 2>&1 || : +%endif %post monitor [ $1 -eq 1 ] && /sbin/chkconfig --add %{name}-monitor @@ -578,17 +710,25 @@ if [ $1 -eq 0 ]; then /sbin/chkconfig --del %{name}-dagent fi +%preun gateway +if [ $1 -eq 0 ]; then + /sbin/service %{name}-gateway stop > /dev/null 2>&1 || : + /sbin/chkconfig --del %{name}-gateway +fi + %preun ical if [ $1 -eq 0 ]; then /sbin/service %{name}-ical stop > /dev/null 2>&1 || : /sbin/chkconfig --del %{name}-ical fi -%preun gateway +%if %{with_clucene} +%preun indexer if [ $1 -eq 0 ]; then - /sbin/service %{name}-gateway stop > /dev/null 2>&1 || : - /sbin/chkconfig --del %{name}-gateway + /sbin/service %{name}-indexer stop > /dev/null 2>&1 || : + /sbin/chkconfig --del %{name}-indexer fi +%endif %preun monitor if [ $1 -eq 0 ]; then @@ -613,15 +753,22 @@ if [ $1 -ne 0 ]; then /sbin/service %{name}-dagent condrestart > /dev/null 2>&1 || : fi +%postun gateway +if [ $1 -ne 0 ]; then + /sbin/service %{name}-gateway condrestart > /dev/null 2>&1 || : +fi + %postun ical if [ $1 -ne 0 ]; then /sbin/service %{name}-ical condrestart > /dev/null 2>&1 || : fi -%postun gateway +%if %{with_clucene} +%postun indexer if [ $1 -ne 0 ]; then - /sbin/service %{name}-gateway condrestart > /dev/null 2>&1 || : + /sbin/service %{name}-indexer condrestart > /dev/null 2>&1 || : fi +%endif %postun monitor if [ $1 -ne 0 ]; then @@ -655,10 +802,9 @@ fi %files common %defattr(-,root,root,-) -%doc installer/licenseagreement/AGPL-3 doc/performance-tuning.txt %dir %{_sysconfdir}/%{name}/ %config(noreplace) %{_sysconfdir}/logrotate.d/%{name} -%dir %{_libdir}/%{name}/ +%config(noreplace) %{_sysconfdir}/sysconfig/%{name} %{_mandir}/man1/%{name}.1* %dir %{_datadir}/%{name}/ %dir %attr(0755,%{name},%{name}) %{_localstatedir}/lib/%{name}/ @@ -670,6 +816,7 @@ fi %{_bindir}/%{name}-autorespond %{_bindir}/%{name}-dagent %config(noreplace) %attr(0640,%{name},%{name}) %{_sysconfdir}/%{name}/dagent.cfg +%config(noreplace) %{_sysconfdir}/%{name}/autorespond %{_sysconfdir}/rc.d/init.d/%{name}-dagent %{_mandir}/man1/%{name}-dagent.1* %{_mandir}/man5/%{name}-dagent.cfg.5* @@ -680,14 +827,16 @@ fi %{_libdir}/libicalmapi.so %{_libdir}/libinetmapi.so %{_libdir}/libmapi.so -%{_libdir}/libperlmapi.so %{_libdir}/libcommon_mapi.a %{_libdir}/libcommon_ssl.a %{_libdir}/libcommon_util.a %{_libdir}/libfreebusy.a +%{_libdir}/libzarafasync.a %{_includedir}/icalmapi/ %{_includedir}/inetmapi/ %{_includedir}/mapi4linux/ +%{_includedir}/libfreebusy/ +%{_includedir}/libzarafasync/ %{_includedir}/%{name}/ %{_libdir}/pkgconfig/%{name}.pc @@ -709,6 +858,26 @@ fi %{_mandir}/man1/%{name}-ical.1* %{_mandir}/man5/%{name}-ical.cfg.5* +%if %{with_clucene} +%files indexer +%defattr(-,root,root,-) +%doc installer/licenseagreement/AGPL-3 +%{_bindir}/%{name}-indexer +%config(noreplace) %attr(0640,%{name},%{name}) %{_sysconfdir}/%{name}/indexer.cfg +%{_sysconfdir}/rc.d/init.d/%{name}-indexer +%dir %{_sysconfdir}/%{name}/indexerscripts/ +%config(noreplace) %{_sysconfdir}/%{name}/indexerscripts/attachments_parser.db +%{_sysconfdir}/%{name}/indexerscripts/attachments_parser +%{_sysconfdir}/%{name}/indexerscripts/xmltotext.xslt +%{_sysconfdir}/%{name}/indexerscripts/zmktemp +%dir %{_datadir}/%{name}/indexerscripts/ +%{_datadir}/%{name}/indexerscripts/attachments_parser +%{_datadir}/%{name}/indexerscripts/xmltotext.xslt +%{_datadir}/%{name}/indexerscripts/zmktemp +%{_mandir}/man1/%{name}-indexer.1* +%{_mandir}/man5/%{name}-indexer.cfg.5* +%endif + %files monitor %defattr(-,root,root,-) %doc installer/licenseagreement/AGPL-3 @@ -749,6 +918,7 @@ fi %config(noreplace) %{_sysconfdir}/%{name}/userscripts/createcompany.d/00createpublic %config(noreplace) %{_sysconfdir}/%{name}/userscripts/createuser.d/00createstore %{_datadir}/%{name}/userscripts/ +%dir %{_libdir}/%{name}/ %{_libdir}/%{name}/dbplugin.so %{_libdir}/%{name}/unixplugin.so %{_mandir}/man1/%{name}-server.1* @@ -756,8 +926,11 @@ fi %{_mandir}/man5/%{name}-unix.cfg.5* %if %{with_ldap} %{_datadir}/%{name}/%{name}.schema +%{_datadir}/%{name}/db-upgrade-objectsid-to-objectguid.pl +%{_datadir}/%{name}/ldap-switch-sendas.pl %config(noreplace) %attr(0640,%{name},%{name}) %{_sysconfdir}/%{name}/ldap.active-directory.cfg %config(noreplace) %attr(0640,%{name},%{name}) %{_sysconfdir}/%{name}/ldap.openldap.cfg +%config(noreplace) %attr(0640,%{name},%{name}) %{_sysconfdir}/%{name}/ldap.propmap.cfg %{_libdir}/%{name}/ldapplugin.so %{_mandir}/man5/%{name}-ldap.cfg.5* %endif @@ -775,6 +948,7 @@ fi %defattr(-,root,root,-) %doc installer/licenseagreement/AGPL-3 %{_bindir}/%{name}-admin +%{_bindir}/%{name}-cfgchecker %{_bindir}/%{name}-fsck %{_bindir}/%{name}-passwd %{_bindir}/%{name}-stats @@ -782,10 +956,22 @@ fi %{_datadir}/%{name}/db-convert-attachments-to-files %{_datadir}/%{name}/ssl-certificates.sh %{_mandir}/man1/%{name}-admin.1* +%{_mandir}/man1/%{name}-cfgchecker.1* %{_mandir}/man1/%{name}-fsck.1* %{_mandir}/man1/%{name}-passwd.1* %{_mandir}/man1/%{name}-stats.1* +%files webaccess +%defattr(-,root,root,-) +%doc installer/licenseagreement/AGPL-3 +%config(noreplace) %{_sysconfdir}/httpd/conf.d/%{name}-webaccess.conf +%dir %{_sysconfdir}/%{name}/ +%dir %{_sysconfdir}/%{name}/webaccess/ +%config(noreplace) %{_sysconfdir}/%{name}/webaccess/config.php +%{_datadir}/%{name}-webaccess/ +%dir %{_localstatedir}/lib/%{name}-webaccess/ +%attr(-,apache,apache) %dir %{_localstatedir}/lib/%{name}-webaccess/tmp/ + %files -n libmapi %defattr(-,root,root,-) %doc installer/licenseagreement/AGPL-3 @@ -793,10 +979,11 @@ fi %{_libdir}/libinetmapi.so.* %{_libdir}/libmapi.so.* -%files -n perl-libmapi +%files -n perl-MAPI %defattr(-,root,root,-) %doc installer/licenseagreement/AGPL-3 -%{_libdir}/libperlmapi.so.* +%{perl_vendorarch}/MAPI.pm +%{perl_vendorarch}/auto/MAPI/ %files -n php-mapi %defattr(-,root,root,-) @@ -810,6 +997,12 @@ fi %endif %changelog +* Fri Jun 11 2010 Robert Scheck 6.40.0-2 +- Added patch to ensure -pthread for -lclucene configure test + +* Thu Jun 10 2010 Robert Scheck 6.40.0-1 +- Upgrade to 6.40.0 (#564135, #565252, #600993) + * Sat May 01 2010 Robert Scheck 6.30.14-1 - Upgrade to 6.30.14 From 5962fec96d00134c27e3e8d539757aadd4b57714 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 29 Jul 2010 16:28:00 +0000 Subject: [PATCH 10/23] dist-git conversion --- .cvsignore => .gitignore | 0 Makefile | 21 --------------------- branch | 1 - 3 files changed, 22 deletions(-) rename .cvsignore => .gitignore (100%) delete mode 100644 Makefile delete mode 100644 branch diff --git a/.cvsignore b/.gitignore similarity index 100% rename from .cvsignore rename to .gitignore diff --git a/Makefile b/Makefile deleted file mode 100644 index e73f362..0000000 --- a/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -# Makefile for source rpm: zarafa -# $Id$ -NAME := zarafa -SPECFILE = $(firstword $(wildcard *.spec)) - -define find-makefile-common -for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$d/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done -endef - -MAKEFILE_COMMON := $(shell $(find-makefile-common)) - -ifeq ($(MAKEFILE_COMMON),) -# attept a checkout -define checkout-makefile-common -test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2 -endef - -MAKEFILE_COMMON := $(shell $(checkout-makefile-common)) -endif - -include $(MAKEFILE_COMMON) diff --git a/branch b/branch deleted file mode 100644 index 46381b9..0000000 --- a/branch +++ /dev/null @@ -1 +0,0 @@ -EL-6 From 4a32efa8ecd979a088b9154786ab08b60b5705f7 Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Mon, 18 Aug 2014 11:29:49 +0000 Subject: [PATCH 11/23] - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild --- zarafa.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zarafa.spec b/zarafa.spec index 2f61640..e82760d 100644 --- a/zarafa.spec +++ b/zarafa.spec @@ -32,7 +32,7 @@ Summary: Open Source Edition of the Zarafa Collaboration Platform Name: zarafa Version: 7.1.10 %if %{beta_or_rc} -Release: 0.%{actual_release}.svn%{svnrevision}%{?dist} +Release: 0.%{actual_release}.svn%{svnrevision}%{?dist}.1 %else Release: %{actual_release}%{?dist} %endif @@ -916,6 +916,9 @@ fi %{python_sitearch}/* %changelog +* Mon Aug 18 2014 Fedora Release Engineering - 7.1.10-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + * Fri Jul 11 2014 Robert Scheck 7.1.10-2 - Added a workaround to really support MariaDB (#995870) - Re-added a patch to allow building without zarafa-search From ce0e01723f2fe9e281c4e63436caa81558cb7a9f Mon Sep 17 00:00:00 2001 From: Robert Scheck Date: Mon, 23 Feb 2015 00:55:48 +0100 Subject: [PATCH 12/23] - Added multiple minor enhancement and bugfix patches - Added patch to fix CVE-2014-0103 for PHP < 5.3 (#1073618) --- zarafa-7.1.10-imap-badcharset.patch | 19 ++++ zarafa-7.1.10-imap-fetch-body.patch | 93 ++++++++++++++++++++ zarafa-7.1.10-kyotocabinet.patch | 3 + zarafa-7.1.10-ssl_protocols_ciphers.patch | 3 + zarafa-7.1.10-webaccess-fail2ban.patch | 38 ++++++++ zarafa-7.1.10-webaccess-mcrypt.patch | 58 ++++++++++++ zarafa-7.1.11-gsoap-sslv3.patch | 20 +++++ zarafa-7.1.11-plaintext_auth_localhost.patch | 3 + zarafa-7.1.11-vacation-headers.patch | 32 +++++++ zarafa-7.1.11-vacation-headers2.patch | 44 +++++++++ zarafa-7.1.9-ssl_ecdhe.patch | 3 + zarafa.spec | 26 +++++- 12 files changed, 339 insertions(+), 3 deletions(-) create mode 100644 zarafa-7.1.10-imap-badcharset.patch create mode 100644 zarafa-7.1.10-imap-fetch-body.patch create mode 100644 zarafa-7.1.10-webaccess-fail2ban.patch create mode 100644 zarafa-7.1.10-webaccess-mcrypt.patch create mode 100644 zarafa-7.1.11-gsoap-sslv3.patch create mode 100644 zarafa-7.1.11-vacation-headers.patch create mode 100644 zarafa-7.1.11-vacation-headers2.patch diff --git a/zarafa-7.1.10-imap-badcharset.patch b/zarafa-7.1.10-imap-badcharset.patch new file mode 100644 index 0000000..76b5a36 --- /dev/null +++ b/zarafa-7.1.10-imap-badcharset.patch @@ -0,0 +1,19 @@ +Patch by Robert Scheck for Zarafa <= 7.1.10 which fixes the RFC- +violating reply of the Zarafa IMAP gateway in response to a failed SEARCH CHARSET request. +This is documented at http://tools.ietf.org/html/rfc3501#page-64: "BADCHARSET: Optionally +followed by a parenthesized list of charsets. [...]". This patch adds missing parenthesis. + +Proposed to upstream via e-mail on Sun, 27 Jul 2014 23:58:01 +0200, patch was put into the +upstream ticket https://jira.zarafa.com/browse/ZCP-12504. + +--- zarafa-7.1.10/gateway/IMAP.cpp 2014-05-23 15:56:37.000000000 +0200 ++++ zarafa-7.1.10/gateway/IMAP.cpp.imap-badcharset 2014-07-27 23:42:30.000000000 +0200 +@@ -2409,7 +2409,7 @@ + if (lstSearchCriteria[1] != "WINDOWS-1252") { + iconv = new ECIConv("windows-1252", lstSearchCriteria[1]); + if (!iconv->canConvert()) { +- hr2 = HrResponse(RESP_TAGGED_NO, strTag, "[BADCHARSET WINDOWS-1252] "+strMode+"SEARCH charset not supported"); ++ hr2 = HrResponse(RESP_TAGGED_NO, strTag, "[BADCHARSET (WINDOWS-1252)] "+strMode+"SEARCH charset not supported"); + hr = MAPI_E_CALL_FAILED; + goto exit; + } diff --git a/zarafa-7.1.10-imap-fetch-body.patch b/zarafa-7.1.10-imap-fetch-body.patch new file mode 100644 index 0000000..da4e2fa --- /dev/null +++ b/zarafa-7.1.10-imap-fetch-body.patch @@ -0,0 +1,93 @@ +Patch by Robert Scheck for Zarafa <= 7.1.10 which fixes the RFC- +violating reply of the Zarafa IMAP gateway in response to a body fetch request. This is +documented at http://tools.ietf.org/html/rfc3501#page-55. Additionally this has been also +compared with the Dovecot IMAP server as a nearly (or even de facto) IMAP server reference +implementation. Please note that this is NOT a duplicate of ZCP-11590/ZCP-11739/ZCP-12365! + +Wrong behaviour of Zarafa <= 7.1.10rc1-44973 (without this patch): +> A4 FETCH 1 (BODY.PEEK[HEADER.FIELDS (FROM FROM)]) +< * 1 FETCH (BODY[HEADER.FIELDS (FROM FROM)] {66} +From: User1 +From: User1 + +) +< A4 OK FETCH completed + +Comparison with IMAP server Dovecot 2.2.13: +> A4 FETCH 1 (BODY.PEEK[HEADER.FIELDS (FROM FROM)]) +< * 1 FETCH (BODY[HEADER.FIELDS (FROM FROM)] {34} +From: User1 + +) +< A4 OK Fetch completed. + +Correct behaviour of Zarafa (after having this patch applied): +> A4 FETCH 1 (BODY.PEEK[HEADER.FIELDS (FROM FROM)]) +< * 1 FETCH (BODY[HEADER.FIELDS (FROM FROM)] {34} +From: User1 + +) +< A4 OK FETCH completed + +Testing: Full IMAP dialog example from the client perspective (after this patch applied): +< * OK [CAPABILITY IMAP4rev1 LITERAL+ AUTH=PLAIN] Zarafa IMAP gateway ready +> A0 LOGIN robert robert +< A0 OK [CAPABILITY IMAP4rev1 LITERAL+ CHILDREN XAOL-OPTION NAMESPACE QUOTA IDLE] LOGIN completed +> A1 LIST "" INBOX +< * LIST (\HasNoChildren) "/" "INBOX" +< A1 OK LIST completed +> A2 SELECT INBOX +< * 2 EXISTS +< * 0 RECENT +< * FLAGS (\Seen \Draft \Deleted \Flagged \Answered $Forwarded) +< * OK [PERMANENTFLAGS (\Seen \Draft \Deleted \Flagged \Answered $Forwarded)] Permanent flags +< * OK [UIDNEXT 4343] Predicted next UID +< * OK [UNSEEN 1] First unseen message +< * OK [UIDVALIDITY 9313] UIDVALIDITY value +< A2 OK [READ-WRITE] SELECT completed +> A3 SEARCH UNSEEN ALL +< * SEARCH 1 2 +< A3 OK SEARCH completed +> A4 FETCH 1 (BODY.PEEK[HEADER.FIELDS (FROM FROM)]) +< * 1 FETCH (BODY[HEADER.FIELDS (FROM FROM)] {34} +From: User1 + +) +< A4 OK FETCH completed +> A5 CLOSE +< A5 OK CLOSE completed +> A6 LOGOUT +< * BYE Zarafa server logging out +< A6 OK LOGOUT completed + +IMPORTANT: This patch has been very carefully and extensively tested but it might not be +perfect nevertheless as I am not really a C/C++ developer. There should be a code review +by an experienced C/C++ developer before merging into Zarafa core. + +Proposed to upstream via e-mail on Thu, 29 May 2014 01:55:35 +0200, patch was put into the +upstream ticket https://jira.zarafa.com/browse/ZCP-12398. + +--- zarafa-7.1.10/gateway/IMAP.cpp 2014-05-12 12:06:03.000000000 +0200 ++++ zarafa-7.1.10/gateway/IMAP.cpp.imap-fetch-body 2014-05-29 00:49:29.000000000 +0200 +@@ -5253,10 +5253,21 @@ + } else { + vector lstReqFields; + vector::iterator iterReqField; ++ vector::iterator r, w; ++ set tmpset; + + // Get fields as vector + lstReqFields = tokenize(strFields, " "); + ++ // Make elements of vector unique ++ for(r = lstReqFields.begin(), w = lstReqFields.begin(); r != lstReqFields.end(); ++r) { ++ if(tmpset.insert(*r).second) { ++ *w++ = *r; ++ } ++ } ++ ++ lstReqFields.erase(w, lstReqFields.end()); ++ + // Output headers specified, in order of field set + for(iterReqField = lstReqFields.begin(); iterReqField != lstReqFields.end(); iterReqField++) { + for(iterField = lstFields.begin(); iterField != lstFields.end(); iterField++) { diff --git a/zarafa-7.1.10-kyotocabinet.patch b/zarafa-7.1.10-kyotocabinet.patch index 43e62a3..00cdeab 100644 --- a/zarafa-7.1.10-kyotocabinet.patch +++ b/zarafa-7.1.10-kyotocabinet.patch @@ -4,6 +4,9 @@ broken on the given system and/or architecture. Interestingly that patch is not in 2012 the first time, proposed them as a patch to Zarafa and got merged. With a recent Zarafa release it seems they silently removed it again... +Proposed to upstream via e-mail on Fri, 11 Jul 2014 01:03:43 +0200, patch was put into the upstream ticket +https://jira.zarafa.com/browse/ZCP-12463. + --- zarafa-7.1.10/ECtools/zarafa-search/Makefile.am 2014-05-23 15:03:49.000000000 +0200 +++ zarafa-7.1.10/ECtools/zarafa-search/Makefile.am.kyotocabinet 2014-07-10 21:48:42.000000000 +0200 @@ -1,4 +1,8 @@ diff --git a/zarafa-7.1.10-ssl_protocols_ciphers.patch b/zarafa-7.1.10-ssl_protocols_ciphers.patch index 756d2fd..876df60 100644 --- a/zarafa-7.1.10-ssl_protocols_ciphers.patch +++ b/zarafa-7.1.10-ssl_protocols_ciphers.patch @@ -38,6 +38,9 @@ a code review and code clean up by an experienced C/C++ developer before merging This patch should be only applied in conjuction with the POP3 RESP-CODES and AUTH-RESP-CODE patch, the POP3 CAPA (CAPABILITIES) patch as well as the POP3 STLS (STARTTLS) patch applied before. +Proposed to upstream via e-mail on Sat, 8 Mar 2014 14:30:29 +0100, patch was put into the upstream +ticket https://jira.zarafa.com/browse/ZCP-12143. + --- zarafa-7.1.10/caldav/CalDAV.cpp 2014-05-23 15:56:36.000000000 +0200 +++ zarafa-7.1.10/caldav/CalDAV.cpp.rsc 2014-08-12 19:45:04.000000000 +0200 @@ -220,7 +220,9 @@ diff --git a/zarafa-7.1.10-webaccess-fail2ban.patch b/zarafa-7.1.10-webaccess-fail2ban.patch new file mode 100644 index 0000000..b0bb26e --- /dev/null +++ b/zarafa-7.1.10-webaccess-fail2ban.patch @@ -0,0 +1,38 @@ +Patch by Robert Scheck for Zarafa <= 7.1.0 which logs authentication +failures of Zarafa WebAccess into the error log of the webserver. This is basically a backport of +https://jira.zarafa.com/browse/WA-6908 from WebApp to WebAccess. In difference to original patch +there is no inappropriate space before a punctuation mark also known as "plenken". + +The second part of this patch is a backport of Zarafa WebApp 1.6 which ensures that authentication +is only performed if username and password are filled. This avoids a) strange looking results of +error_log() from the first part and b) reduces the possible risk of denial of service given that +PHP is not connecting the Zarafa server if not really needed. + +I guess the usage of isset() rather !empty() was accidential because isset() is always true once +the HTTP POST via the login formular happens. + +Proposed to upstream via e-mail on Wed, 13 Aug 2014 22:56:09 +0200, patch was put into the upstream +ticket https://jira.zarafa.com/browse/ZCP-12543. + +--- zarafa-7.1.10/php-webclient-ajax/client/login.php 2014-05-23 15:56:38.000000000 +0200 ++++ zarafa-7.1.10/php-webclient-ajax/client/login.php 2014-08-13 22:11:38.000000000 +0200 +@@ -86,6 +86,8 @@ + switch($_SESSION["hresult"]){ + case MAPI_E_LOGON_FAILED: + case MAPI_E_UNCONFIGURED: ++ // Print error message to error_log of webserver ++ error_log('user '.$_POST["username"].': authentication failure at MAPI'); + echo _("Logon failed, please check your name/password."); + break; + case MAPI_E_NETWORK_ERROR: +--- zarafa-7.1.10/php-webclient-ajax/index.php 2014-05-23 15:56:38.000000000 +0200 ++++ zarafa-7.1.10/php-webclient-ajax/index.php 2014-08-13 22:11:11.000000000 +0200 +@@ -153,7 +153,7 @@ + + // Create global mapi object. This object is used in many other files + $GLOBALS["mapisession"] = new MAPISession(); +- if (isset($_SESSION["username"]) && isset($_SESSION["password"])) { ++ if (!empty($_SESSION["username"]) && !empty($_SESSION["password"])) { + $sslcert_file = defined('SSLCERT_FILE') ? SSLCERT_FILE : null; + $sslcert_pass = defined('SSLCERT_PASS') ? SSLCERT_PASS : null; + $hresult = $GLOBALS["mapisession"]->logon($_SESSION["username"], $_SESSION["password"], DEFAULT_SERVER, $sslcert_file, $sslcert_pass); diff --git a/zarafa-7.1.10-webaccess-mcrypt.patch b/zarafa-7.1.10-webaccess-mcrypt.patch new file mode 100644 index 0000000..49bed4e --- /dev/null +++ b/zarafa-7.1.10-webaccess-mcrypt.patch @@ -0,0 +1,58 @@ +Patch by Robert Scheck for Zarafa >= 7.1.10 which fixes the fix that fixes CVE-2014-0103. Ush, +that was complicated, so: CVE-2014-0103 exists because Zarafa WebAccess < 7.1.10 and Zarafa WebApp < 1.6 storing passwords +in cleartext on server (in the PHP session). Zarafa solved this flaw by using openssl_encrypt() and openssl_decrypt() from +PHP's OpenSSL bindings. However these functions are only available in PHP 5.3 or later. Without this patch suggestion, any +older but still supported Linux distribution like Red Hat Enterprise Linux 5 or SuSE Linux Enterprise Server 10 (which are +both shipping PHP < 5.3 by default) would still be left vulnerable. + +Given that I am personally more a fan of OpenSSL rather mcrypt, I am not absolutely sure if this implementation is really +correct even it works fine on my test system. So please explicitly review this code to avoid introducing another security +flaw by trying to fix one! A thing that I generally question for myself is the usage of "des-ede3-cbc"/"MCRYPT_TRIPLEDES" +instead of e.g. MCRYPT_RIJNDAEL_128. Given that this decision was initially made by Zarafa I am just following that here. + +Important: To get this patch really powerful the install-time requirement needs to be adapted like this (this example is +based on Fedora's build system so the macros %{?rhel} and %{?fedora} might not exist at Zarafa but need to be replaced by +other macros): + +%if 0%{?rhel}%{?fedora} < 6 +Requires: php-mcrypt +%else +Requires: php-openssl +%endif + +This requires php-openssl (provided by php-common) on RHEL 6 (and later) and php-mcrypt (separate package) before RHEL 6. + +Proposed to upstream via e-mail on Thu, 5 Jun 2014 00:24:32 +0200, patch was put into the (non-disclosed) upstream ticket +https://jira.zarafa.com/browse/ZCP-12407. + +--- zarafa-7.1.10/php-webclient-ajax/index.php 2014-05-23 15:56:38.000000000 +0200 ++++ zarafa-7.1.10/php-webclient-ajax/index.php.webaccess-mcrypt 2014-06-05 00:08:18.000000000 +0200 +@@ -135,6 +135,8 @@ + // if user has openssl module installed + if(function_exists("openssl_encrypt")) { + $_SESSION['password'] = openssl_encrypt($password,"des-ede3-cbc",PASSWORD_KEY,0,PASSWORD_IV); ++ } elseif(function_exists("mcrypt_encrypt")) { ++ $_SESSION['password'] = base64_encode(mcrypt_encrypt(MCRYPT_TRIPLEDES, PASSWORD_KEY, $password, MCRYPT_MODE_CBC, PASSWORD_IV)); + } else { + $_SESSION["password"] = $password; + } +--- zarafa-7.1.10/php-webclient-ajax/server/core/class.mapisession.php 2014-05-23 15:56:38.000000000 +0200 ++++ zarafa-7.1.10/php-webclient-ajax/server/core/class.mapisession.php.webaccess-mcrypt 2014-06-05 00:08:57.000000000 +0200 +@@ -132,6 +132,8 @@ + if(is_string($username) && is_string($password)) { + if(function_exists("openssl_decrypt")) { + $password = openssl_decrypt($password,"des-ede3-cbc",PASSWORD_KEY,0,PASSWORD_IV); ++ } elseif(function_exists("mcrypt_decrypt")) { ++ $password = trim(mcrypt_decrypt(MCRYPT_TRIPLEDES, PASSWORD_KEY, base64_decode($password), MCRYPT_MODE_CBC, PASSWORD_IV)); + } + // logon + $this->session = mapi_logon_zarafa($username, $password, $server, $sslcert_file, $sslcert_pass); +@@ -139,6 +141,8 @@ + + if(function_exists("openssl_encrypt")) { + $password = openssl_encrypt($password,"des-ede3-cbc",PASSWORD_KEY,0,PASSWORD_IV); ++ } elseif(function_exists("mcrypt_encrypt")) { ++ $password = base64_encode(mcrypt_encrypt(MCRYPT_TRIPLEDES, PASSWORD_KEY, $password, MCRYPT_MODE_CBC, PASSWORD_IV)); + } + + if ($result == NOERROR && $this->session !== false){ diff --git a/zarafa-7.1.11-gsoap-sslv3.patch b/zarafa-7.1.11-gsoap-sslv3.patch new file mode 100644 index 0000000..e4875ee --- /dev/null +++ b/zarafa-7.1.11-gsoap-sslv3.patch @@ -0,0 +1,20 @@ +Patch by Robert Scheck for zarafa >= 7.1.11 which removes the Zarafa- +specific override/limitation that forces SSLv3-only SOAP connection between the Zarafa services. +The pristine gSOAP library itself uses SSLv23_method() instead and thus allows TLSv1.0, TLSv1.1 +as well as TLSv1.2. + +Proposed to upstream via e-mail on Wed, 2 Apr 2014 11:35:40 +0200, initial patch was put into the +upstream ticket Ticket#2014040210000266. + +--- zarafa-7.1.11/provider/common/SOAPSock.cpp 2014-09-03 10:45:06.000000000 +0200 ++++ zarafa-7.1.11/provider/common/SOAPSock.cpp.gsoap-sslv3 2015-02-18 01:15:50.000000000 +0100 +@@ -162,9 +162,6 @@ + + lpCmd->endpoint = strdup(strServerPath.c_str()); + +- // override the gsoap default v23 method to the force safer v3 only method. +- lpCmd->soap->ctx = SSL_CTX_new(SSLv3_method()); +- + #ifdef WITH_OPENSSL + if (strncmp("https:", lpCmd->endpoint, 6) == 0) { + // no need to add certificates to call, since soap also calls SSL_CTX_set_default_verify_paths() diff --git a/zarafa-7.1.11-plaintext_auth_localhost.patch b/zarafa-7.1.11-plaintext_auth_localhost.patch index 9b6aae0..c5fefd3 100644 --- a/zarafa-7.1.11-plaintext_auth_localhost.patch +++ b/zarafa-7.1.11-plaintext_auth_localhost.patch @@ -15,6 +15,9 @@ Important: The technical implementation of this patch might be not perfect as I C++ developer. There should be a code review by an experienced C/C++ developer before merging into Zarafa core. +Proposed to upstream via e-mail on Thu, 16 Oct 2014 00:00:05 +0200, patch was put into the upstream +ticket https://jira.zarafa.com/browse/ZCP-12473. + --- zarafa-7.1.11/gateway/IMAP.cpp 2014-09-03 10:45:06.000000000 +0200 +++ zarafa-7.1.11/gateway/IMAP.cpp.plaintext_auth_localhost 2014-09-24 01:29:10.000000000 +0200 @@ -757,7 +757,7 @@ diff --git a/zarafa-7.1.11-vacation-headers.patch b/zarafa-7.1.11-vacation-headers.patch new file mode 100644 index 0000000..924ff1d --- /dev/null +++ b/zarafa-7.1.11-vacation-headers.patch @@ -0,0 +1,32 @@ +Patch by Robert Scheck for Zarafa >= 7.1.11 which restricts replies by +zarafa-autorespond to automated processes and mailing lists according to RFC 5230, section 4.6. For +further details please have a look to http://tools.ietf.org/html/rfc5230#page-8 as well. + +Proposed to upstream via e-mail on Wed, 27 Aug 2014 23:30:31 +0200, patch was put into the upstream +ticket https://jira.zarafa.com/browse/ZCP-12590. + +--- zarafa-7.1.11/spooler/DAgent.cpp 2014-08-24 12:27:06.000000000 +0200 ++++ zarafa-7.1.11/spooler/DAgent.cpp.vacation-headers 2014-08-27 23:20:18.000000000 +0200 +@@ -1422,11 +1422,19 @@ + + // See if we're looping + if (lpMessageProps[0].ulPropTag == PR_TRANSPORT_MESSAGE_HEADERS_A) { +- if ( (strstr(lpMessageProps[0].Value.lpszA, "X-Zarafa-Vacation:") != NULL) || +- (strstr(lpMessageProps[0].Value.lpszA, "Auto-Submitted:") != NULL) || +- (strstr(lpMessageProps[0].Value.lpszA, "Precedence:") != NULL) ) ++ if ( (strstr(lpMessageProps[0].Value.lpszA, "X-Zarafa-Vacation:") != NULL) || // Zarafa ++ (strstr(lpMessageProps[0].Value.lpszA, "Auto-Submitted:") != NULL) || // RFC 3834 ++ (strstr(lpMessageProps[0].Value.lpszA, "List-Id:") != NULL) || // RFC 2919 ++ (strstr(lpMessageProps[0].Value.lpszA, "List-Help:") != NULL) || // RFC 2369 ++ (strstr(lpMessageProps[0].Value.lpszA, "List-Subscribe:") != NULL) || // RFC 2369 ++ (strstr(lpMessageProps[0].Value.lpszA, "List-Unsubscribe:") != NULL) || // RFC 2369 ++ (strstr(lpMessageProps[0].Value.lpszA, "List-Post:") != NULL) || // RFC 2369 ++ (strstr(lpMessageProps[0].Value.lpszA, "List-Owner:") != NULL) || // RFC 2369 ++ (strstr(lpMessageProps[0].Value.lpszA, "List-Archive:") != NULL) || // RFC 2369 ++ (strstr(lpMessageProps[0].Value.lpszA, "Precedence:") != NULL) ) // RFC 3834 + // Vacation header already present, do not send vacation reply + // Precedence: list/bulk/junk, do not reply to these mails ++ // See also http://tools.ietf.org/html/rfc5230#page-8 for details + goto exit; + // save headers to a file so they can also be tested from the script we're runing + snprintf(szTemp, PATH_MAX, "%s/autorespond-headers.XXXXXX", getenv("TEMP") == NULL ? "/tmp" : getenv("TEMP")); diff --git a/zarafa-7.1.11-vacation-headers2.patch b/zarafa-7.1.11-vacation-headers2.patch new file mode 100644 index 0000000..7fcae17 --- /dev/null +++ b/zarafa-7.1.11-vacation-headers2.patch @@ -0,0 +1,44 @@ +Patch by Robert Scheck for Zarafa >= 7.1.11 which adds anti-loop headers +for automatic responses by zarafa-autorespond for Microsoft Exchange and all vacation(1) compatible +implementations. + +For the Microsoft Exchange related part useful links are: + - http://msdn.microsoft.com/en-us/library/ee219609(v=exchg.80).aspx + - https://www.jitbit.com/maxblog/18-detecting-outlook-autoreplyout-of-office-emails-and-x-auto-response-suppress-header/ + +For vacation(1) compatible implementations useful links are: + - http://www.daemon-systems.org/man/vacation.1.html + - Book "sendmail" (written by Bryan Costales, Claus Assmann, George Jansen, Gregory Neil Shapiro), ISBN 0596555342 + +Proposed to upstream via e-mail on Wed, 27 Aug 2014 23:59:58 +0200, patch was put into the upstream +ticket https://jira.zarafa.com/browse/ZCP-12591. + +--- zarafa-7.1.11/spooler/DAgent.cpp 2014-08-24 12:27:06.000000000 +0200 ++++ zarafa-7.1.11/spooler/DAgent.cpp.vacation-headers2 2014-08-27 23:52:42.000000000 +0200 +@@ -1469,12 +1469,25 @@ + if (hr != hrSuccess) + goto exit; + +- // add anti-loop header ++ // add anti-loop header for Zarafa + snprintf(szHeader, PATH_MAX, "\nX-Zarafa-Vacation: autorespond"); + hr = WriteOrLogError(fd, szHeader, strlen(szHeader)); + if (hr != hrSuccess) + goto exit; + ++ // add anti-loop header for Exchange, see http://msdn.microsoft.com/en-us/library/ee219609(v=exchg.80).aspx ++ snprintf(szHeader, PATH_MAX, "\nX-Auto-Response-Suppress: All"); ++ hr = WriteOrLogError(fd, szHeader, strlen(szHeader)); ++ if (hr != hrSuccess) ++ goto exit; ++ ++ // add anti-loop header for vacation(1) compatible implementations, see section 10.9 of book "sendmail" (written ++ // by Bryan Costales, Claus Assmann, George Jansen, Gregory Neil Shapiro), ISBN 0596555342 ++ snprintf(szHeader, PATH_MAX, "\nPrecedence: bulk"); ++ hr = WriteOrLogError(fd, szHeader, strlen(szHeader)); ++ if (hr != hrSuccess) ++ goto exit; ++ + if (lpMessageProps[3].ulPropTag == PR_SUBJECT_W) { + // convert as one string because of [] characters + swprintf(szwHeader, PATH_MAX, L"%ls [%ls]", szSubject, lpMessageProps[3].Value.lpszW); diff --git a/zarafa-7.1.9-ssl_ecdhe.patch b/zarafa-7.1.9-ssl_ecdhe.patch index f1a1a8e..6596637 100644 --- a/zarafa-7.1.9-ssl_ecdhe.patch +++ b/zarafa-7.1.9-ssl_ecdhe.patch @@ -22,6 +22,9 @@ by an experienced C/C++ and OpenSSL developer before merging into Zarafa core. This patch should be only applied after ZCP-12143 and its dependencies. However this patch might maybe not directly apply due to some previous merge issues as mentioned in Ticket#2014030810000131. +Proposed to upstream via e-mail on Mon, 14 Apr 2014 12:04:17 +0200, patch was put into the upstream +ticket https://jira.zarafa.com/browse/ZCP-12237. + --- zarafa-7.1.9/common/ECChannel.cpp 2014-04-13 23:46:59.000000000 +0200 +++ zarafa-7.1.9/common/ECChannel.cpp.ssl_ecdhe 2014-04-13 23:59:43.000000000 +0200 @@ -97,6 +97,9 @@ diff --git a/zarafa.spec b/zarafa.spec index 13819dc..4bbf0e1 100644 --- a/zarafa.spec +++ b/zarafa.spec @@ -1,5 +1,5 @@ %global beta_or_rc 0 -%global actual_release 2 +%global actual_release 3 %global svnrevision 46050 %global with_search 1 %global with_ldap 1 @@ -60,6 +60,13 @@ Patch2: zarafa-7.1.10-kyotocabinet.patch Patch3: zarafa-7.1.10-ssl_protocols_ciphers.patch Patch4: zarafa-7.1.9-ssl_ecdhe.patch Patch5: zarafa-7.1.11-plaintext_auth_localhost.patch +Patch6: zarafa-7.1.10-imap-badcharset.patch +Patch7: zarafa-7.1.10-imap-fetch-body.patch +Patch8: zarafa-7.1.11-vacation-headers.patch +Patch9: zarafa-7.1.11-vacation-headers2.patch +Patch10: zarafa-7.1.10-webaccess-fail2ban.patch +Patch11: zarafa-7.1.10-webaccess-mcrypt.patch +Patch12: zarafa-7.1.11-gsoap-sslv3.patch BuildRequires: bison BuildRequires: gcc-c++ @@ -315,7 +322,7 @@ Group: Applications/Productivity Requires: httpd, php-mapi = %{version}-%{release} # Bug: php53 from RHEL 5 does not provide php (#717158) %if 0%{?rhel} == 5 -Requires: mod_php >= 4.3 +Requires: mod_php >= 4.3, php-mcrypt %else Requires: php >= 4.3, php-openssl %endif @@ -391,6 +398,14 @@ touch -c -r aclocal.m4.rpath aclocal.m4 %patch3 -p1 -b .ssl_protocols_ciphers %patch4 -p1 -b .ssl_ecdhe %patch5 -p1 -b .disable_plaintext_auth-localhost +%patch6 -p1 -b .imap-badcharset +%patch7 -p1 -b .imap-fetch-body +%patch8 -p1 -b .vacation-headers +%patch9 -p1 -b .vacation-headers2 +%patch10 -p1 -b .webaccess-fail2ban +%patch11 -p1 -b .webaccess-mcrypt +rm -f php-webclient-ajax/{.,*,*/*}/*.webaccess-* +%patch12 -p1 -b .gsoap-sslv3 %build %if 0%{?rhel}%{?fedora} < 6 @@ -725,7 +740,8 @@ fi %files common %defattr(-,root,root,-) -%doc installer/licenseagreement/AGPL-3 +%{!?_licensedir:%global license %%doc} +%license installer/licenseagreement/AGPL-3 %dir %{_sysconfdir}/%{name}/ %config(noreplace) %{_sysconfdir}/logrotate.d/%{name} %config(noreplace) %{_sysconfdir}/sysconfig/%{name} @@ -934,6 +950,10 @@ fi %{python_sitearch}/* %changelog +* Sun Feb 22 2015 Robert Scheck 7.1.11-3 +- Added multiple minor enhancement and bugfix patches +- Added patch to fix CVE-2014-0103 for PHP < 5.3 (#1073618) + * Sat Oct 25 2014 Kevin Kofler 7.1.11-2 - Rebuild for reference-counting-enabled clucene09 From 860fae12508e25d020d8ee3e3762d34475280606 Mon Sep 17 00:00:00 2001 From: Robert Scheck Date: Mon, 23 Feb 2015 00:58:12 +0100 Subject: [PATCH 13/23] Added minor bugfixes to two patches --- zarafa-7.1.10-webaccess-fail2ban.patch | 38 ------------------- zarafa-7.1.11-webaccess-fail2ban.patch | 21 ++++++++++ ...ch => zarafa-7.1.11-webaccess-mcrypt.patch | 6 +-- 3 files changed, 24 insertions(+), 41 deletions(-) delete mode 100644 zarafa-7.1.10-webaccess-fail2ban.patch create mode 100644 zarafa-7.1.11-webaccess-fail2ban.patch rename zarafa-7.1.10-webaccess-mcrypt.patch => zarafa-7.1.11-webaccess-mcrypt.patch (93%) diff --git a/zarafa-7.1.10-webaccess-fail2ban.patch b/zarafa-7.1.10-webaccess-fail2ban.patch deleted file mode 100644 index b0bb26e..0000000 --- a/zarafa-7.1.10-webaccess-fail2ban.patch +++ /dev/null @@ -1,38 +0,0 @@ -Patch by Robert Scheck for Zarafa <= 7.1.0 which logs authentication -failures of Zarafa WebAccess into the error log of the webserver. This is basically a backport of -https://jira.zarafa.com/browse/WA-6908 from WebApp to WebAccess. In difference to original patch -there is no inappropriate space before a punctuation mark also known as "plenken". - -The second part of this patch is a backport of Zarafa WebApp 1.6 which ensures that authentication -is only performed if username and password are filled. This avoids a) strange looking results of -error_log() from the first part and b) reduces the possible risk of denial of service given that -PHP is not connecting the Zarafa server if not really needed. - -I guess the usage of isset() rather !empty() was accidential because isset() is always true once -the HTTP POST via the login formular happens. - -Proposed to upstream via e-mail on Wed, 13 Aug 2014 22:56:09 +0200, patch was put into the upstream -ticket https://jira.zarafa.com/browse/ZCP-12543. - ---- zarafa-7.1.10/php-webclient-ajax/client/login.php 2014-05-23 15:56:38.000000000 +0200 -+++ zarafa-7.1.10/php-webclient-ajax/client/login.php 2014-08-13 22:11:38.000000000 +0200 -@@ -86,6 +86,8 @@ - switch($_SESSION["hresult"]){ - case MAPI_E_LOGON_FAILED: - case MAPI_E_UNCONFIGURED: -+ // Print error message to error_log of webserver -+ error_log('user '.$_POST["username"].': authentication failure at MAPI'); - echo _("Logon failed, please check your name/password."); - break; - case MAPI_E_NETWORK_ERROR: ---- zarafa-7.1.10/php-webclient-ajax/index.php 2014-05-23 15:56:38.000000000 +0200 -+++ zarafa-7.1.10/php-webclient-ajax/index.php 2014-08-13 22:11:11.000000000 +0200 -@@ -153,7 +153,7 @@ - - // Create global mapi object. This object is used in many other files - $GLOBALS["mapisession"] = new MAPISession(); -- if (isset($_SESSION["username"]) && isset($_SESSION["password"])) { -+ if (!empty($_SESSION["username"]) && !empty($_SESSION["password"])) { - $sslcert_file = defined('SSLCERT_FILE') ? SSLCERT_FILE : null; - $sslcert_pass = defined('SSLCERT_PASS') ? SSLCERT_PASS : null; - $hresult = $GLOBALS["mapisession"]->logon($_SESSION["username"], $_SESSION["password"], DEFAULT_SERVER, $sslcert_file, $sslcert_pass); diff --git a/zarafa-7.1.11-webaccess-fail2ban.patch b/zarafa-7.1.11-webaccess-fail2ban.patch new file mode 100644 index 0000000..3c2b5c3 --- /dev/null +++ b/zarafa-7.1.11-webaccess-fail2ban.patch @@ -0,0 +1,21 @@ +Patch by Robert Scheck for Zarafa <= 7.1.11 which logs authentication +failures of Zarafa WebAccess into the error log of the webserver. This is basically a backport of +https://jira.zarafa.com/browse/WA-6908 from WebApp to WebAccess. In difference to original patch +there is no inappropriate space before a punctuation mark also known as "plenken". + +Proposed to upstream via e-mail on Wed, 13 Aug 2014 22:56:09 +0200, initial patch was put into the +upstream ticket https://jira.zarafa.com/browse/ZCP-12543. + +--- zarafa-7.1.11/php-webclient-ajax/client/login.php 2014-09-03 10:45:06.000000000 +0200 ++++ zarafa-7.1.11/php-webclient-ajax/client/login.php 2015-02-18 01:08:13.000000000 +0100 +@@ -86,6 +86,10 @@ + switch($_SESSION["hresult"]){ + case MAPI_E_LOGON_FAILED: + case MAPI_E_UNCONFIGURED: ++ // Print error message to error_log of webserver ++ if (!empty($_POST["username"])) { ++ error_log('user '.$_POST["username"].': authentication failure at MAPI'); ++ } + echo _("Logon failed, please check your name/password."); + break; + case MAPI_E_NETWORK_ERROR: diff --git a/zarafa-7.1.10-webaccess-mcrypt.patch b/zarafa-7.1.11-webaccess-mcrypt.patch similarity index 93% rename from zarafa-7.1.10-webaccess-mcrypt.patch rename to zarafa-7.1.11-webaccess-mcrypt.patch index 49bed4e..56b5274 100644 --- a/zarafa-7.1.10-webaccess-mcrypt.patch +++ b/zarafa-7.1.11-webaccess-mcrypt.patch @@ -22,8 +22,8 @@ Requires: php-openssl This requires php-openssl (provided by php-common) on RHEL 6 (and later) and php-mcrypt (separate package) before RHEL 6. -Proposed to upstream via e-mail on Thu, 5 Jun 2014 00:24:32 +0200, patch was put into the (non-disclosed) upstream ticket -https://jira.zarafa.com/browse/ZCP-12407. +Proposed to upstream via e-mail on Thu, 5 Jun 2014 00:24:32 +0200, initial patch was put into the (non-disclosed) upstream +ticket https://jira.zarafa.com/browse/ZCP-12407. --- zarafa-7.1.10/php-webclient-ajax/index.php 2014-05-23 15:56:38.000000000 +0200 +++ zarafa-7.1.10/php-webclient-ajax/index.php.webaccess-mcrypt 2014-06-05 00:08:18.000000000 +0200 @@ -43,7 +43,7 @@ https://jira.zarafa.com/browse/ZCP-12407. if(function_exists("openssl_decrypt")) { $password = openssl_decrypt($password,"des-ede3-cbc",PASSWORD_KEY,0,PASSWORD_IV); + } elseif(function_exists("mcrypt_decrypt")) { -+ $password = trim(mcrypt_decrypt(MCRYPT_TRIPLEDES, PASSWORD_KEY, base64_decode($password), MCRYPT_MODE_CBC, PASSWORD_IV)); ++ $password = rtrim(mcrypt_decrypt(MCRYPT_TRIPLEDES, PASSWORD_KEY, base64_decode($password), MCRYPT_MODE_CBC, PASSWORD_IV), "\0"); } // logon $this->session = mapi_logon_zarafa($username, $password, $server, $sslcert_file, $sslcert_pass); From 423e99d9b3c7f0a134494c7853150fbd0a5d6efc Mon Sep 17 00:00:00 2001 From: Robert Scheck Date: Fri, 6 Mar 2015 00:37:52 +0100 Subject: [PATCH 14/23] Added small security enhancement --- zarafa-7.1.11-gsoap-sslv3.patch | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/zarafa-7.1.11-gsoap-sslv3.patch b/zarafa-7.1.11-gsoap-sslv3.patch index e4875ee..877b0e1 100644 --- a/zarafa-7.1.11-gsoap-sslv3.patch +++ b/zarafa-7.1.11-gsoap-sslv3.patch @@ -1,13 +1,14 @@ Patch by Robert Scheck for zarafa >= 7.1.11 which removes the Zarafa- specific override/limitation that forces SSLv3-only SOAP connection between the Zarafa services. The pristine gSOAP library itself uses SSLv23_method() instead and thus allows TLSv1.0, TLSv1.1 -as well as TLSv1.2. +as well as TLSv1.2. Disable SSLv2 and SSLv3 as well as TLS compression explicitly; similar like +the Zarafa Outlook Client which meanwhile only allows TLSv1.0 (and better). Proposed to upstream via e-mail on Wed, 2 Apr 2014 11:35:40 +0200, initial patch was put into the upstream ticket Ticket#2014040210000266. --- zarafa-7.1.11/provider/common/SOAPSock.cpp 2014-09-03 10:45:06.000000000 +0200 -+++ zarafa-7.1.11/provider/common/SOAPSock.cpp.gsoap-sslv3 2015-02-18 01:15:50.000000000 +0100 ++++ zarafa-7.1.11/provider/common/SOAPSock.cpp.gsoap-sslv3 2015-03-04 00:28:25.000000000 +0100 @@ -162,9 +162,6 @@ lpCmd->endpoint = strdup(strServerPath.c_str()); @@ -18,3 +19,18 @@ upstream ticket Ticket#2014040210000266. #ifdef WITH_OPENSSL if (strncmp("https:", lpCmd->endpoint, 6) == 0) { // no need to add certificates to call, since soap also calls SSL_CTX_set_default_verify_paths() +@@ -188,6 +185,14 @@ + lpCmd->soap->fsslverify = ssl_verify_callback_zarafa_silent; + + SSL_CTX_set_verify(lpCmd->soap->ctx, SSL_VERIFY_PEER, lpCmd->soap->fsslverify); ++ ++ // disable SSLv2 (according to RFC 6176) and SSLv3, leaving just TLSv1.0 (and better) ++ SSL_CTX_set_options(lpCmd->soap->ctx, SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3); ++ ++#ifdef SSL_OP_NO_COMPRESSION ++ // disable TLS compression to close the CRIME attack vector (also known as CVE-2012-4929) ++ SSL_CTX_set_options(lpCmd->soap->ctx, SSL_OP_NO_COMPRESSION); ++#endif + } + #endif + From 384c0c36e17e9c2e98393126257100ddfdf35f70 Mon Sep 17 00:00:00 2001 From: Robert Scheck Date: Fri, 6 Mar 2015 00:39:02 +0100 Subject: [PATCH 15/23] Update patch file names also in spec file --- zarafa.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zarafa.spec b/zarafa.spec index 4bbf0e1..e14ac54 100644 --- a/zarafa.spec +++ b/zarafa.spec @@ -64,8 +64,8 @@ Patch6: zarafa-7.1.10-imap-badcharset.patch Patch7: zarafa-7.1.10-imap-fetch-body.patch Patch8: zarafa-7.1.11-vacation-headers.patch Patch9: zarafa-7.1.11-vacation-headers2.patch -Patch10: zarafa-7.1.10-webaccess-fail2ban.patch -Patch11: zarafa-7.1.10-webaccess-mcrypt.patch +Patch10: zarafa-7.1.11-webaccess-fail2ban.patch +Patch11: zarafa-7.1.11-webaccess-mcrypt.patch Patch12: zarafa-7.1.11-gsoap-sslv3.patch BuildRequires: bison From c7ecef187edd7fa348ed6ad7ca11525806461993 Mon Sep 17 00:00:00 2001 From: Robert Scheck Date: Wed, 18 Mar 2015 13:17:27 +0100 Subject: [PATCH 16/23] Handle "su" option in logrotate >= 3.8.0 to avoid errors --- zarafa.spec | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/zarafa.spec b/zarafa.spec index e14ac54..4fc0f9a 100644 --- a/zarafa.spec +++ b/zarafa.spec @@ -488,6 +488,10 @@ done # Move the logrotate configuration file to its correct place install -p -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/%{name} +%if 0%{?fedora} >= 16 || 0%{?rhel} >= 7 +sed -e 's/}/\tsu root root\n}/' -i $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/%{name} +touch -c -r %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/%{name} +%endif # Move the userscripts to their correct place and symlink them mkdir -p $RPM_BUILD_ROOT%{_datadir}/%{name}/userscripts/ @@ -953,6 +957,7 @@ fi * Sun Feb 22 2015 Robert Scheck 7.1.11-3 - Added multiple minor enhancement and bugfix patches - Added patch to fix CVE-2014-0103 for PHP < 5.3 (#1073618) +- Handle "su" option in logrotate >= 3.8.0 to avoid errors * Sat Oct 25 2014 Kevin Kofler 7.1.11-2 - Rebuild for reference-counting-enabled clucene09 From 17841d83c9a5d875bf788bed28173e1a621c7d68 Mon Sep 17 00:00:00 2001 From: Robert Scheck Date: Tue, 7 Apr 2015 20:37:32 +0200 Subject: [PATCH 17/23] Upgrade to 7.1.12 --- sources | 2 +- zarafa-7.1.10-ssl_protocols_ciphers.patch | 449 ------------------ ...3.patch => zarafa-7.1.12-gsoap-sslv3.patch | 24 +- zarafa-7.1.12-licensed-archiver.patch | 117 +++++ ...dhe.patch => zarafa-7.1.12-ssl_ecdhe.patch | 42 +- zarafa-7.1.12-ssl_protocols_ciphers.patch | 123 +++++ ...ch => zarafa-7.1.12-webaccess-mcrypt.patch | 30 +- zarafa.spec | 28 +- 8 files changed, 303 insertions(+), 512 deletions(-) delete mode 100644 zarafa-7.1.10-ssl_protocols_ciphers.patch rename zarafa-7.1.11-gsoap-sslv3.patch => zarafa-7.1.12-gsoap-sslv3.patch (51%) create mode 100644 zarafa-7.1.12-licensed-archiver.patch rename zarafa-7.1.9-ssl_ecdhe.patch => zarafa-7.1.12-ssl_ecdhe.patch (69%) create mode 100644 zarafa-7.1.12-ssl_protocols_ciphers.patch rename zarafa-7.1.11-webaccess-mcrypt.patch => zarafa-7.1.12-webaccess-mcrypt.patch (71%) diff --git a/sources b/sources index cfbf649..4a70ced 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -7317dd7889303abbbd30e39f04771f10 zcp-7.1.11.tar.gz +98ceed8b35a68bba669aecccbc7b1f43 zcp-7.1.12.tar.gz diff --git a/zarafa-7.1.10-ssl_protocols_ciphers.patch b/zarafa-7.1.10-ssl_protocols_ciphers.patch deleted file mode 100644 index 876df60..0000000 --- a/zarafa-7.1.10-ssl_protocols_ciphers.patch +++ /dev/null @@ -1,449 +0,0 @@ -Patch by Robert Scheck for Zarafa <= 7.1.10 which implements much more -fine granulated configuration settings for SSL/TLS protocol and cipher enabling and disabling. The -currently available "ssl_enable_v2" setting allows either to disable SSLv2 (and enables SSLv3 only -instead) or to enable all, thus SSLv2, SSLv3, TLSv1, TLSv1.1 and TLSv1.2 (TLSv1.1 and TLSv1.2 only -if Zarafa was linked against OpenSSL 1.0.1 or later). Since SSLv2 has known protocol weaknesses it -never should be enabled - but for Zarafa it currently must be enabled to support TLSv1 and better. - -This patch introduces the new setting "ssl_protocols" which replaces "ssl_enable_v2". The default -is "!SSLv2" to simply disable SSLv2 by default. The setting can be filled either with SSL protocols -that shall be enabled and/or disabled, e.g. "SSLv3 TLSv1" or "!SSLv2 !SSLv3". However only the more -usual disable/exclude option should be used as this does not exclude future protocols by default. - -Further this patch introduces the completely new setting "ssl_ciphers". This one allows to set SSL -cipher suites. Right now, all SSL ciphers are accepted which is just weak or might Zarafa even make -even vulnerable to known SSL attacks. The German Federal Office for Information Security (BSI) says -that RC4 should not be used anymore - but Zarafa does it by default. And without this patch there -is also no way for Zarafa administrators to avoid that. Indeed this setting has the risk to get the -administrators ending up in a cipher mismatch between different systems but this new setting still -could be declared as officially unsupported and only for the brave ones who know what they do. Thus -the default is already set to something less weak than before but still below BSI recommendations. - -Finally this patch introduces the also new setting "ssl_prefer_server_ciphers". It does what it is -named after: When choosing a cipher during an SSL/TLS handshake, normally the client's preference -is used. If this setting is enabled, the server's preference will be used instead. This comes handy -to administrators for strange cipher orderings required for special configurations and clients - or -new weaknesses where workarounds are required for the time being. - -Testing: Configure zarafa-gateway, zarafa-ical and zarafa-server for cleartext and SSL as usual. -Try to login via POP3S, IMAPS, CalDAV-SSL and MAPI in SOAP over HTTPS. Change SSL protocols and the -ciphers to something more weak ("SSLv2" and "LOW") or to something more strong ("TLSv1.2" and e.g. -"HIGH"). During all my tests I did not figure out any newly introduced issue or Zarafa breakage. - -Important: The technical implementation of this patch might be not perfect as I am not really a C/ -C++ developer. The logic and the implementation is heavily based on Dovecot, Postfix and hints from -https://docs.fedoraproject.org/en-US/Fedora_Security_Team/html/Defensive_Coding/. There should be -a code review and code clean up by an experienced C/C++ developer before merging into Zarafa core. - -This patch should be only applied in conjuction with the POP3 RESP-CODES and AUTH-RESP-CODE patch, -the POP3 CAPA (CAPABILITIES) patch as well as the POP3 STLS (STARTTLS) patch applied before. - -Proposed to upstream via e-mail on Sat, 8 Mar 2014 14:30:29 +0100, patch was put into the upstream -ticket https://jira.zarafa.com/browse/ZCP-12143. - ---- zarafa-7.1.10/caldav/CalDAV.cpp 2014-05-23 15:56:36.000000000 +0200 -+++ zarafa-7.1.10/caldav/CalDAV.cpp.rsc 2014-08-12 19:45:04.000000000 +0200 -@@ -220,7 +220,9 @@ - { "log_timestamp", "1" }, - { "ssl_private_key_file", "/etc/zarafa/ical/privkey.pem" }, - { "ssl_certificate_file", "/etc/zarafa/ical/cert.pem" }, -- { "ssl_enable_v2", "no" }, -+ { "ssl_protocols", "!SSLv2" }, -+ { "ssl_ciphers", "ALL:!LOW:!SSLv2:!EXP:!aNULL" }, -+ { "ssl_prefer_server_ciphers", "no" }, - { "ssl_verify_client", "no" }, - { "ssl_verify_file", "" }, - { "ssl_verify_path", "" }, ---- zarafa-7.1.10/common/ECChannel.cpp 2014-05-23 15:56:36.000000000 +0200 -+++ zarafa-7.1.10/common/ECChannel.cpp.rsc 2014-08-12 19:48:00.000000000 +0200 -@@ -92,6 +92,11 @@ - HRESULT hr = hrSuccess; - char *szFile = NULL; - char *szPath = NULL; -+ char *ssl_protocols = strdup(lpConfig->GetSetting("ssl_protocols")); -+ char *ssl_ciphers = lpConfig->GetSetting("ssl_ciphers"); -+ char *ssl_name; -+ int ssl_proto, ssl_op = 0, ssl_include = 0, ssl_exclude = 0; -+ bool ssl_neg; - - if (lpConfig == NULL) { - hr = MAPI_E_CALL_FAILED; -@@ -107,11 +112,79 @@ - SSL_load_error_strings(); - lpCTX = SSL_CTX_new(SSLv23_server_method()); - SSL_CTX_set_options(lpCTX, SSL_OP_ALL); -- SSL_CTX_set_default_verify_paths(lpCTX); - -- // disable SSLv2 support -- if (!parseBool(lpConfig->GetSetting("ssl_enable_v2", "", "no"))) -- SSL_CTX_set_options(lpCTX, SSL_OP_NO_SSLv2); -+ ssl_name = strtok(ssl_protocols, " "); -+ while(ssl_name != NULL) { -+ if (*ssl_name != '!') -+ ssl_neg = FALSE; -+ else { -+ ssl_name++; -+ ssl_neg = TRUE; -+ } -+ -+ if (strcasecmp(ssl_name, SSL_TXT_SSLV2) == 0) -+ ssl_proto = 0x01; -+ else if (strcasecmp(ssl_name, SSL_TXT_SSLV3) == 0) -+ ssl_proto = 0x02; -+ else if (strcasecmp(ssl_name, SSL_TXT_TLSV1) == 0) -+ ssl_proto = 0x04; -+#ifdef SSL_TXT_TLSV1_1 -+ else if (strcasecmp(ssl_name, SSL_TXT_TLSV1_1) == 0) -+ ssl_proto = 0x08; -+#endif -+#ifdef SSL_TXT_TLSV1_2 -+ else if (strcasecmp(ssl_name, SSL_TXT_TLSV1_2) == 0) -+ ssl_proto = 0x10; -+#endif -+ else { -+ lpLogger->Log(EC_LOGLEVEL_ERROR, "Unknown protocol '%s' in ssl_protocols setting", ssl_name); -+ hr = MAPI_E_CALL_FAILED; -+ goto exit; -+ } -+ -+ if (ssl_neg) -+ ssl_exclude |= ssl_proto; -+ else -+ ssl_include |= ssl_proto; -+ -+ ssl_name = strtok(NULL, " "); -+ } -+ -+ if (ssl_include != 0) { -+ // Exclude everything, except those that are included (and let excludes still override those) -+ ssl_exclude |= 0x1f & ~ssl_include; -+ } -+ -+ if ((ssl_exclude & 0x01) != 0) -+ ssl_op |= SSL_OP_NO_SSLv2; -+ if ((ssl_exclude & 0x02) != 0) -+ ssl_op |= SSL_OP_NO_SSLv3; -+ if ((ssl_exclude & 0x04) != 0) -+ ssl_op |= SSL_OP_NO_TLSv1; -+#ifdef SSL_OP_NO_TLSv1_1 -+ if ((ssl_exclude & 0x08) != 0) -+ ssl_op |= SSL_OP_NO_TLSv1_1; -+#endif -+#ifdef SSL_OP_NO_TLSv1_2 -+ if ((ssl_exclude & 0x10) != 0) -+ ssl_op |= SSL_OP_NO_TLSv1_2; -+#endif -+ -+ if (ssl_protocols) { -+ SSL_CTX_set_options(lpCTX, ssl_op); -+ } -+ -+ if (ssl_ciphers && SSL_CTX_set_cipher_list(lpCTX, ssl_ciphers) != 1) { -+ lpLogger->Log(EC_LOGLEVEL_ERROR, "Can not set SSL cipher list to '%s': %s", ssl_ciphers, ERR_error_string(ERR_get_error(), 0)); -+ hr = MAPI_E_CALL_FAILED; -+ goto exit; -+ } -+ -+ if (parseBool(lpConfig->GetSetting("ssl_prefer_server_ciphers"))) { -+ SSL_CTX_set_options(lpCTX, SSL_OP_CIPHER_SERVER_PREFERENCE); -+ } -+ -+ SSL_CTX_set_default_verify_paths(lpCTX); - - if (SSL_CTX_use_certificate_chain_file(lpCTX, lpConfig->GetSetting("ssl_certificate_file")) != 1) { - lpLogger->Log(EC_LOGLEVEL_ERROR, "SSL CTX certificate file error: %s", ERR_error_string(ERR_get_error(), 0)); ---- zarafa-7.1.10/doc/manual.xml 2014-05-23 15:01:13.000000000 +0200 -+++ zarafa-7.1.10/doc/manual.xml.rsc 2014-08-12 19:45:04.000000000 +0200 -@@ -4226,11 +4226,33 @@ - - - -- -+ - -- Incoming SSL connections normally are v3. -- Default: no -- -+ Disabled or enabled protocol names. Supported protocol names -+ are SSLv2, SSLv3 -+ and TLSv1. If Zarafa was linked against -+ OpenSSL 1.0.1 or later there is additional support for the new protocols -+ TLSv1.1 and TLSv1.2. -+ To exclude both, SSLv2 and SSLv3 set -+ to !SSLv2 !SSLv3. SSLv2 is considered unsafe -+ and these connections should not be accepted. -+ Default: !SSLv2 -+ -+ -+ -+ -+ -+ -+ SSL ciphers to use, set to ALL for backward compatibility. -+ Default: ALL:!LOW:!SSLv2:!EXP:!aNULL -+ -+ -+ -+ -+ -+ -+ Prefer the server's order of SSL ciphers over client's. -+ Default: no - - - -@@ -8070,11 +8092,32 @@ - - - -- -+ -+ -+ Disabled or enabled protocol names. Supported protocol names -+ are SSLv2, SSLv3 -+ and TLSv1. If Zarafa was linked against -+ OpenSSL 1.0.1 or later there is additional support for the new protocols -+ TLSv1.1 and TLSv1.2. -+ To exclude both, SSLv2 and SSLv3 set -+ to !SSLv2 !SSLv3. SSLv2 is considered unsafe -+ and these connections should not be accepted. -+ Default: !SSLv2 -+ -+ -+ -+ -+ -+ -+ SSL ciphers to use, set to ALL for backward compatibility. -+ Default: ALL:!LOW:!SSLv2:!EXP:!aNULL -+ -+ -+ -+ -+ - -- Accept SSLv2 only connections. SSLv2 is considered -- unsafe, and these connections should not be -- accepted. -+ Prefer the server's order of SSL ciphers over client's. - Default: no - - -@@ -10075,11 +10118,32 @@ - - - -- -+ -+ -+ Disabled or enabled protocol names. Supported protocol names -+ are SSLv2, SSLv3 -+ and TLSv1. If Zarafa was linked against -+ OpenSSL 1.0.1 or later there is additional support for the new protocols -+ TLSv1.1 and TLSv1.2. -+ To exclude both, SSLv2 and SSLv3 set -+ to !SSLv2 !SSLv3. SSLv2 is considered unsafe -+ and these connections should not be accepted. -+ Default: !SSLv2 -+ -+ -+ -+ -+ -+ -+ SSL ciphers to use, set to ALL for backward compatibility. -+ Default: ALL:!LOW:!SSLv2:!EXP:!aNULL -+ -+ -+ -+ -+ - -- Accept SSLv2 only connections. SSLv2 is considered -- unsafe, and these connections should not be -- accepted. -+ Prefer the server's order of SSL ciphers over client's. - Default: no - - ---- zarafa-7.1.10/gateway/Gateway.cpp 2014-05-23 15:56:37.000000000 +0200 -+++ zarafa-7.1.10/gateway/Gateway.cpp.rsc 2014-08-12 19:45:04.000000000 +0200 -@@ -365,7 +365,9 @@ - { "ssl_verify_client", "no" }, - { "ssl_verify_file", "" }, - { "ssl_verify_path", "" }, -- { "ssl_enable_v2", "no" }, -+ { "ssl_protocols", "!SSLv2" }, -+ { "ssl_ciphers", "ALL:!LOW:!SSLv2:!EXP:!aNULL" }, -+ { "ssl_prefer_server_ciphers", "no" }, - { "log_method", "file" }, - { "log_file", "-" }, - { "log_level", "2", CONFIGSETTING_RELOADABLE }, ---- zarafa-7.1.10/installer/linux/gateway.cfg 2014-05-23 15:03:19.000000000 +0200 -+++ zarafa-7.1.10/installer/linux/gateway.cfg.rsc 2014-08-12 19:45:04.000000000 +0200 -@@ -84,8 +84,14 @@ - ssl_verify_file = - ssl_verify_path = - --# Accept SSLv2 only incoming connections --ssl_enable_v2 = no -+# SSL protocols to use, set to '!SSLv2' for 'ssl_enable_v2 = no' -+ssl_protocols = !SSLv2 -+ -+# SSL ciphers to use, set to 'ALL' for backward compatibility -+ssl_ciphers = ALL:!LOW:!SSLv2:!EXP:!aNULL -+ -+# Prefer the server's order of SSL ciphers over client's -+ssl_prefer_server_ciphers = no - - # Process model, using pthreads (thread) or processes (fork) - process_model = fork ---- zarafa-7.1.10/installer/linux/ical.cfg 2014-05-23 15:03:19.000000000 +0200 -+++ zarafa-7.1.10/installer/linux/ical.cfg.rsc 2014-08-12 19:45:04.000000000 +0200 -@@ -66,8 +66,14 @@ - ssl_verify_file = - ssl_verify_path = - --# Accept SSLv2 only incoming connections --ssl_enable_v2 = no -+# SSL protocols to use, set to '!SSLv2' for 'ssl_enable_v2 = no' -+ssl_protocols = !SSLv2 -+ -+# SSL ciphers to use, set to 'ALL' for backward compatibility -+ssl_ciphers = ALL:!LOW:!SSLv2:!EXP:!aNULL -+ -+# Prefer the server's order of SSL ciphers over client's -+ssl_prefer_server_ciphers = no - - ############################################################## - # OTHER ICAL SETTINGS ---- zarafa-7.1.10/installer/linux/server.cfg 2014-05-23 15:03:19.000000000 +0200 -+++ zarafa-7.1.10/installer/linux/server.cfg.rsc 2014-08-12 19:45:04.000000000 +0200 -@@ -154,8 +154,14 @@ - # Path with CA certificates, e.g. /etc/ssl/certs - server_ssl_ca_path = - --# Accept SSLv2 only connections. Normally v3 connections are used. --server_ssl_enable_v2 = no -+# SSL protocols to use, set to '!SSLv2' for 'server_ssl_enable_v2 = no' -+server_ssl_protocols = !SSLv2 -+ -+# SSL ciphers to use, set to 'ALL' for backward compatibility -+server_ssl_ciphers = ALL:!LOW:!SSLv2:!EXP:!aNULL -+ -+# Prefer the server's order of SSL ciphers over client's -+server_ssl_prefer_server_ciphers = no - - # Path of SSL Public keys of clients - sslkeys_path = /etc/zarafa/sslkeys ---- zarafa-7.1.10/provider/server/ECServer.cpp 2014-05-23 15:56:37.000000000 +0200 -+++ zarafa-7.1.10/provider/server/ECServer.cpp.rsc 2014-08-12 19:45:04.000000000 +0200 -@@ -919,7 +919,9 @@ - { "server_ssl_key_pass", "server", CONFIGSETTING_EXACT }, - { "server_ssl_ca_file", "/etc/zarafa/ssl/cacert.pem" }, - { "server_ssl_ca_path", "" }, -- { "server_ssl_enable_v2", "no" }, -+ { "server_ssl_protocols", "!SSLv2" }, -+ { "server_ssl_ciphers", "ALL:!LOW:!SSLv2:!EXP:!aNULL" }, -+ { "server_ssl_prefer_server_ciphers", "no" }, - { "sslkeys_path", "/etc/zarafa/sslkeys" }, // login keys - // Database options - { "database_engine", "mysql" }, ---- zarafa-7.1.10/provider/server/ECSoapServerConnection.cpp 2014-05-23 15:56:37.000000000 +0200 -+++ zarafa-7.1.10/provider/server/ECSoapServerConnection.cpp.rsc 2014-08-12 19:45:04.000000000 +0200 -@@ -240,6 +240,11 @@ - ECRESULT er = erSuccess; - int socket = SOAP_INVALID_SOCKET; - struct soap *lpsSoap = NULL; -+ char *server_ssl_protocols = strdup(m_lpConfig->GetSetting("server_ssl_protocols")); -+ char *server_ssl_ciphers = m_lpConfig->GetSetting("server_ssl_ciphers"); -+ char *ssl_name; -+ int ssl_proto, ssl_op = 0, ssl_include = 0, ssl_exclude = 0; -+ bool ssl_neg; - - if(lpServerName == NULL) { - er = ZARAFA_E_INVALID_PARAMETER; -@@ -270,10 +275,79 @@ - goto exit; - } - -- // disable SSLv2 support -- if (!parseBool(m_lpConfig->GetSetting("server_ssl_enable_v2", "", "no"))) -- SSL_CTX_set_options(lpsSoap->ctx, SSL_OP_NO_SSLv2); -- -+ SSL_CTX_set_options(lpsSoap->ctx, SSL_OP_ALL); -+ -+ ssl_name = strtok(server_ssl_protocols, " "); -+ while(ssl_name != NULL) { -+ if (*ssl_name != '!') -+ ssl_neg = FALSE; -+ else { -+ ssl_name++; -+ ssl_neg = TRUE; -+ } -+ -+ if (strcasecmp(ssl_name, SSL_TXT_SSLV2) == 0) -+ ssl_proto = 0x01; -+ else if (strcasecmp(ssl_name, SSL_TXT_SSLV3) == 0) -+ ssl_proto = 0x02; -+ else if (strcasecmp(ssl_name, SSL_TXT_TLSV1) == 0) -+ ssl_proto = 0x04; -+#ifdef SSL_TXT_TLSV1_1 -+ else if (strcasecmp(ssl_name, SSL_TXT_TLSV1_1) == 0) -+ ssl_proto = 0x08; -+#endif -+#ifdef SSL_TXT_TLSV1_2 -+ else if (strcasecmp(ssl_name, SSL_TXT_TLSV1_2) == 0) -+ ssl_proto = 0x10; -+#endif -+ else { -+ m_lpLogger->Log(EC_LOGLEVEL_FATAL, "Unknown protocol '%s' in server_ssl_protocols setting", ssl_name); -+ er = ZARAFA_E_CALL_FAILED; -+ goto exit; -+ } -+ -+ if (ssl_neg) -+ ssl_exclude |= ssl_proto; -+ else -+ ssl_include |= ssl_proto; -+ -+ ssl_name = strtok(NULL, " "); -+ } -+ -+ if (ssl_include != 0) { -+ // Exclude everything, except those that are included (and let excludes still override those) -+ ssl_exclude |= 0x1f & ~ssl_include; -+ } -+ -+ if ((ssl_exclude & 0x01) != 0) -+ ssl_op |= SSL_OP_NO_SSLv2; -+ if ((ssl_exclude & 0x02) != 0) -+ ssl_op |= SSL_OP_NO_SSLv3; -+ if ((ssl_exclude & 0x04) != 0) -+ ssl_op |= SSL_OP_NO_TLSv1; -+#ifdef SSL_OP_NO_TLSv1_1 -+ if ((ssl_exclude & 0x08) != 0) -+ ssl_op |= SSL_OP_NO_TLSv1_1; -+#endif -+#ifdef SSL_OP_NO_TLSv1_2 -+ if ((ssl_exclude & 0x10) != 0) -+ ssl_op |= SSL_OP_NO_TLSv1_2; -+#endif -+ -+ if (server_ssl_protocols) { -+ SSL_CTX_set_options(lpsSoap->ctx, ssl_op); -+ } -+ -+ if (server_ssl_ciphers && SSL_CTX_set_cipher_list(lpsSoap->ctx, server_ssl_ciphers) != 1) { -+ m_lpLogger->Log(EC_LOGLEVEL_FATAL, "Can not set SSL cipher list to '%s': %s", server_ssl_ciphers, ERR_error_string(ERR_get_error(), 0)); -+ er = ZARAFA_E_CALL_FAILED; -+ goto exit; -+ } -+ -+ if (parseBool(m_lpConfig->GetSetting("server_ssl_prefer_server_ciphers"))) { -+ SSL_CTX_set_options(lpsSoap->ctx, SSL_OP_CIPHER_SERVER_PREFERENCE); -+ } -+ - // request certificate from client, is OK if not present. - SSL_CTX_set_verify(lpsSoap->ctx, SSL_VERIFY_PEER | SSL_VERIFY_CLIENT_ONCE, NULL); - diff --git a/zarafa-7.1.11-gsoap-sslv3.patch b/zarafa-7.1.12-gsoap-sslv3.patch similarity index 51% rename from zarafa-7.1.11-gsoap-sslv3.patch rename to zarafa-7.1.12-gsoap-sslv3.patch index 877b0e1..b1e58f2 100644 --- a/zarafa-7.1.11-gsoap-sslv3.patch +++ b/zarafa-7.1.12-gsoap-sslv3.patch @@ -1,25 +1,27 @@ -Patch by Robert Scheck for zarafa >= 7.1.11 which removes the Zarafa- -specific override/limitation that forces SSLv3-only SOAP connection between the Zarafa services. -The pristine gSOAP library itself uses SSLv23_method() instead and thus allows TLSv1.0, TLSv1.1 -as well as TLSv1.2. Disable SSLv2 and SSLv3 as well as TLS compression explicitly; similar like -the Zarafa Outlook Client which meanwhile only allows TLSv1.0 (and better). +Patch by Robert Scheck for zarafa >= 7.1.12 which disables weak SSLv2 +and SSLv3 protocols for encrypted SOAP connections between the Zarafa services. Until (including) +the Zarafa 7.1.11 release the upstream default was to replace the SSLv23_method() that a pristine +gSOAP library ships with the "safer" SSLv3_method(). With Zarafa 7.1.12 the SSLv3_method() was +changed to SSLv23_method(). However this enables SSLv2 again (and still does not disable SSLv3). +Thus this patch disables SSLv2 and SSLv3 as well as TLS compression explicitly; similar like the +Zarafa Outlook Client which meanwhile only allows TLSv1.0 (and better). Proposed to upstream via e-mail on Wed, 2 Apr 2014 11:35:40 +0200, initial patch was put into the upstream ticket Ticket#2014040210000266. ---- zarafa-7.1.11/provider/common/SOAPSock.cpp 2014-09-03 10:45:06.000000000 +0200 -+++ zarafa-7.1.11/provider/common/SOAPSock.cpp.gsoap-sslv3 2015-03-04 00:28:25.000000000 +0100 -@@ -162,9 +162,6 @@ +--- zarafa-7.1.12/provider/common/SOAPSock.cpp 2015-04-07 13:10:13.000000000 +0200 ++++ zarafa-7.1.12/provider/common/SOAPSock.cpp.gsoap-sslv3 2015-04-07 16:32:20.000000000 +0200 +@@ -157,9 +157,6 @@ lpCmd->endpoint = strdup(strServerPath.c_str()); -- // override the gsoap default v23 method to the force safer v3 only method. -- lpCmd->soap->ctx = SSL_CTX_new(SSLv3_method()); +- // default allow SSLv3, TLSv1, TLSv1.1 and TLSv1.2 +- lpCmd->soap->ctx = SSL_CTX_new(SSLv23_method()); - #ifdef WITH_OPENSSL if (strncmp("https:", lpCmd->endpoint, 6) == 0) { // no need to add certificates to call, since soap also calls SSL_CTX_set_default_verify_paths() -@@ -188,6 +185,14 @@ +@@ -183,6 +180,14 @@ lpCmd->soap->fsslverify = ssl_verify_callback_zarafa_silent; SSL_CTX_set_verify(lpCmd->soap->ctx, SSL_VERIFY_PEER, lpCmd->soap->fsslverify); diff --git a/zarafa-7.1.12-licensed-archiver.patch b/zarafa-7.1.12-licensed-archiver.patch new file mode 100644 index 0000000..0ccde8c --- /dev/null +++ b/zarafa-7.1.12-licensed-archiver.patch @@ -0,0 +1,117 @@ +Patch by Robert Scheck for Zarafa >= 7.1.12 which removes a wrongly introduced dependency to the +proprietary zarafa-licensed. From Zarafa 7.1.11 to 7.1.12 there were some changes to the ValidateArchiverLicense() method; +due to these changes rebuilding fails with "ArchiverSession.cpp:53:23: fatal error: ECLicense.h: No such file or directory" +now. The patch just reverts the changes that were introduced from 7.1.11 to 7.1.12 to get the code building again. + +--- zarafa-7.1.12/ECtools/zarafa-archiver/ArchiverSession.cpp 2015-04-07 13:10:12.000000000 +0200 ++++ zarafa-7.1.12/ECtools/zarafa-archiver/ArchiverSession.cpp.licensed-archiver 2015-04-07 15:55:07.000000000 +0200 +@@ -50,8 +50,6 @@ + #include "mapiext.h" + #include "userutil.h" + #include "ECMsgStore.h" +-#include "ECLicense.h" +-#include "ECMAPILicense.h" + + typedef mapi_memory_ptr ECServerListPtr; + +@@ -879,38 +877,7 @@ + typedef mapi_object_ptr 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 +- { ++ HRESULT hr; + unsigned int ulArchivedUsers = 0; + unsigned int ulMaxUsers = 0; + +@@ -931,7 +898,6 @@ + } 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; +--- zarafa-7.1.12/ECtools/zarafa-archiver/Makefile.am 2015-04-07 12:00:49.000000000 +0200 ++++ zarafa-7.1.12/ECtools/zarafa-archiver/Makefile.am.licensed-archiver 2015-04-07 15:59:42.000000000 +0200 +@@ -9,7 +9,6 @@ + -I${top_srcdir}/provider/client \ + -I${top_srcdir}/provider/include \ + -I${top_srcdir}/provider/soap \ +- -I${top_srcdir}/liblicense \ + -I${top_builddir}/provider/soap \ + $(GSOAP_CFLAGS) \ + -I${top_srcdir}/common \ +@@ -17,9 +16,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 \ +--- zarafa-7.1.12/ECtools/zarafa-archiver/Makefile.in 2015-04-07 12:03:40.000000000 +0200 ++++ zarafa-7.1.12/ECtools/zarafa-archiver/Makefile.in.licensed-archiver 2015-04-07 16:00:15.000000000 +0200 +@@ -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 \ +@@ -395,7 +393,6 @@ + -I${top_srcdir}/provider/client \ + -I${top_srcdir}/provider/include \ + -I${top_srcdir}/provider/soap \ +- -I${top_srcdir}/liblicense \ + -I${top_builddir}/provider/soap \ + $(GSOAP_CFLAGS) \ + -I${top_srcdir}/common \ +@@ -403,9 +400,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 \ diff --git a/zarafa-7.1.9-ssl_ecdhe.patch b/zarafa-7.1.12-ssl_ecdhe.patch similarity index 69% rename from zarafa-7.1.9-ssl_ecdhe.patch rename to zarafa-7.1.12-ssl_ecdhe.patch index 6596637..837fba2 100644 --- a/zarafa-7.1.9-ssl_ecdhe.patch +++ b/zarafa-7.1.12-ssl_ecdhe.patch @@ -1,4 +1,4 @@ -Patch by Robert Scheck for Zarafa <= 7.1.9 which implements ECDHE (elliptic +Patch by Robert Scheck for Zarafa >= 7.1.12 which implements ECDHE (elliptic curve diffie-hellman key exchange) support. http://en.wikipedia.org/wiki/Elliptic_curve_cryptography is providing more information about elliptic curves. @@ -22,24 +22,24 @@ by an experienced C/C++ and OpenSSL developer before merging into Zarafa core. This patch should be only applied after ZCP-12143 and its dependencies. However this patch might maybe not directly apply due to some previous merge issues as mentioned in Ticket#2014030810000131. -Proposed to upstream via e-mail on Mon, 14 Apr 2014 12:04:17 +0200, patch was put into the upstream +Proposed to upstream via e-mail on Mon, 14 Apr 2014 12:04:17 +0200, initial patch was put into upstream ticket https://jira.zarafa.com/browse/ZCP-12237. ---- zarafa-7.1.9/common/ECChannel.cpp 2014-04-13 23:46:59.000000000 +0200 -+++ zarafa-7.1.9/common/ECChannel.cpp.ssl_ecdhe 2014-04-13 23:59:43.000000000 +0200 -@@ -97,6 +97,9 @@ - char *ssl_name; - int ssl_proto, ssl_op = 0, ssl_include = 0, ssl_exclude = 0; - bool ssl_neg; +--- zarafa-7.1.12/common/ECChannel.cpp 2015-04-07 13:10:12.000000000 +0200 ++++ zarafa-7.1.12/common/ECChannel.cpp.ssl_ecdhe 2015-04-07 17:12:15.000000000 +0200 +@@ -93,6 +93,9 @@ + char *ssl_ciphers = lpConfig->GetSetting("ssl_ciphers"); + char *ssl_name = NULL; + int ssl_op = 0, ssl_include = 0, ssl_exclude = 0; +#if !defined(OPENSSL_NO_ECDH) && defined(NID_X9_62_prime256v1) + EC_KEY *ecdh; +#endif if (lpConfig == NULL) { - hr = MAPI_E_CALL_FAILED; + lpLogger->Log(EC_LOGLEVEL_ERROR, "ECChannel::HrSetCtx(): invalid parameters"); @@ -113,6 +116,16 @@ - lpCTX = SSL_CTX_new(SSLv23_server_method()); - SSL_CTX_set_options(lpCTX, SSL_OP_ALL); + + SSL_CTX_set_options(lpCTX, SSL_OP_ALL); // enable quirk and bug workarounds +#if !defined(OPENSSL_NO_ECDH) && defined(NID_X9_62_prime256v1) + ecdh = EC_KEY_new_by_curve_name(NID_X9_62_prime256v1); @@ -53,20 +53,20 @@ ticket https://jira.zarafa.com/browse/ZCP-12237. + ssl_name = strtok(ssl_protocols, " "); while(ssl_name != NULL) { - if (*ssl_name != '!') ---- zarafa-7.1.9/provider/server/ECSoapServerConnection.cpp 2014-04-13 23:46:59.000000000 +0200 -+++ zarafa-7.1.9/provider/server/ECSoapServerConnection.cpp.ssl_ecdhe 2014-04-14 00:00:54.000000000 +0200 -@@ -245,6 +245,9 @@ - char *ssl_name; - int ssl_proto, ssl_op = 0, ssl_include = 0, ssl_exclude = 0; - bool ssl_neg; + int ssl_proto = 0; +--- zarafa-7.1.12/provider/server/ECSoapServerConnection.cpp 2015-04-07 13:10:13.000000000 +0200 ++++ zarafa-7.1.12/provider/server/ECSoapServerConnection.cpp.ssl_ecdhe 2015-04-07 17:13:23.000000000 +0200 +@@ -235,6 +235,9 @@ + char *server_ssl_ciphers = m_lpConfig->GetSetting("server_ssl_ciphers"); + char *ssl_name = NULL; + int ssl_op = 0, ssl_include = 0, ssl_exclude = 0; +#if !defined(OPENSSL_NO_ECDH) && defined(NID_X9_62_prime256v1) + EC_KEY *ecdh; +#endif if(lpServerName == NULL) { - er = ZARAFA_E_INVALID_PARAMETER; -@@ -277,6 +280,16 @@ + free(server_ssl_ciphers); +@@ -268,6 +271,16 @@ SSL_CTX_set_options(lpsSoap->ctx, SSL_OP_ALL); @@ -82,4 +82,4 @@ ticket https://jira.zarafa.com/browse/ZCP-12237. + ssl_name = strtok(server_ssl_protocols, " "); while(ssl_name != NULL) { - if (*ssl_name != '!') + int ssl_proto = 0; diff --git a/zarafa-7.1.12-ssl_protocols_ciphers.patch b/zarafa-7.1.12-ssl_protocols_ciphers.patch new file mode 100644 index 0000000..c9de1c6 --- /dev/null +++ b/zarafa-7.1.12-ssl_protocols_ciphers.patch @@ -0,0 +1,123 @@ +Patch by Robert Scheck for Zarafa >= 7.1.12 which re-adds the whole +documentation that was initially proposed to upstream but lost when this feature was backported +from Zarafa 7.2 to the 7.1 series. + +Proposed to upstream via e-mail on Sat, 8 Mar 2014 14:30:29 +0100, initial patch was put into +the upstream ticket https://jira.zarafa.com/browse/ZCP-12143. + +--- zarafa-7.1.12/doc/manual.xml 2015-04-07 12:03:31.000000000 +0200 ++++ zarafa-7.1.12/doc/manual.xml.ssl_protocols_ciphers 2015-04-07 17:05:47.000000000 +0200 +@@ -4226,14 +4226,35 @@ + + + +- ++ + +- Incoming SSL connections normally are v3. +- Default: no +- ++ Disabled or enabled protocol names. Supported protocol names ++ are SSLv2, SSLv3 ++ and TLSv1. If Zarafa was linked against ++ OpenSSL 1.0.1 or later there is additional support for the new protocols ++ TLSv1.1 and TLSv1.2. ++ To exclude both, SSLv2 and SSLv3 set ++ to !SSLv2 !SSLv3. SSLv2 is considered unsafe ++ and these connections should not be accepted. ++ Default: !SSLv2 ++ ++ ++ ++ ++ ++ ++ SSL ciphers to use, set to ALL for backward compatibility. ++ Default: ALL:!LOW:!SSLv2:!EXP:!aNULL + + + ++ ++ ++ ++ Prefer the server's order of SSL ciphers over client's. ++ Default: no ++ ++ + + + +@@ -8090,11 +8111,32 @@ + + + +- ++ ++ ++ Disabled or enabled protocol names. Supported protocol names ++ are SSLv2, SSLv3 ++ and TLSv1. If Zarafa was linked against ++ OpenSSL 1.0.1 or later there is additional support for the new protocols ++ TLSv1.1 and TLSv1.2. ++ To exclude both, SSLv2 and SSLv3 set ++ to !SSLv2 !SSLv3. SSLv2 is considered unsafe ++ and these connections should not be accepted. ++ Default: !SSLv2 ++ ++ ++ ++ ++ + +- Accept SSLv2 only connections. SSLv2 is considered +- unsafe, and these connections should not be +- accepted. ++ SSL ciphers to use, set to ALL for backward compatibility. ++ Default: ALL:!LOW:!SSLv2:!EXP:!aNULL ++ ++ ++ ++ ++ ++ ++ Prefer the server's order of SSL ciphers over client's. + Default: no + + +@@ -10091,11 +10133,32 @@ + + + +- ++ ++ ++ Disabled or enabled protocol names. Supported protocol names ++ are SSLv2, SSLv3 ++ and TLSv1. If Zarafa was linked against ++ OpenSSL 1.0.1 or later there is additional support for the new protocols ++ TLSv1.1 and TLSv1.2. ++ To exclude both, SSLv2 and SSLv3 set ++ to !SSLv2 !SSLv3. SSLv2 is considered unsafe ++ and these connections should not be accepted. ++ Default: !SSLv2 ++ ++ ++ ++ ++ ++ ++ SSL ciphers to use, set to ALL for backward compatibility. ++ Default: ALL:!LOW:!SSLv2:!EXP:!aNULL ++ ++ ++ ++ ++ + +- Accept SSLv2 only connections. SSLv2 is considered +- unsafe, and these connections should not be +- accepted. ++ Prefer the server's order of SSL ciphers over client's. + Default: no + + diff --git a/zarafa-7.1.11-webaccess-mcrypt.patch b/zarafa-7.1.12-webaccess-mcrypt.patch similarity index 71% rename from zarafa-7.1.11-webaccess-mcrypt.patch rename to zarafa-7.1.12-webaccess-mcrypt.patch index 56b5274..e7b3fcd 100644 --- a/zarafa-7.1.11-webaccess-mcrypt.patch +++ b/zarafa-7.1.12-webaccess-mcrypt.patch @@ -1,4 +1,4 @@ -Patch by Robert Scheck for Zarafa >= 7.1.10 which fixes the fix that fixes CVE-2014-0103. Ush, +Patch by Robert Scheck for Zarafa >= 7.1.12 which fixes the fix that fixes CVE-2014-0103. Ush, that was complicated, so: CVE-2014-0103 exists because Zarafa WebAccess < 7.1.10 and Zarafa WebApp < 1.6 storing passwords in cleartext on server (in the PHP session). Zarafa solved this flaw by using openssl_encrypt() and openssl_decrypt() from PHP's OpenSSL bindings. However these functions are only available in PHP 5.3 or later. Without this patch suggestion, any @@ -25,32 +25,32 @@ This requires php-openssl (provided by php-common) on RHEL 6 (and later) and php Proposed to upstream via e-mail on Thu, 5 Jun 2014 00:24:32 +0200, initial patch was put into the (non-disclosed) upstream ticket https://jira.zarafa.com/browse/ZCP-12407. ---- zarafa-7.1.10/php-webclient-ajax/index.php 2014-05-23 15:56:38.000000000 +0200 -+++ zarafa-7.1.10/php-webclient-ajax/index.php.webaccess-mcrypt 2014-06-05 00:08:18.000000000 +0200 +--- zarafa-7.1.12/php-webclient-ajax/index.php 2015-04-07 13:10:13.000000000 +0200 ++++ zarafa-7.1.12/php-webclient-ajax/index.php.webaccess-mcrypt 2015-04-07 16:22:23.000000000 +0200 @@ -135,6 +135,8 @@ - // if user has openssl module installed - if(function_exists("openssl_encrypt")) { - $_SESSION['password'] = openssl_encrypt($password,"des-ede3-cbc",PASSWORD_KEY,0,PASSWORD_IV); + } else { + $_SESSION['password'] = openssl_encrypt($password,"des-ede3-cbc",PASSWORD_KEY,0,PASSWORD_IV); + } + } elseif(function_exists("mcrypt_encrypt")) { + $_SESSION['password'] = base64_encode(mcrypt_encrypt(MCRYPT_TRIPLEDES, PASSWORD_KEY, $password, MCRYPT_MODE_CBC, PASSWORD_IV)); } else { $_SESSION["password"] = $password; } ---- zarafa-7.1.10/php-webclient-ajax/server/core/class.mapisession.php 2014-05-23 15:56:38.000000000 +0200 -+++ zarafa-7.1.10/php-webclient-ajax/server/core/class.mapisession.php.webaccess-mcrypt 2014-06-05 00:08:57.000000000 +0200 +--- zarafa-7.1.12/php-webclient-ajax/server/core/class.mapisession.php 2015-04-07 13:10:14.000000000 +0200 ++++ zarafa-7.1.12/php-webclient-ajax/server/core/class.mapisession.php.webaccess-mcrypt 2015-04-07 16:23:58.000000000 +0200 @@ -132,6 +132,8 @@ - if(is_string($username) && is_string($password)) { - if(function_exists("openssl_decrypt")) { - $password = openssl_decrypt($password,"des-ede3-cbc",PASSWORD_KEY,0,PASSWORD_IV); + } else { + $password = openssl_decrypt($password,"des-ede3-cbc",PASSWORD_KEY,0,PASSWORD_IV); + } + } elseif(function_exists("mcrypt_decrypt")) { + $password = rtrim(mcrypt_decrypt(MCRYPT_TRIPLEDES, PASSWORD_KEY, base64_decode($password), MCRYPT_MODE_CBC, PASSWORD_IV), "\0"); } // logon $this->session = mapi_logon_zarafa($username, $password, $server, $sslcert_file, $sslcert_pass); -@@ -139,6 +141,8 @@ - - if(function_exists("openssl_encrypt")) { - $password = openssl_encrypt($password,"des-ede3-cbc",PASSWORD_KEY,0,PASSWORD_IV); +@@ -144,6 +146,8 @@ + } else { + $password = openssl_encrypt($password,"des-ede3-cbc",PASSWORD_KEY,0,PASSWORD_IV); + } + } elseif(function_exists("mcrypt_encrypt")) { + $password = base64_encode(mcrypt_encrypt(MCRYPT_TRIPLEDES, PASSWORD_KEY, $password, MCRYPT_MODE_CBC, PASSWORD_IV)); } diff --git a/zarafa.spec b/zarafa.spec index 4fc0f9a..2debd81 100644 --- a/zarafa.spec +++ b/zarafa.spec @@ -1,6 +1,6 @@ %global beta_or_rc 0 -%global actual_release 3 -%global svnrevision 46050 +%global actual_release 1 +%global svnrevision 48726 %global with_search 1 %global with_ldap 1 %global with_xmlto 1 @@ -31,7 +31,7 @@ Summary: Open Source Edition of the Zarafa Collaboration Platform Name: zarafa -Version: 7.1.11 +Version: 7.1.12 %if %{beta_or_rc} Release: 0.%{actual_release}.svn%{svnrevision}%{?dist} %else @@ -57,16 +57,17 @@ Source3: %{name}-webaccess.conf Patch0: zarafa-7.1.11-rpath.patch Patch1: zarafa-7.1.11-php-unbundle.patch Patch2: zarafa-7.1.10-kyotocabinet.patch -Patch3: zarafa-7.1.10-ssl_protocols_ciphers.patch -Patch4: zarafa-7.1.9-ssl_ecdhe.patch +Patch3: zarafa-7.1.12-ssl_protocols_ciphers.patch +Patch4: zarafa-7.1.12-ssl_ecdhe.patch Patch5: zarafa-7.1.11-plaintext_auth_localhost.patch Patch6: zarafa-7.1.10-imap-badcharset.patch Patch7: zarafa-7.1.10-imap-fetch-body.patch Patch8: zarafa-7.1.11-vacation-headers.patch Patch9: zarafa-7.1.11-vacation-headers2.patch Patch10: zarafa-7.1.11-webaccess-fail2ban.patch -Patch11: zarafa-7.1.11-webaccess-mcrypt.patch -Patch12: zarafa-7.1.11-gsoap-sslv3.patch +Patch11: zarafa-7.1.12-webaccess-mcrypt.patch +Patch12: zarafa-7.1.12-gsoap-sslv3.patch +Patch13: zarafa-7.1.12-licensed-archiver.patch BuildRequires: bison BuildRequires: gcc-c++ @@ -406,6 +407,7 @@ touch -c -r aclocal.m4.rpath aclocal.m4 %patch11 -p1 -b .webaccess-mcrypt rm -f php-webclient-ajax/{.,*,*/*}/*.webaccess-* %patch12 -p1 -b .gsoap-sslv3 +%patch13 -p1 -b .licensed-archiver %build %if 0%{?rhel}%{?fedora} < 6 @@ -553,7 +555,7 @@ mkdir -p $RPM_BUILD_ROOT%{_datadir}/%{name}-webaccess/plugins/ # Remove unwanted language connectors and webaccess files rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}-webaccess/client/widgets/fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.{cfm,pl} -rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}-webaccess/{.htaccess,%{name}-webaccess.conf,senddocument.php} +rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}-webaccess/{.htaccess,%{name}-webaccess.conf} # Remove flash-based multi-attachment upload (missing source) %if %{no_multiupload} @@ -782,8 +784,6 @@ fi %{_libdir}/libicalmapi.so %{_libdir}/libinetmapi.so %{_libdir}/libmapi.so -%{_libdir}/libmapicalendar.so -%{_libdir}/libmapitimezone.so %{_libdir}/libcommon_mapi.a %{_libdir}/libcommon_service.a %{_libdir}/libcommon_ssl.a @@ -792,10 +792,8 @@ fi %{_libdir}/libzarafasync.so %{_includedir}/icalmapi/ %{_includedir}/inetmapi/ -%{_includedir}/mapitimezone/ %{_includedir}/mapi4linux/ %{_includedir}/libfreebusy/ -%{_includedir}/libmapicalendar/ %{_includedir}/libzarafasync/ %{_includedir}/%{name}/ %{_libdir}/pkgconfig/%{name}.pc @@ -940,12 +938,11 @@ fi %{_libdir}/libicalmapi.so.* %{_libdir}/libinetmapi.so.* %{_libdir}/libmapi.so.* -%{_libdir}/libmapicalendar.so.* -%{_libdir}/libmapitimezone.so.* %files -n php-mapi %defattr(-,root,root,-) %config(noreplace) %{_sysconfdir}/php.d/%{ini_name} +%config(noreplace) %{_sysconfdir}/%{name}/php-mapi.cfg %{_datadir}/php/mapi/ %{_libdir}/php/modules/mapi.so @@ -954,7 +951,8 @@ fi %{python_sitearch}/* %changelog -* Sun Feb 22 2015 Robert Scheck 7.1.11-3 +* Tue Apr 07 2015 Robert Scheck 7.1.12-1 +- Upgrade to 7.1.12 - Added multiple minor enhancement and bugfix patches - Added patch to fix CVE-2014-0103 for PHP < 5.3 (#1073618) - Handle "su" option in logrotate >= 3.8.0 to avoid errors From f800d1c7270ae156c3e498405b3692259b7d3f2b Mon Sep 17 00:00:00 2001 From: Robert Scheck Date: Mon, 18 May 2015 23:58:02 +0200 Subject: [PATCH 18/23] - Upgrade to 7.1.12 (re-released) - Backported patch from Zarafa 7.2 to fix CVE-2015-3436 (#1222151) --- sources | 2 +- zarafa-7.1.12-upgrade-lock.patch | 56 ++++++++++++++++++++++++++++++++ zarafa.spec | 10 ++++-- 3 files changed, 65 insertions(+), 3 deletions(-) create mode 100644 zarafa-7.1.12-upgrade-lock.patch diff --git a/sources b/sources index 4a70ced..a15167f 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -98ceed8b35a68bba669aecccbc7b1f43 zcp-7.1.12.tar.gz +4744f5c09ca082ea23cd28ea1d10941f zcp-7.1.12.tar.gz diff --git a/zarafa-7.1.12-upgrade-lock.patch b/zarafa-7.1.12-upgrade-lock.patch new file mode 100644 index 0000000..2a1fddd --- /dev/null +++ b/zarafa-7.1.12-upgrade-lock.patch @@ -0,0 +1,56 @@ +Patch by Robert Scheck for Zarafa 7.1.12 which backports the fix for +CVE-2015-3436. Guido Günther detected and reported that replacing "/tmp/zarafa-upgrade-lock" by +a symlink makes the zarafa-server process following that symlink and thus allows to overwrite +arbitrary files in the filesystem (assuming zarafa-server runs as root which is not the case by +default at Fedora, but it is the upstream default). One just needs write permissions in /tmp and +wait until the zarafa-server is restarted. https://bugzilla.redhat.com/show_bug.cgi?id=1222151 +contains further information. The difference between this backport and the original diff is that +the log levels were reworked from Zarafa 7.1.x to 7.2.x (which this backport takes care of). + +--- zarafa-7.1.12/provider/server/ECServer.cpp 2015-05-08 15:09:05.000000000 +0200 ++++ zarafa-7.1.12/provider/server/ECServer.cpp.upgrade-lock 2015-05-18 23:05:00.000000000 +0200 +@@ -101,6 +101,8 @@ + // have to go with the safe value which is for 64bit. + #define MYSQL_MIN_THREAD_STACK (256*1024) + ++const char upgrade_lock_file[] = "/tmp/zarafa-upgrade-lock"; ++ + extern ECSessionManager* g_lpSessionManager; + + // scheduled functions +@@ -832,7 +834,7 @@ + // SIGSEGV backtrace support + stack_t st = {0}; + struct sigaction act = {{0}}; +- FILE *tmplock = NULL; ++ int tmplock = -1; + struct stat dir = {0}; + struct passwd *runasUser = NULL; + +@@ -1288,8 +1290,9 @@ + m_bDatabaseUpdateIgnoreSignals = true; + + // add a lock file to disable the /etc/init.d scripts +- tmplock = fopen("/tmp/zarafa-upgrade-lock","w"); +- if (!tmplock) ++ tmplock = open(upgrade_lock_file, O_CREAT | O_EXCL, S_IRUSR | S_IWUSR); ++ ++ if (tmplock == -1) + g_lpLogger->Log(EC_LOGLEVEL_FATAL, "WARNING: Unable to place upgrade lockfile: %s", strerror(errno)); + + #ifdef EMBEDDED_MYSQL +@@ -1314,9 +1317,11 @@ + er = lpDatabaseFactory->UpdateDatabase(m_bForceDatabaseUpdate, dbError); + + // remove lock file +- if (tmplock) { +- fclose(tmplock); +- unlink("/tmp/zarafa-upgrade-lock"); ++ if (tmplock != -1) { ++ if (unlink(upgrade_lock_file) == -1) ++ g_lpLogger->Log(EC_LOGLEVEL_FATAL, "WARNING: Unable to delete upgrade lockfile (%s): %s", upgrade_lock_file, strerror(errno)); ++ ++ close(tmplock); + } + + if(er == ZARAFA_E_INVALID_VERSION) { diff --git a/zarafa.spec b/zarafa.spec index 2debd81..3821ad1 100644 --- a/zarafa.spec +++ b/zarafa.spec @@ -1,6 +1,6 @@ %global beta_or_rc 0 -%global actual_release 1 -%global svnrevision 48726 +%global actual_release 2 +%global svnrevision 49411 %global with_search 1 %global with_ldap 1 %global with_xmlto 1 @@ -68,6 +68,7 @@ Patch10: zarafa-7.1.11-webaccess-fail2ban.patch Patch11: zarafa-7.1.12-webaccess-mcrypt.patch Patch12: zarafa-7.1.12-gsoap-sslv3.patch Patch13: zarafa-7.1.12-licensed-archiver.patch +Patch14: zarafa-7.1.12-upgrade-lock.patch BuildRequires: bison BuildRequires: gcc-c++ @@ -408,6 +409,7 @@ touch -c -r aclocal.m4.rpath aclocal.m4 rm -f php-webclient-ajax/{.,*,*/*}/*.webaccess-* %patch12 -p1 -b .gsoap-sslv3 %patch13 -p1 -b .licensed-archiver +%patch14 -p1 -b .upgrade-lock %build %if 0%{?rhel}%{?fedora} < 6 @@ -951,6 +953,10 @@ fi %{python_sitearch}/* %changelog +* Mon May 18 2015 Robert Scheck 7.1.12-2 +- Upgrade to 7.1.12 (re-released) +- Backported patch from Zarafa 7.2 to fix CVE-2015-3436 (#1222151) + * Tue Apr 07 2015 Robert Scheck 7.1.12-1 - Upgrade to 7.1.12 - Added multiple minor enhancement and bugfix patches From 55f9cedbfc07f92d51cf092b539772bb9df089cb Mon Sep 17 00:00:00 2001 From: Robert Scheck Date: Wed, 1 Jul 2015 23:50:59 +0200 Subject: [PATCH 19/23] Added patch to build using GCC 5.x --- zarafa-7.1.12-gcc5.patch | 2185 ++++++++++++++++++++++++++++++++++++++ zarafa.spec | 8 +- 2 files changed, 2192 insertions(+), 1 deletion(-) create mode 100644 zarafa-7.1.12-gcc5.patch diff --git a/zarafa-7.1.12-gcc5.patch b/zarafa-7.1.12-gcc5.patch new file mode 100644 index 0000000..02eecfc --- /dev/null +++ b/zarafa-7.1.12-gcc5.patch @@ -0,0 +1,2185 @@ +Patch by Robert Scheck for zarafa >= 7.1.12 which updates autoconf/boost.m4 to +avoid build failures like "configure: error: invalid value: boost_major_version=" when building using the +GCC 5.x. The second part of the patch just avoids running autoconf and is the generated result. + +--- zarafa-7.1.12/autoconf/boost.m4 2015-05-08 14:19:47.000000000 +0200 ++++ zarafa-7.1.12/autoconf/boost.m4.gcc5 2015-07-01 21:46:37.000000000 +0200 +@@ -1,5 +1,5 @@ + # boost.m4: Locate Boost headers and libraries for autoconf-based projects. +-# Copyright (C) 2007, 2008, 2009 Benoit Sigoure ++# Copyright (C) 2007-2011, 2014 Benoit Sigoure + # + # This program is free software: you can redistribute it and/or modify + # it under the terms of the GNU General Public License as published by +@@ -22,7 +22,7 @@ + # along with this program. If not, see . + + m4_define([_BOOST_SERIAL], [m4_translit([ +-# serial 12 ++# serial 24 + ], [# + ], [])]) + +@@ -45,17 +45,22 @@ + # Note: THESE MACROS ASSUME THAT YOU USE LIBTOOL. If you don't, don't worry, + # simply read the README, it will show you what to do step by step. + +-m4_pattern_forbid([^_?BOOST_]) ++m4_pattern_forbid([^_?(BOOST|Boost)_]) + + + # _BOOST_SED_CPP(SED-PROGRAM, PROGRAM, + # [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) + # -------------------------------------------------------- + # Same as AC_EGREP_CPP, but leave the result in conftest.i. +-# PATTERN is *not* overquoted, as in AC_EGREP_CPP. It could be useful +-# to turn this into a macro which extracts the value of any macro. ++# ++# SED-PROGRAM is *not* overquoted, as in AC_EGREP_CPP. It is expanded ++# in double-quotes, so escape your double quotes. ++# ++# It could be useful to turn this into a macro which extracts the ++# value of any macro. + m4_define([_BOOST_SED_CPP], +-[AC_LANG_PREPROC_REQUIRE()dnl ++[AC_LANG_PUSH([C++])dnl ++AC_LANG_PREPROC_REQUIRE()dnl + AC_REQUIRE([AC_PROG_SED])dnl + AC_LANG_CONFTEST([AC_LANG_SOURCE([[$2]])]) + AS_IF([dnl eval is necessary to expand ac_cpp. +@@ -67,13 +72,31 @@ + dnl boost_cv_lib_version='1_37\r' for instance, which breaks + dnl everything else. + dnl Cannot use 'dnl' after [$4] because a trailing dnl may break AC_CACHE_CHECK ++dnl ++dnl Beware that GCC 5, when expanding macros, may embed # line directives ++dnl a within single line: ++dnl ++dnl # 1 "conftest.cc" ++dnl # 1 "" ++dnl # 1 "" ++dnl # 1 "conftest.cc" ++dnl # 1 "/opt/local/include/boost/version.hpp" 1 3 ++dnl # 2 "conftest.cc" 2 ++dnl boost-lib-version = ++dnl # 2 "conftest.cc" 3 ++dnl "1_56" ++dnl ++dnl So get rid of the # lines, and glue the remaining ones together. + (eval "$ac_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD | ++ grep -v '#' | + tr -d '\r' | ++ tr -s '\n' ' ' | + $SED -n -e "$1" >conftest.i 2>&1], + [$3], + [$4]) + rm -rf conftest* +-])# AC_EGREP_CPP ++AC_LANG_POP([C++])dnl ++])# _BOOST_SED_CPP + + + +@@ -98,6 +121,7 @@ + IFS=$boost_save_IFS + shift + boost_version_req=`expr "$[1]" '*' 100000 + "$[2]" '*' 100 + "$[3]"` ++boost_version_req_string=$[1].$[2].$[3] + AC_ARG_WITH([boost], + [AS_HELP_STRING([--with-boost=DIR], + [prefix of Boost $1 @<:@guess@:>@])])dnl +@@ -113,9 +137,9 @@ + fi + fi + AC_SUBST([DISTCHECK_CONFIGURE_FLAGS], +- ["$DISTCHECK_CONFIGURE_FLAGS '--with-boost=$with_boost'"]) ++ ["$DISTCHECK_CONFIGURE_FLAGS '--with-boost=$with_boost'"])dnl + boost_save_CPPFLAGS=$CPPFLAGS +- AC_CACHE_CHECK([for Boost headers version >= $boost_version_req], ++ AC_CACHE_CHECK([for Boost headers version >= $boost_version_req_string], + [boost_cv_inc_path], + [boost_cv_inc_path=no + AC_LANG_PUSH([C++])dnl +@@ -183,7 +207,7 @@ + ]) + case $boost_cv_inc_path in #( + no) +- boost_errmsg="cannot find Boost headers version >= $boost_version_req" ++ boost_errmsg="cannot find Boost headers version >= $boost_version_req_string" + m4_if([$2], [], [AC_MSG_ERROR([$boost_errmsg])], + [AC_MSG_NOTICE([$boost_errmsg])]) + $2 +@@ -192,21 +216,16 @@ + BOOST_CPPFLAGS= + ;;#( + *) +- AC_SUBST([BOOST_CPPFLAGS], ["-I$boost_cv_inc_path"]) +- ;; +- esac +- case $boost_cv_inc_path in #( +- no) +- ;;#( +- *) +- AC_DEFINE([HAVE_BOOST], [1], +- [Defined if the requested minimum BOOST version is satisfied]) ++ AC_SUBST([BOOST_CPPFLAGS], ["-I$boost_cv_inc_path"])dnl + ;; + esac ++ if test x"$boost_cv_inc_path" != xno; then ++ AC_DEFINE([HAVE_BOOST], [1], ++ [Defined if the requested minimum BOOST version is satisfied]) + AC_CACHE_CHECK([for Boost's header version], + [boost_cv_lib_version], + [m4_pattern_allow([^BOOST_LIB_VERSION$])dnl +- _BOOST_SED_CPP([/^boost-lib-version = /{s///;s/\"//g;p;g;}], ++ _BOOST_SED_CPP([[/^boost-lib-version = /{s///;s/[\" ]//g;p;q;}]], + [#include + boost-lib-version = BOOST_LIB_VERSION], + [boost_cv_lib_version=`cat conftest.i`])]) +@@ -214,23 +233,26 @@ + boost_major_version=`echo "$boost_cv_lib_version" | sed 's/_//;s/_.*//'` + case $boost_major_version in #( + '' | *[[!0-9]]*) +- AC_MSG_ERROR([invalid value: boost_major_version=$boost_major_version]) ++ AC_MSG_ERROR([invalid value: boost_major_version='$boost_major_version']) + ;; + esac ++fi + CPPFLAGS=$boost_save_CPPFLAGS + ])# BOOST_REQUIRE + ++ + # BOOST_STATIC() + # -------------- + # Add the "--enable-static-boost" configure argument. If this argument is given + # on the command line, static versions of the libraries will be looked up. + AC_DEFUN([BOOST_STATIC], + [AC_ARG_ENABLE([static-boost], +- [AC_HELP_STRING([--enable-static-boost], ++ [AS_HELP_STRING([--enable-static-boost], + [Prefer the static boost libraries over the shared ones [no]])], + [enable_static_boost=yes], + [enable_static_boost=no])])# BOOST_STATIC + ++ + # BOOST_FIND_HEADER([HEADER-NAME], [ACTION-IF-NOT-FOUND], [ACTION-IF-FOUND]) + # -------------------------------------------------------------------------- + # Wrapper around AC_CHECK_HEADER for Boost headers. Useful to check for +@@ -263,14 +285,16 @@ + ])# BOOST_FIND_HEADER + + +-# BOOST_FIND_LIB([LIB-NAME], [PREFERRED-RT-OPT], [HEADER-NAME], [CXX-TEST], +-# [CXX-PROLOGUE]) +-# ------------------------------------------------------------------------- +-# Look for the Boost library LIB-NAME (e.g., LIB-NAME = `thread', for +-# libboost_thread). Check that HEADER-NAME works and check that +-# libboost_LIB-NAME can link with the code CXX-TEST. The optional argument +-# CXX-PROLOGUE can be used to include some C++ code before the `main' +-# function. ++# BOOST_FIND_LIBS([COMPONENT-NAME], [CANDIDATE-LIB-NAMES], ++# [PREFERRED-RT-OPT], [HEADER-NAME], [CXX-TEST], ++# [CXX-PROLOGUE]) ++# -------------------------------------------------------------- ++# Look for the Boost library COMPONENT-NAME (e.g., `thread', for ++# libboost_thread) under the possible CANDIDATE-LIB-NAMES (e.g., ++# "thread_win32 thread"). Check that HEADER-NAME works and check that ++# libboost_LIB-NAME can link with the code CXX-TEST. The optional ++# argument CXX-PROLOGUE can be used to include some C++ code before ++# the `main' function. + # + # Invokes BOOST_FIND_HEADER([HEADER-NAME]) (see above). + # +@@ -284,7 +308,7 @@ + # builds. Some sample values for PREFERRED-RT-OPT: (nothing), mt, d, mt-d, gdp + # ... If you want to make sure you have a specific version of Boost + # (eg, >= 1.33) you *must* invoke BOOST_REQUIRE before this macro. +-AC_DEFUN([BOOST_FIND_LIB], ++AC_DEFUN([BOOST_FIND_LIBS], + [AC_REQUIRE([BOOST_REQUIRE])dnl + AC_REQUIRE([_BOOST_FIND_COMPILER_TAG])dnl + AC_REQUIRE([BOOST_STATIC])dnl +@@ -296,33 +320,71 @@ + AC_LANG_PUSH([C++])dnl + AS_VAR_PUSHDEF([Boost_lib], [boost_cv_lib_$1])dnl + AS_VAR_PUSHDEF([Boost_lib_LDFLAGS], [boost_cv_lib_$1_LDFLAGS])dnl ++AS_VAR_PUSHDEF([Boost_lib_LDPATH], [boost_cv_lib_$1_LDPATH])dnl + AS_VAR_PUSHDEF([Boost_lib_LIBS], [boost_cv_lib_$1_LIBS])dnl +-BOOST_FIND_HEADER([$3]) ++BOOST_FIND_HEADER([$4]) + boost_save_CPPFLAGS=$CPPFLAGS + CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" +-# Now let's try to find the library. The algorithm is as follows: first look +-# for a given library name according to the user's PREFERRED-RT-OPT. For each +-# library name, we prefer to use the ones that carry the tag (toolset name). +-# Each library is searched through the various standard paths were Boost is +-# usually installed. If we can't find the standard variants, we try to +-# enforce -mt (for instance on MacOSX, libboost_threads.dylib doesn't exist +-# but there's -obviously- libboost_threads-mt.dylib). + AC_CACHE_CHECK([for the Boost $1 library], [Boost_lib], +- [Boost_lib=no +- case "$2" in #( +- mt | mt-) boost_mt=-mt; boost_rtopt=;; #( +- mt* | mt-*) boost_mt=-mt; boost_rtopt=`expr "X$2" : 'Xmt-*\(.*\)'`;; #( +- *) boost_mt=; boost_rtopt=$2;; ++ [_BOOST_FIND_LIBS($@)]) ++case $Boost_lib in #( ++ (no) _AC_MSG_LOG_CONFTEST ++ AC_MSG_ERROR([cannot find the flags to link with Boost $1]) ++ ;; ++esac ++AC_SUBST(AS_TR_CPP([BOOST_$1_LDFLAGS]), [$Boost_lib_LDFLAGS])dnl ++AC_SUBST(AS_TR_CPP([BOOST_$1_LDPATH]), [$Boost_lib_LDPATH])dnl ++AC_SUBST([BOOST_LDPATH], [$Boost_lib_LDPATH])dnl ++AC_SUBST(AS_TR_CPP([BOOST_$1_LIBS]), [$Boost_lib_LIBS])dnl ++CPPFLAGS=$boost_save_CPPFLAGS ++AS_VAR_POPDEF([Boost_lib])dnl ++AS_VAR_POPDEF([Boost_lib_LDFLAGS])dnl ++AS_VAR_POPDEF([Boost_lib_LDPATH])dnl ++AS_VAR_POPDEF([Boost_lib_LIBS])dnl ++AC_LANG_POP([C++])dnl ++fi ++]) ++ ++ ++# BOOST_FIND_LIB([LIB-NAME], ++# [PREFERRED-RT-OPT], [HEADER-NAME], [CXX-TEST], ++# [CXX-PROLOGUE]) ++# -------------------------------------------------------------- ++# Backward compatibility wrapper for BOOST_FIND_LIBS. ++AC_DEFUN([BOOST_FIND_LIB], ++[BOOST_FIND_LIBS([$1], $@)]) ++ ++ ++# _BOOST_FIND_LIBS([LIB-NAME], [CANDIDATE-LIB-NAMES], ++# [PREFERRED-RT-OPT], [HEADER-NAME], [CXX-TEST], ++# [CXX-PROLOGUE]) ++# -------------------------------------------------------------- ++# Real implementation of BOOST_FIND_LIBS: rely on these local macros: ++# Boost_lib, Boost_lib_LDFLAGS, Boost_lib_LDPATH, Boost_lib_LIBS ++# ++# The algorithm is as follows: first look for a given library name ++# according to the user's PREFERRED-RT-OPT. For each library name, we ++# prefer to use the ones that carry the tag (toolset name). Each ++# library is searched through the various standard paths were Boost is ++# usually installed. If we can't find the standard variants, we try ++# to enforce -mt (for instance on MacOSX, libboost_thread.dylib ++# doesn't exist but there's -obviously- libboost_thread-mt.dylib). ++AC_DEFUN([_BOOST_FIND_LIBS], ++[Boost_lib=no ++ case "$3" in #( ++ (mt | mt-) boost_mt=-mt; boost_rtopt=;; #( ++ (mt* | mt-*) boost_mt=-mt; boost_rtopt=`expr "X$3" : 'Xmt-*\(.*\)'`;; #( ++ (*) boost_mt=; boost_rtopt=$3;; + esac + if test $enable_static_boost = yes; then + boost_rtopt="s$boost_rtopt" + fi + # Find the proper debug variant depending on what we've been asked to find. + case $boost_rtopt in #( +- *d*) boost_rt_d=$boost_rtopt;; #( +- *[[sgpn]]*) # Insert the `d' at the right place (in between `sg' and `pn') ++ (*d*) boost_rt_d=$boost_rtopt;; #( ++ (*[[sgpn]]*) # Insert the `d' at the right place (in between `sg' and `pn') + boost_rt_d=`echo "$boost_rtopt" | sed 's/\(s*g*\)\(p*n*\)/\1\2/'`;; #( +- *) boost_rt_d='-d';; ++ (*) boost_rt_d='-d';; + esac + # If the PREFERRED-RT-OPT are not empty, prepend a `-'. + test -n "$boost_rtopt" && boost_rtopt="-$boost_rtopt" +@@ -333,8 +395,8 @@ + AC_MSG_ERROR([the libext variable is empty, did you invoke Libtool?]) + boost_save_ac_objext=$ac_objext + # Generate the test file. +- AC_LANG_CONFTEST([AC_LANG_PROGRAM([#include <$3> +-$5], [$4])]) ++ AC_LANG_CONFTEST([AC_LANG_PROGRAM([#include <$4> ++$6], [$5])]) + dnl Optimization hacks: compiling C++ is slow, especially with Boost. What + dnl we're trying to do here is guess the right combination of link flags + dnl (LIBS / LDFLAGS) to use a given library. This can take several +@@ -356,38 +418,42 @@ + [AC_MSG_ERROR([cannot compile a test that uses Boost $1])]) + ac_objext=$boost_save_ac_objext + boost_failed_libs= +-# Don't bother to ident the 6 nested for loops, only the 2 innermost ones +-# matter. ++# Don't bother to ident the following nested for loops, only the 2 ++# innermost ones matter. ++for boost_lib_ in $2; do + for boost_tag_ in -$boost_cv_lib_tag ''; do + for boost_ver_ in -$boost_cv_lib_version ''; do + for boost_mt_ in $boost_mt -mt ''; do + for boost_rtopt_ in $boost_rtopt '' -d; do + for boost_lib in \ +- boost_$1$boost_tag_$boost_mt_$boost_rtopt_$boost_ver_ \ +- boost_$1$boost_tag_$boost_rtopt_$boost_ver_ \ +- boost_$1$boost_tag_$boost_mt_$boost_ver_ \ +- boost_$1$boost_tag_$boost_ver_ ++ boost_$boost_lib_$boost_tag_$boost_mt_$boost_rtopt_$boost_ver_ \ ++ boost_$boost_lib_$boost_tag_$boost_rtopt_$boost_ver_ \ ++ boost_$boost_lib_$boost_tag_$boost_mt_$boost_ver_ \ ++ boost_$boost_lib_$boost_tag_$boost_ver_ + do + # Avoid testing twice the same lib + case $boost_failed_libs in #( +- *@$boost_lib@*) continue;; ++ (*@$boost_lib@*) continue;; + esac + # If with_boost is empty, we'll search in /lib first, which is not quite + # right so instead we'll try to a location based on where the headers are. + boost_tmp_lib=$with_boost + test x"$with_boost" = x && boost_tmp_lib=${boost_cv_inc_path%/include} + for boost_ldpath in "$boost_tmp_lib/lib" '' \ +- /opt/local/lib /usr/local/lib /opt/lib /usr/lib \ +- "$with_boost" C:/Boost/lib /lib /usr/lib64 /lib64 ++ /opt/local/lib* /usr/local/lib* /opt/lib* /usr/lib* \ ++ "$with_boost" C:/Boost/lib /lib* + do +- test -e "$boost_ldpath" || continue ++ # Don't waste time with directories that don't exist. ++ if test x"$boost_ldpath" != x && test ! -e "$boost_ldpath"; then ++ continue ++ fi + boost_save_LDFLAGS=$LDFLAGS + # Are we looking for a static library? + case $boost_ldpath:$boost_rtopt_ in #( +- *?*:*s*) # Yes (Non empty boost_ldpath + s in rt opt) ++ (*?*:*s*) # Yes (Non empty boost_ldpath + s in rt opt) + Boost_lib_LIBS="$boost_ldpath/lib$boost_lib.$libext" + test -e "$Boost_lib_LIBS" || continue;; #( +- *) # No: use -lboost_foo to find the shared library. ++ (*) # No: use -lboost_foo to find the shared library. + Boost_lib_LIBS="-l$boost_lib";; + esac + boost_save_LIBS=$LIBS +@@ -401,8 +467,35 @@ + LDFLAGS=$boost_save_LDFLAGS + LIBS=$boost_save_LIBS + if test x"$Boost_lib" = xyes; then +- Boost_lib_LDFLAGS="-L$boost_ldpath" +- break 6 ++ # Check or used cached result of whether or not using -R or ++ # -rpath makes sense. Some implementations of ld, such as for ++ # Mac OSX, require -rpath but -R is the flag known to work on ++ # other systems. https://github.com/tsuna/boost.m4/issues/19 ++ AC_CACHE_VAL([boost_cv_rpath_link_ldflag], ++ [case $boost_ldpath in ++ '') # Nothing to do. ++ boost_cv_rpath_link_ldflag= ++ boost_rpath_link_ldflag_found=yes;; ++ *) ++ for boost_cv_rpath_link_ldflag in -Wl,-R, -Wl,-rpath,; do ++ LDFLAGS="$boost_save_LDFLAGS -L$boost_ldpath $boost_cv_rpath_link_ldflag$boost_ldpath" ++ LIBS="$boost_save_LIBS $Boost_lib_LIBS" ++ _BOOST_AC_LINK_IFELSE([], ++ [boost_rpath_link_ldflag_found=yes ++ break], ++ [boost_rpath_link_ldflag_found=no]) ++ done ++ ;; ++ esac ++ AS_IF([test "x$boost_rpath_link_ldflag_found" != "xyes"], ++ [AC_MSG_ERROR([Unable to determine whether to use -R or -rpath])]) ++ LDFLAGS=$boost_save_LDFLAGS ++ LIBS=$boost_save_LIBS ++ ]) ++ test x"$boost_ldpath" != x && ++ Boost_lib_LDFLAGS="-L$boost_ldpath $boost_cv_rpath_link_ldflag$boost_ldpath" ++ Boost_lib_LDPATH="$boost_ldpath" ++ break 7 + else + boost_failed_libs="$boost_failed_libs@$boost_lib@" + fi +@@ -412,22 +505,10 @@ + done + done + done ++done # boost_lib_ + rm -f conftest.$ac_objext + ]) +-case $Boost_lib in #( +- no) _AC_MSG_LOG_CONFTEST +- AC_MSG_ERROR([cannot not find the flags to link with Boost $1]) +- ;; +-esac +-AC_SUBST(AS_TR_CPP([BOOST_$1_LDFLAGS]), [$Boost_lib_LDFLAGS]) +-AC_SUBST(AS_TR_CPP([BOOST_$1_LIBS]), [$Boost_lib_LIBS]) +-CPPFLAGS=$boost_save_CPPFLAGS +-AS_VAR_POPDEF([Boost_lib])dnl +-AS_VAR_POPDEF([Boost_lib_LDFLAGS])dnl +-AS_VAR_POPDEF([Boost_lib_LIBS])dnl +-AC_LANG_POP([C++])dnl +-fi +-])# BOOST_FIND_LIB ++ + + + # --------------------------------------- # +@@ -438,42 +519,155 @@ + # The page http://beta.boost.org/doc/libs is useful: it gives the first release + # version of each library (among other things). + ++# BOOST_DEFUN(LIBRARY, CODE) ++# -------------------------- ++# Define BOOST_ as a macro that runs CODE. ++# ++# Use indir to avoid the warning on underquoted macro name given to AC_DEFUN. ++m4_define([BOOST_DEFUN], ++[m4_indir([AC_DEFUN], ++ m4_toupper([BOOST_$1]), ++[m4_pushdef([BOOST_Library], [$1])dnl ++$2 ++m4_popdef([BOOST_Library])dnl ++]) ++]) ++ + # BOOST_ARRAY() + # ------------- + # Look for Boost.Array +-AC_DEFUN([BOOST_ARRAY], ++BOOST_DEFUN([Array], + [BOOST_FIND_HEADER([boost/array.hpp])]) + + + # BOOST_ASIO() + # ------------ + # Look for Boost.Asio (new in Boost 1.35). +-AC_DEFUN([BOOST_ASIO], ++BOOST_DEFUN([Asio], + [AC_REQUIRE([BOOST_SYSTEM])dnl + BOOST_FIND_HEADER([boost/asio.hpp])]) + + + # BOOST_BIND() + # ------------ +-# Look for Boost.Bind +-AC_DEFUN([BOOST_BIND], ++# Look for Boost.Bind. ++BOOST_DEFUN([Bind], + [BOOST_FIND_HEADER([boost/bind.hpp])]) + + ++# BOOST_CHRONO() ++# -------------- ++# Look for Boost.Chrono. ++BOOST_DEFUN([Chrono], ++[# Do we have to check for Boost.System? This link-time dependency was ++# added as of 1.35.0. If we have a version <1.35, we must not attempt to ++# find Boost.System as it didn't exist by then. ++if test $boost_major_version -ge 135; then ++ BOOST_SYSTEM([$1]) ++fi # end of the Boost.System check. ++boost_filesystem_save_LIBS=$LIBS ++boost_filesystem_save_LDFLAGS=$LDFLAGS ++m4_pattern_allow([^BOOST_SYSTEM_(LIBS|LDFLAGS)$])dnl ++LIBS="$LIBS $BOOST_SYSTEM_LIBS" ++LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS" ++BOOST_FIND_LIB([chrono], [$1], ++ [boost/chrono.hpp], ++ [boost::chrono::thread_clock d;]) ++if test $enable_static_boost = yes && test $boost_major_version -ge 135; then ++ BOOST_CHRONO_LIBS="$BOOST_CHRONO_LIBS $BOOST_SYSTEM_LIBS" ++fi ++LIBS=$boost_filesystem_save_LIBS ++LDFLAGS=$boost_filesystem_save_LDFLAGS ++])# BOOST_CHRONO ++ ++ ++# BOOST_CONTEXT([PREFERRED-RT-OPT]) ++# ----------------------------------- ++# Look for Boost.Context. For the documentation of PREFERRED-RT-OPT, see the ++# documentation of BOOST_FIND_LIB above. This library was introduced in Boost ++# 1.51.0 ++BOOST_DEFUN([Context], ++[BOOST_FIND_LIB([context], [$1], ++ [boost/context/all.hpp],[[ ++// creates a stack ++void * stack_pointer = new void*[4096]; ++std::size_t const size = sizeof(void*[4096]); ++ ++// context fc uses f() as context function ++// fcontext_t is placed on top of context stack ++// a pointer to fcontext_t is returned ++fc = ctx::make_fcontext(stack_pointer, size, f); ++return ctx::jump_fcontext(&fcm, fc, 3) == 6;]],[dnl ++namespace ctx = boost::context; ++// context ++static ctx::fcontext_t fcm, *fc; ++// context-function ++static void f(intptr_t i) { ++ ctx::jump_fcontext(fc, &fcm, i * 2); ++}]) ++])# BOOST_CONTEXT ++ ++ + # BOOST_CONVERSION() + # ------------------ + # Look for Boost.Conversion (cast / lexical_cast) +-AC_DEFUN([BOOST_CONVERSION], ++BOOST_DEFUN([Conversion], + [BOOST_FIND_HEADER([boost/cast.hpp]) + BOOST_FIND_HEADER([boost/lexical_cast.hpp]) + ])# BOOST_CONVERSION + + ++# BOOST_COROUTINE([PREFERRED-RT-OPT]) ++# ----------------------------------- ++# Look for Boost.Coroutine. For the documentation of PREFERRED-RT-OPT, see the ++# documentation of BOOST_FIND_LIB above. This library was introduced in Boost ++# 1.53.0 ++BOOST_DEFUN([Coroutine], ++[ ++boost_coroutine_save_LIBS=$LIBS ++boost_coroutine_save_LDFLAGS=$LDFLAGS ++# Link-time dependency from coroutine to context ++BOOST_CONTEXT([$1]) ++# Starting from Boost 1.55 a dependency on Boost.System is added ++if test $boost_major_version -ge 155; then ++ BOOST_SYSTEM([$1]) ++fi ++m4_pattern_allow([^BOOST_(CONTEXT|SYSTEM)_(LIBS|LDFLAGS)]) ++LIBS="$LIBS $BOOST_CONTEXT_LIBS $BOOST_SYSTEM_LIBS" ++LDFLAGS="$LDFLAGS $BOOST_CONTEXT_LDFLAGS" ++ ++BOOST_FIND_LIB([coroutine], [$1], ++ [boost/coroutine/coroutine.hpp], ++ [boost::coroutines::coroutine< int(int) > coro; coro.empty();]) ++ ++# Link-time dependency from coroutine to context, existed only in 1.53, in 1.54 ++# coroutine doesn't use context from its headers but from its library. ++if test $boost_major_version -eq 153 || test $enable_static_boost = yes && test $boost_major_version -ge 154; then ++ BOOST_COROUTINE_LIBS="$BOOST_COROUTINE_LIBS $BOOST_CONTEXT_LIBS" ++ BOOST_COROUTINE_LDFLAGS="$BOOST_COROUTINE_LDFLAGS $BOOST_CONTEXT_LDFLAGS" ++fi ++if test $enable_static_boost = yes && test $boost_major_version -ge 155; then ++ BOOST_COROUTINE_LIBS="$BOOST_COROUTINE_LIBS $BOOST_SYSTEM_LIBS" ++ BOOST_COROUTINE_LDFLAGS="$BOOST_COROUTINE_LDFLAGS $BOOST_SYSTEM_LDFLAGS" ++fi ++LIBS=$boost_coroutine_save_LIBS ++LDFLAGS=$boost_coroutine_save_LDFLAGS ++])# BOOST_COROUTINE ++ ++ ++# BOOST_CRC() ++# ----------- ++# Look for Boost.CRC ++BOOST_DEFUN([CRC], ++[BOOST_FIND_HEADER([boost/crc.hpp]) ++])# BOOST_CRC ++ ++ + # BOOST_DATE_TIME([PREFERRED-RT-OPT]) + # ----------------------------------- + # Look for Boost.Date_Time. For the documentation of PREFERRED-RT-OPT, see the + # documentation of BOOST_FIND_LIB above. +-AC_DEFUN([BOOST_DATE_TIME], ++BOOST_DEFUN([Date_Time], + [BOOST_FIND_LIB([date_time], [$1], + [boost/date_time/posix_time/posix_time.hpp], + [boost::posix_time::ptime t;]) +@@ -486,12 +680,12 @@ + # the documentation of BOOST_FIND_LIB above. + # Do not check for boost/filesystem.hpp because this file was introduced in + # 1.34. +-AC_DEFUN([BOOST_FILESYSTEM], ++BOOST_DEFUN([Filesystem], + [# Do we have to check for Boost.System? This link-time dependency was + # added as of 1.35.0. If we have a version <1.35, we must not attempt to + # find Boost.System as it didn't exist by then. + if test $boost_major_version -ge 135; then +-BOOST_SYSTEM([$1]) ++ BOOST_SYSTEM([$1]) + fi # end of the Boost.System check. + boost_filesystem_save_LIBS=$LIBS + boost_filesystem_save_LDFLAGS=$LDFLAGS +@@ -500,71 +694,125 @@ + LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS" + BOOST_FIND_LIB([filesystem], [$1], + [boost/filesystem/path.hpp], [boost::filesystem::path p;]) ++if test $enable_static_boost = yes && test $boost_major_version -ge 135; then ++ BOOST_FILESYSTEM_LIBS="$BOOST_FILESYSTEM_LIBS $BOOST_SYSTEM_LIBS" ++fi + LIBS=$boost_filesystem_save_LIBS + LDFLAGS=$boost_filesystem_save_LDFLAGS + ])# BOOST_FILESYSTEM + + ++# BOOST_FLYWEIGHT() ++# ----------------- ++# Look for Boost.Flyweight. ++BOOST_DEFUN([Flyweight], ++[dnl There's a hidden dependency on pthreads. ++AC_REQUIRE([_BOOST_PTHREAD_FLAG])dnl ++BOOST_FIND_HEADER([boost/flyweight.hpp]) ++AC_SUBST([BOOST_FLYWEIGHT_LIBS], [$boost_cv_pthread_flag]) ++]) ++ ++ + # BOOST_FOREACH() + # --------------- +-# Look for Boost.Foreach +-AC_DEFUN([BOOST_FOREACH], ++# Look for Boost.Foreach. ++BOOST_DEFUN([Foreach], + [BOOST_FIND_HEADER([boost/foreach.hpp])]) + + + # BOOST_FORMAT() + # -------------- +-# Look for Boost.Format ++# Look for Boost.Format. + # Note: we can't check for boost/format/format_fwd.hpp because the header isn't + # standalone. It can't be compiled because it triggers the following error: + # boost/format/detail/config_macros.hpp:88: error: 'locale' in namespace 'std' + # does not name a type +-AC_DEFUN([BOOST_FORMAT], ++BOOST_DEFUN([Format], + [BOOST_FIND_HEADER([boost/format.hpp])]) + + + # BOOST_FUNCTION() + # ---------------- + # Look for Boost.Function +-AC_DEFUN([BOOST_FUNCTION], ++BOOST_DEFUN([Function], + [BOOST_FIND_HEADER([boost/function.hpp])]) + + ++# BOOST_GEOMETRY() ++# ---------------- ++# Look for Boost.Geometry (new since 1.47.0). ++BOOST_DEFUN([Geometry], ++[BOOST_FIND_HEADER([boost/geometry.hpp]) ++])# BOOST_GEOMETRY ++ ++ + # BOOST_GRAPH([PREFERRED-RT-OPT]) + # ------------------------------- + # Look for Boost.Graphs. For the documentation of PREFERRED-RT-OPT, see the + # documentation of BOOST_FIND_LIB above. +-AC_DEFUN([BOOST_GRAPH], ++BOOST_DEFUN([Graph], + [BOOST_FIND_LIB([graph], [$1], + [boost/graph/adjacency_list.hpp], [boost::adjacency_list<> g;]) + ])# BOOST_GRAPH + + + # BOOST_IOSTREAMS([PREFERRED-RT-OPT]) +-# ------------------------------- ++# ----------------------------------- + # Look for Boost.IOStreams. For the documentation of PREFERRED-RT-OPT, see the + # documentation of BOOST_FIND_LIB above. +-AC_DEFUN([BOOST_IOSTREAMS], ++BOOST_DEFUN([IOStreams], + [BOOST_FIND_LIB([iostreams], [$1], + [boost/iostreams/device/file_descriptor.hpp], +- [boost::iostreams::file_descriptor fd(0); fd.close();]) ++ [boost::iostreams::file_descriptor fd; fd.close();]) + ])# BOOST_IOSTREAMS + + + # BOOST_HASH() + # ------------ + # Look for Boost.Functional/Hash +-AC_DEFUN([BOOST_HASH], ++BOOST_DEFUN([Hash], + [BOOST_FIND_HEADER([boost/functional/hash.hpp])]) + + + # BOOST_LAMBDA() + # -------------- + # Look for Boost.Lambda +-AC_DEFUN([BOOST_LAMBDA], ++BOOST_DEFUN([Lambda], + [BOOST_FIND_HEADER([boost/lambda/lambda.hpp])]) + + ++# BOOST_LOCALE() ++# -------------- ++# Look for Boost.Locale ++BOOST_DEFUN([Locale], ++[BOOST_FIND_LIB([locale], [$1], ++ [boost/locale.hpp], ++ [[boost::locale::generator gen; std::locale::global(gen(""));]]) ++])# BOOST_LOCALE ++ ++# BOOST_LOG([PREFERRED-RT-OPT]) ++# ----------------------------- ++# Look for Boost.Log. For the documentation of PREFERRED-RT-OPT, see the ++# documentation of BOOST_FIND_LIB above. ++BOOST_DEFUN([Log], ++[BOOST_FIND_LIB([log], [$1], ++ [boost/log/core/core.hpp], ++ [boost::log::attribute a; a.get_value();]) ++])# BOOST_LOG ++ ++ ++# BOOST_LOG_SETUP([PREFERRED-RT-OPT]) ++# ----------------------------------- ++# Look for Boost.Log. For the documentation of PREFERRED-RT-OPT, see the ++# documentation of BOOST_FIND_LIB above. ++BOOST_DEFUN([Log_Setup], ++[AC_REQUIRE([BOOST_LOG])dnl ++BOOST_FIND_LIB([log_setup], [$1], ++ [boost/log/utility/setup/from_settings.hpp], ++ [boost::log::basic_settings bs; bs.empty();]) ++])# BOOST_LOG_SETUP ++ ++ + # BOOST_MATH() + # ------------ + # Look for Boost.Math +@@ -573,21 +821,52 @@ + # libboost_math_c99f, libboost_math_c99l, libboost_math_tr1, + # libboost_math_tr1f, libboost_math_tr1l). This macro must be fixed to do the + # right thing anyway. +-AC_DEFUN([BOOST_MATH], ++BOOST_DEFUN([Math], + [BOOST_FIND_HEADER([boost/math/special_functions.hpp])]) + + ++# BOOST_MPI([PREFERRED-RT-OPT]) ++# ------------------------------- ++# Look for Boost MPI. For the documentation of PREFERRED-RT-OPT, see the ++# documentation of BOOST_FIND_LIB above. Uses MPICXX variable if it is ++# set, otherwise tries CXX ++# ++BOOST_DEFUN([MPI], ++[boost_save_CXX=${CXX} ++boost_save_CXXCPP=${CXXCPP} ++if test x"${MPICXX}" != x; then ++ CXX=${MPICXX} ++ CXXCPP="${MPICXX} -E" ++fi ++BOOST_FIND_LIB([mpi], [$1], ++ [boost/mpi.hpp], ++ [int argc = 0; ++ char **argv = 0; ++ boost::mpi::environment env(argc,argv);]) ++CXX=${boost_save_CXX} ++CXXCPP=${boost_save_CXXCPP} ++])# BOOST_MPI ++ ++ + # BOOST_MULTIARRAY() + # ------------------ + # Look for Boost.MultiArray +-AC_DEFUN([BOOST_MULTIARRAY], ++BOOST_DEFUN([MultiArray], + [BOOST_FIND_HEADER([boost/multi_array.hpp])]) + + ++# BOOST_NUMERIC_UBLAS() ++# -------------------------- ++# Look for Boost.NumericUblas (Basic Linear Algebra) ++BOOST_DEFUN([Numeric_Ublas], ++[BOOST_FIND_HEADER([boost/numeric/ublas/vector.hpp]) ++])# BOOST_NUMERIC_UBLAS ++ ++ + # BOOST_NUMERIC_CONVERSION() + # -------------------------- + # Look for Boost.NumericConversion (policy-based numeric conversion) +-AC_DEFUN([BOOST_NUMERIC_CONVERSION], ++BOOST_DEFUN([Numeric_Conversion], + [BOOST_FIND_HEADER([boost/numeric/conversion/converter.hpp]) + ])# BOOST_NUMERIC_CONVERSION + +@@ -595,32 +874,82 @@ + # BOOST_OPTIONAL() + # ---------------- + # Look for Boost.Optional +-AC_DEFUN([BOOST_OPTIONAL], ++BOOST_DEFUN([Optional], + [BOOST_FIND_HEADER([boost/optional.hpp])]) + + + # BOOST_PREPROCESSOR() + # -------------------- + # Look for Boost.Preprocessor +-AC_DEFUN([BOOST_PREPROCESSOR], ++BOOST_DEFUN([Preprocessor], + [BOOST_FIND_HEADER([boost/preprocessor/repeat.hpp])]) + + ++# BOOST_RANGE() ++# -------------------- ++# Look for Boost.Range ++BOOST_DEFUN([Range], ++[BOOST_FIND_HEADER([boost/range/adaptors.hpp])]) ++ ++# BOOST_UNORDERED() ++# ----------------- ++# Look for Boost.Unordered ++BOOST_DEFUN([Unordered], ++[BOOST_FIND_HEADER([boost/unordered_map.hpp])]) ++ ++ ++# BOOST_UUID() ++# ------------ ++# Look for Boost.Uuid ++BOOST_DEFUN([Uuid], ++[BOOST_FIND_HEADER([boost/uuid/uuid.hpp])]) ++ ++ + # BOOST_PROGRAM_OPTIONS([PREFERRED-RT-OPT]) + # ----------------------------------------- +-# Look for Boost.Program_options. For the documentation of PREFERRED-RT-OPT, see +-# the documentation of BOOST_FIND_LIB above. +-AC_DEFUN([BOOST_PROGRAM_OPTIONS], ++# Look for Boost.Program_options. For the documentation of PREFERRED-RT-OPT, ++# see the documentation of BOOST_FIND_LIB above. ++BOOST_DEFUN([Program_Options], + [BOOST_FIND_LIB([program_options], [$1], + [boost/program_options.hpp], + [boost::program_options::options_description d("test");]) + ])# BOOST_PROGRAM_OPTIONS + + ++ ++# _BOOST_PYTHON_CONFIG(VARIABLE, FLAG) ++# ------------------------------------ ++# Save VARIABLE, and define it via `python-config --FLAG`. ++# Substitute BOOST_PYTHON_VARIABLE. ++m4_define([_BOOST_PYTHON_CONFIG], ++[AC_SUBST([BOOST_PYTHON_$1], ++ [`python-config --$2 2>/dev/null`])dnl ++boost_python_save_$1=$$1 ++$1="$$1 $BOOST_PYTHON_$1"]) ++ ++ ++# BOOST_PYTHON([PREFERRED-RT-OPT]) ++# -------------------------------- ++# Look for Boost.Python. For the documentation of PREFERRED-RT-OPT, ++# see the documentation of BOOST_FIND_LIB above. ++BOOST_DEFUN([Python], ++[_BOOST_PYTHON_CONFIG([CPPFLAGS], [includes]) ++_BOOST_PYTHON_CONFIG([LDFLAGS], [ldflags]) ++_BOOST_PYTHON_CONFIG([LIBS], [libs]) ++m4_pattern_allow([^BOOST_PYTHON_MODULE$])dnl ++BOOST_FIND_LIBS([python], [python python3], [$1], ++ [boost/python.hpp], ++ [], [BOOST_PYTHON_MODULE(empty) {}]) ++CPPFLAGS=$boost_python_save_CPPFLAGS ++LDFLAGS=$boost_python_save_LDFLAGS ++LIBS=$boost_python_save_LIBS ++])# BOOST_PYTHON ++ ++ + # BOOST_REF() + # ----------- + # Look for Boost.Ref +-AC_DEFUN([BOOST_REF], ++BOOST_DEFUN([Ref], + [BOOST_FIND_HEADER([boost/ref.hpp])]) + + +@@ -628,7 +957,7 @@ + # ------------------------------- + # Look for Boost.Regex. For the documentation of PREFERRED-RT-OPT, see the + # documentation of BOOST_FIND_LIB above. +-AC_DEFUN([BOOST_REGEX], ++BOOST_DEFUN([Regex], + [BOOST_FIND_LIB([regex], [$1], + [boost/regex.hpp], + [boost::regex exp("*"); boost::regex_match("foo", exp);]) +@@ -639,29 +968,37 @@ + # --------------------------------------- + # Look for Boost.Serialization. For the documentation of PREFERRED-RT-OPT, see + # the documentation of BOOST_FIND_LIB above. +-AC_DEFUN([BOOST_SERIALIZATION], ++BOOST_DEFUN([Serialization], + [BOOST_FIND_LIB([serialization], [$1], + [boost/archive/text_oarchive.hpp], + [std::ostream* o = 0; // Cheap way to get an ostream... + boost::archive::text_oarchive t(*o);]) +-])# BOOST_SIGNALS ++])# BOOST_SERIALIZATION + + + # BOOST_SIGNALS([PREFERRED-RT-OPT]) + # --------------------------------- + # Look for Boost.Signals. For the documentation of PREFERRED-RT-OPT, see the + # documentation of BOOST_FIND_LIB above. +-AC_DEFUN([BOOST_SIGNALS], ++BOOST_DEFUN([Signals], + [BOOST_FIND_LIB([signals], [$1], + [boost/signal.hpp], + [boost::signal s;]) + ])# BOOST_SIGNALS + + ++# BOOST_SIGNALS2() ++# ---------------- ++# Look for Boost.Signals2 (new since 1.39.0). ++BOOST_DEFUN([Signals2], ++[BOOST_FIND_HEADER([boost/signals2.hpp]) ++])# BOOST_SIGNALS2 ++ ++ + # BOOST_SMART_PTR() + # ----------------- + # Look for Boost.SmartPtr +-AC_DEFUN([BOOST_SMART_PTR], ++BOOST_DEFUN([Smart_Ptr], + [BOOST_FIND_HEADER([boost/scoped_ptr.hpp]) + BOOST_FIND_HEADER([boost/shared_ptr.hpp]) + ]) +@@ -670,14 +1007,14 @@ + # BOOST_STATICASSERT() + # -------------------- + # Look for Boost.StaticAssert +-AC_DEFUN([BOOST_STATICASSERT], ++BOOST_DEFUN([StaticAssert], + [BOOST_FIND_HEADER([boost/static_assert.hpp])]) + + + # BOOST_STRING_ALGO() + # ------------------- + # Look for Boost.StringAlgo +-AC_DEFUN([BOOST_STRING_ALGO], ++BOOST_DEFUN([String_Algo], + [BOOST_FIND_HEADER([boost/algorithm/string.hpp]) + ]) + +@@ -687,7 +1024,7 @@ + # Look for Boost.System. For the documentation of PREFERRED-RT-OPT, see the + # documentation of BOOST_FIND_LIB above. This library was introduced in Boost + # 1.35.0. +-AC_DEFUN([BOOST_SYSTEM], ++BOOST_DEFUN([System], + [BOOST_FIND_LIB([system], [$1], + [boost/system/error_code.hpp], + [boost::system::error_code e; e.clear();]) +@@ -698,7 +1035,7 @@ + # ------------------------------ + # Look for Boost.Test. For the documentation of PREFERRED-RT-OPT, see the + # documentation of BOOST_FIND_LIB above. +-AC_DEFUN([BOOST_TEST], ++BOOST_DEFUN([Test], + [m4_pattern_allow([^BOOST_CHECK$])dnl + BOOST_FIND_LIB([unit_test_framework], [$1], + [boost/test/unit_test.hpp], [BOOST_CHECK(2 == 2);], +@@ -708,45 +1045,58 @@ + ])# BOOST_TEST + + +-# BOOST_THREADS([PREFERRED-RT-OPT]) ++# BOOST_THREAD([PREFERRED-RT-OPT]) + # --------------------------------- + # Look for Boost.Thread. For the documentation of PREFERRED-RT-OPT, see the + # documentation of BOOST_FIND_LIB above. +-# FIXME: Provide an alias "BOOST_THREAD". +-AC_DEFUN([BOOST_THREADS], ++BOOST_DEFUN([Thread], + [dnl Having the pthread flag is required at least on GCC3 where + dnl boost/thread.hpp would complain if we try to compile without + dnl -pthread on GNU/Linux. + AC_REQUIRE([_BOOST_PTHREAD_FLAG])dnl +-boost_threads_save_LIBS=$LIBS +-boost_threads_save_CPPFLAGS=$CPPFLAGS +-LIBS="$LIBS $boost_cv_pthread_flag" +-# Yes, we *need* to put the -pthread thing in CPPFLAGS because with GCC3, +-# boost/thread.hpp will trigger a #error if -pthread isn't used: +-# boost/config/requires_threads.hpp:47:5: #error "Compiler threading support +-# is not turned on. Please set the correct command line options for +-# threading: -pthread (Linux), -pthreads (Solaris) or -mthreads (Mingw32)" ++boost_thread_save_LIBS=$LIBS ++boost_thread_save_LDFLAGS=$LDFLAGS ++boost_thread_save_CPPFLAGS=$CPPFLAGS ++# Link-time dependency from thread to system was added as of 1.49.0. ++if test $boost_major_version -ge 149; then ++BOOST_SYSTEM([$1]) ++fi # end of the Boost.System check. ++m4_pattern_allow([^BOOST_SYSTEM_(LIBS|LDFLAGS)$])dnl ++LIBS="$LIBS $BOOST_SYSTEM_LIBS $boost_cv_pthread_flag" ++LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS" + CPPFLAGS="$CPPFLAGS $boost_cv_pthread_flag" +-BOOST_FIND_LIB([thread], [$1], ++ ++# When compiling for the Windows platform, the threads library is named ++# differently. ++case $host_os in ++ (*mingw*) boost_thread_lib_ext=_win32;; ++esac ++BOOST_FIND_LIBS([thread], [thread$boost_thread_lib_ext], ++ [$1], + [boost/thread.hpp], [boost::thread t; boost::mutex m;]) +-BOOST_THREAD_LIBS="$BOOST_THREAD_LIBS $boost_cv_pthread_flag" ++ ++BOOST_THREAD_LIBS="$BOOST_THREAD_LIBS $BOOST_SYSTEM_LIBS $boost_cv_pthread_flag" ++BOOST_THREAD_LDFLAGS="$BOOST_SYSTEM_LDFLAGS" + BOOST_CPPFLAGS="$BOOST_CPPFLAGS $boost_cv_pthread_flag" +-LIBS=$boost_threads_save_LIBS +-CPPFLAGS=$boost_threads_save_CPPFLAGS +-])# BOOST_THREADS ++LIBS=$boost_thread_save_LIBS ++LDFLAGS=$boost_thread_save_LDFLAGS ++CPPFLAGS=$boost_thread_save_CPPFLAGS ++])# BOOST_THREAD ++ ++AU_ALIAS([BOOST_THREADS], [BOOST_THREAD]) + + + # BOOST_TOKENIZER() + # ----------------- + # Look for Boost.Tokenizer +-AC_DEFUN([BOOST_TOKENIZER], ++BOOST_DEFUN([Tokenizer], + [BOOST_FIND_HEADER([boost/tokenizer.hpp])]) + + + # BOOST_TRIBOOL() + # --------------- + # Look for Boost.Tribool +-AC_DEFUN([BOOST_TRIBOOL], ++BOOST_DEFUN([Tribool], + [BOOST_FIND_HEADER([boost/logic/tribool_fwd.hpp]) + BOOST_FIND_HEADER([boost/logic/tribool.hpp]) + ]) +@@ -755,14 +1105,14 @@ + # BOOST_TUPLE() + # ------------- + # Look for Boost.Tuple +-AC_DEFUN([BOOST_TUPLE], ++BOOST_DEFUN([Tuple], + [BOOST_FIND_HEADER([boost/tuple/tuple.hpp])]) + + + # BOOST_TYPETRAITS() + # -------------------- + # Look for Boost.TypeTraits +-AC_DEFUN([BOOST_TYPETRAITS], ++BOOST_DEFUN([TypeTraits], + [BOOST_FIND_HEADER([boost/type_traits.hpp])]) + + +@@ -770,33 +1120,46 @@ + # --------------- + # Look for Boost.Utility (noncopyable, result_of, base-from-member idiom, + # etc.) +-AC_DEFUN([BOOST_UTILITY], ++BOOST_DEFUN([Utility], + [BOOST_FIND_HEADER([boost/utility.hpp])]) + + + # BOOST_VARIANT() + # --------------- + # Look for Boost.Variant. +-AC_DEFUN([BOOST_VARIANT], ++BOOST_DEFUN([Variant], + [BOOST_FIND_HEADER([boost/variant/variant_fwd.hpp]) + BOOST_FIND_HEADER([boost/variant.hpp])]) + + ++# BOOST_POINTER_CONTAINER() ++# ------------------------ ++# Look for Boost.PointerContainer ++BOOST_DEFUN([Pointer_Container], ++[BOOST_FIND_HEADER([boost/ptr_container/ptr_deque.hpp]) ++BOOST_FIND_HEADER([boost/ptr_container/ptr_list.hpp]) ++BOOST_FIND_HEADER([boost/ptr_container/ptr_vector.hpp]) ++BOOST_FIND_HEADER([boost/ptr_container/ptr_array.hpp]) ++BOOST_FIND_HEADER([boost/ptr_container/ptr_set.hpp]) ++BOOST_FIND_HEADER([boost/ptr_container/ptr_map.hpp]) ++])# BOOST_POINTER_CONTAINER ++ ++ + # BOOST_WAVE([PREFERRED-RT-OPT]) + # ------------------------------ + # NOTE: If you intend to use Wave/Spirit with thread support, make sure you +-# call BOOST_THREADS first. ++# call BOOST_THREAD first. + # Look for Boost.Wave. For the documentation of PREFERRED-RT-OPT, see the + # documentation of BOOST_FIND_LIB above. +-AC_DEFUN([BOOST_WAVE], ++BOOST_DEFUN([Wave], + [AC_REQUIRE([BOOST_FILESYSTEM])dnl + AC_REQUIRE([BOOST_DATE_TIME])dnl + boost_wave_save_LIBS=$LIBS + boost_wave_save_LDFLAGS=$LDFLAGS + m4_pattern_allow([^BOOST_((FILE)?SYSTEM|DATE_TIME|THREAD)_(LIBS|LDFLAGS)$])dnl +-LIBS="$LIBS $BOOST_SYSTEM_LIBS $BOOST_FILESYSTEM_LIBS $BOOST_DATE_TIME_LIBS\ ++LIBS="$LIBS $BOOST_SYSTEM_LIBS $BOOST_FILESYSTEM_LIBS $BOOST_DATE_TIME_LIBS \ + $BOOST_THREAD_LIBS" +-LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS $BOOST_FILESYSTEM_LDFLAGS\ ++LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS $BOOST_FILESYSTEM_LDFLAGS \ + $BOOST_DATE_TIME_LDFLAGS $BOOST_THREAD_LDFLAGS" + BOOST_FIND_LIB([wave], [$1], + [boost/wave.hpp], +@@ -809,7 +1172,7 @@ + # BOOST_XPRESSIVE() + # ----------------- + # Look for Boost.Xpressive (new since 1.36.0). +-AC_DEFUN([BOOST_XPRESSIVE], ++BOOST_DEFUN([Xpressive], + [BOOST_FIND_HEADER([boost/xpressive/xpressive.hpp])]) + + +@@ -820,8 +1183,16 @@ + + # _BOOST_PTHREAD_FLAG() + # --------------------- +-# Internal helper for BOOST_THREADS. Based on ACX_PTHREAD: +-# http://autoconf-archive.cryp.to/acx_pthread.html ++# Internal helper for BOOST_THREAD. Computes boost_cv_pthread_flag ++# which must be used in CPPFLAGS and LIBS. ++# ++# Yes, we *need* to put the -pthread thing in CPPFLAGS because with GCC3, ++# boost/thread.hpp will trigger a #error if -pthread isn't used: ++# boost/config/requires_threads.hpp:47:5: #error "Compiler threading support ++# is not turned on. Please set the correct command line options for ++# threading: -pthread (Linux), -pthreads (Solaris) or -mthreads (Mingw32)" ++# ++# Based on ACX_PTHREAD: http://autoconf-archive.cryp.to/acx_pthread.html + AC_DEFUN([_BOOST_PTHREAD_FLAG], + [AC_REQUIRE([AC_PROG_CXX])dnl + AC_REQUIRE([AC_CANONICAL_HOST])dnl +@@ -889,6 +1260,14 @@ + m4_define([_BOOST_gcc_test], + ["defined __GNUC__ && __GNUC__ == $1 && __GNUC_MINOR__ == $2 && !defined __ICC @ gcc$1$2"])dnl + ++# _BOOST_mingw_test(MAJOR, MINOR) ++# ----------------------------- ++# Internal helper for _BOOST_FIND_COMPILER_TAG. ++m4_define([_BOOST_mingw_test], ++["defined __GNUC__ && __GNUC__ == $1 && __GNUC_MINOR__ == $2 && !defined __ICC && \ ++ (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \ ++ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw$1$2"])dnl ++ + + # _BOOST_FIND_COMPILER_TAG() + # -------------------------- +@@ -898,9 +1277,11 @@ + AC_DEFUN([_BOOST_FIND_COMPILER_TAG], + [AC_REQUIRE([AC_PROG_CXX])dnl + AC_REQUIRE([AC_CANONICAL_HOST])dnl +-AC_CACHE_CHECK([for the toolset name used by Boost for $CXX], [boost_cv_lib_tag], +-[AC_LANG_PUSH([C++])dnl +- boost_cv_lib_tag=unknown ++AC_CACHE_CHECK([for the toolset name used by Boost for $CXX], ++ [boost_cv_lib_tag], ++[boost_cv_lib_tag=unknown ++if test x$boost_cv_inc_path != xno; then ++ AC_LANG_PUSH([C++])dnl + # The following tests are mostly inspired by boost/config/auto_link.hpp + # The list is sorted to most recent/common to oldest compiler (in order + # to increase the likelihood of finding the right compiler with the +@@ -914,11 +1295,30 @@ + # como, edg, kcc, bck, mp, sw, tru, xlc + # I'm not sure about my test for `il' (be careful: Intel's ICC pre-defines + # the same defines as GCC's). +- # TODO: Move the test on GCC 4.4 up once it's released. + for i in \ ++ _BOOST_mingw_test(5, 0) \ ++ _BOOST_gcc_test(5, 0) \ ++ _BOOST_mingw_test(4, 10) \ ++ _BOOST_gcc_test(4, 10) \ ++ _BOOST_mingw_test(4, 9) \ ++ _BOOST_gcc_test(4, 9) \ ++ _BOOST_mingw_test(4, 8) \ ++ _BOOST_gcc_test(4, 8) \ ++ _BOOST_mingw_test(4, 7) \ ++ _BOOST_gcc_test(4, 7) \ ++ _BOOST_mingw_test(4, 6) \ ++ _BOOST_gcc_test(4, 6) \ ++ _BOOST_mingw_test(4, 5) \ ++ _BOOST_gcc_test(4, 5) \ ++ _BOOST_mingw_test(4, 4) \ ++ _BOOST_gcc_test(4, 4) \ ++ _BOOST_mingw_test(4, 3) \ + _BOOST_gcc_test(4, 3) \ ++ _BOOST_mingw_test(4, 2) \ + _BOOST_gcc_test(4, 2) \ ++ _BOOST_mingw_test(4, 1) \ + _BOOST_gcc_test(4, 1) \ ++ _BOOST_mingw_test(4, 0) \ + _BOOST_gcc_test(4, 0) \ + "defined __GNUC__ && __GNUC__ == 3 && !defined __ICC \ + && (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \ +@@ -935,7 +1335,6 @@ + "defined __ICC && (defined __unix || defined __unix__) @ il" \ + "defined __ICL @ iw" \ + "defined _MSC_VER && _MSC_VER == 1300 @ vc7" \ +- _BOOST_gcc_test(4, 4) \ + _BOOST_gcc_test(2, 95) \ + "defined __MWERKS__ && __MWERKS__ <= 0x32FF @ cw9" \ + "defined _MSC_VER && _MSC_VER < 1300 && !defined UNDER_CE @ vc6" \ +@@ -975,7 +1374,7 @@ + boost_cv_lib_tag= + ;; + esac +-])dnl end of AC_CACHE_CHECK ++fi])dnl end of AC_CACHE_CHECK + ])# _BOOST_FIND_COMPILER_TAG + + +@@ -985,6 +1384,7 @@ + # Thread) flavors of Boost. Sets boost_guess_use_mt accordingly. + AC_DEFUN([_BOOST_GUESS_WHETHER_TO_USE_MT], + [# Check whether we do better use `mt' even though we weren't ask to. ++AC_LANG_PUSH([C++])dnl + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + #if defined _REENTRANT || defined _MT || defined __MT__ + /* use -mt */ +@@ -992,6 +1392,7 @@ + # error MT not needed + #endif + ]])], [boost_guess_use_mt=:], [boost_guess_use_mt=false]) ++AC_LANG_POP([C++])dnl + ]) + + # _BOOST_AC_LINK_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) +@@ -1015,11 +1416,11 @@ + test -f conftest.$ac_objext && ac_ext=$ac_objext && boost_use_source=false && + _AS_ECHO_LOG([re-using the existing conftest.$ac_objext]) + AS_IF([_AC_DO_STDERR($ac_link) && { +- test -z "$ac_[]_AC_LANG_ABBREV[]_werror_flag" || +- test ! -s conftest.err ++ test -z "$ac_[]_AC_LANG_ABBREV[]_werror_flag" || ++ test ! -s conftest.err + } && test -s conftest$ac_exeext && { +- test "$cross_compiling" = yes || +- $as_executable_p conftest$ac_exeext ++ test "$cross_compiling" = yes || ++ $as_executable_p conftest$ac_exeext + dnl FIXME: use AS_TEST_X instead when 2.61 is widespread enough. + }], + [$2], +--- zarafa-7.1.12/configure 2015-05-08 14:21:08.000000000 +0200 ++++ zarafa-7.1.12/configure.gcc5 2015-07-01 21:53:46.000000000 +0200 +@@ -648,10 +648,14 @@ + ICU_CFLAGS + ICU_CONFIG + BOOST_DATE_TIME_LIBS ++BOOST_DATE_TIME_LDPATH + BOOST_DATE_TIME_LDFLAGS + BOOST_FILESYSTEM_LIBS ++BOOST_FILESYSTEM_LDPATH + BOOST_FILESYSTEM_LDFLAGS + BOOST_SYSTEM_LIBS ++BOOST_LDPATH ++BOOST_SYSTEM_LDPATH + BOOST_SYSTEM_LDFLAGS + BOOST_CPPFLAGS + DISTCHECK_CONFIGURE_FLAGS +@@ -20532,7 +20536,7 @@ + + + # Boost +-echo "$as_me: this is boost.m4 serial 12" >&5 ++echo "$as_me: this is boost.m4 serial 24" >&5 + boost_save_IFS=$IFS + boost_version_req=1.35 + IFS=. +@@ -20540,6 +20544,7 @@ + IFS=$boost_save_IFS + shift + boost_version_req=`expr "$1" '*' 100000 + "$2" '*' 100 + "$3"` ++boost_version_req_string=$1.$2.$3 + + # Check whether --with-boost was given. + if test "${with_boost+set}" = set; then : +@@ -20558,10 +20563,9 @@ + fi + fi + DISTCHECK_CONFIGURE_FLAGS="$DISTCHECK_CONFIGURE_FLAGS '--with-boost=$with_boost'" +- + boost_save_CPPFLAGS=$CPPFLAGS +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boost headers version >= $boost_version_req" >&5 +-$as_echo_n "checking for Boost headers version >= $boost_version_req... " >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boost headers version >= $boost_version_req_string" >&5 ++$as_echo_n "checking for Boost headers version >= $boost_version_req_string... " >&6; } + if ${boost_cv_inc_path+:} false; then : + $as_echo_n "(cached) " >&6 + else +@@ -20656,7 +20660,7 @@ + $as_echo "$boost_cv_inc_path" >&6; } + case $boost_cv_inc_path in #( + no) +- boost_errmsg="cannot find Boost headers version >= $boost_version_req" ++ boost_errmsg="cannot find Boost headers version >= $boost_version_req_string" + as_fn_error $? "$boost_errmsg" "$LINENO" 5 + + ;;#( +@@ -20665,34 +20669,40 @@ + ;;#( + *) + BOOST_CPPFLAGS="-I$boost_cv_inc_path" +- + ;; + esac +- case $boost_cv_inc_path in #( +- no) +- ;;#( +- *) ++ if test x"$boost_cv_inc_path" != xno; then + + $as_echo "#define HAVE_BOOST 1" >>confdefs.h + +- ;; +- esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boost's header version" >&5 + $as_echo_n "checking for Boost's header version... " >&6; } + if ${boost_cv_lib_version+:} false; then : + $as_echo_n "(cached) " >&6 + else +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++ ac_ext=cpp ++ac_cpp='$CXXCPP $CPPFLAGS' ++ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ++ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ++ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + #include + boost-lib-version = BOOST_LIB_VERSION + _ACEOF + if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | ++ grep -v '#' | + tr -d '\r' | +- $SED -n -e "/^boost-lib-version = /{s///;s/\"//g;p;g;}" >conftest.i 2>&1; then : ++ tr -s '\n' ' ' | ++ $SED -n -e "/^boost-lib-version = /{s///;s/[\" ]//g;p;q;}" >conftest.i 2>&1; then : + boost_cv_lib_version=`cat conftest.i` + fi + rm -rf conftest* ++ac_ext=cpp ++ac_cpp='$CXXCPP $CPPFLAGS' ++ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ++ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ++ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $boost_cv_lib_version" >&5 +@@ -20701,9 +20711,10 @@ + boost_major_version=`echo "$boost_cv_lib_version" | sed 's/_//;s/_.*//'` + case $boost_major_version in #( + '' | *[!0-9]*) +- as_fn_error $? "invalid value: boost_major_version=$boost_major_version" "$LINENO" 5 ++ as_fn_error $? "invalid value: boost_major_version='$boost_major_version'" "$LINENO" 5 + ;; + esac ++fi + CPPFLAGS=$boost_save_CPPFLAGS + + if test x"$boost_cv_inc_path" = xno; then +@@ -20765,17 +20776,19 @@ + fi + + ++ + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the toolset name used by Boost for $CXX" >&5 + $as_echo_n "checking for the toolset name used by Boost for $CXX... " >&6; } + if ${boost_cv_lib_tag+:} false; then : + $as_echo_n "(cached) " >&6 + else ++ boost_cv_lib_tag=unknown ++if test x$boost_cv_inc_path != xno; then + ac_ext=cpp + ac_cpp='$CXXCPP $CPPFLAGS' + ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' + ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' + ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +- boost_cv_lib_tag=unknown + # The following tests are mostly inspired by boost/config/auto_link.hpp + # The list is sorted to most recent/common to oldest compiler (in order + # to increase the likelihood of finding the right compiler with the +@@ -20789,11 +20802,54 @@ + # como, edg, kcc, bck, mp, sw, tru, xlc + # I'm not sure about my test for `il' (be careful: Intel's ICC pre-defines + # the same defines as GCC's). +- # TODO: Move the test on GCC 4.4 up once it's released. + for i in \ ++ "defined __GNUC__ && __GNUC__ == 5 && __GNUC_MINOR__ == 0 && !defined __ICC && \ ++ (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \ ++ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw50" \ ++ "defined __GNUC__ && __GNUC__ == 5 && __GNUC_MINOR__ == 0 && !defined __ICC @ gcc50" \ ++ "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 10 && !defined __ICC && \ ++ (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \ ++ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw410" \ ++ "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 10 && !defined __ICC @ gcc410" \ ++ "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 9 && !defined __ICC && \ ++ (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \ ++ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw49" \ ++ "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 9 && !defined __ICC @ gcc49" \ ++ "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 8 && !defined __ICC && \ ++ (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \ ++ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw48" \ ++ "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 8 && !defined __ICC @ gcc48" \ ++ "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 7 && !defined __ICC && \ ++ (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \ ++ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw47" \ ++ "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 7 && !defined __ICC @ gcc47" \ ++ "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 6 && !defined __ICC && \ ++ (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \ ++ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw46" \ ++ "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 6 && !defined __ICC @ gcc46" \ ++ "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 5 && !defined __ICC && \ ++ (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \ ++ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw45" \ ++ "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 5 && !defined __ICC @ gcc45" \ ++ "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 4 && !defined __ICC && \ ++ (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \ ++ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw44" \ ++ "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 4 && !defined __ICC @ gcc44" \ ++ "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 3 && !defined __ICC && \ ++ (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \ ++ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw43" \ + "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 3 && !defined __ICC @ gcc43" \ ++ "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && !defined __ICC && \ ++ (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \ ++ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw42" \ + "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && !defined __ICC @ gcc42" \ ++ "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 1 && !defined __ICC && \ ++ (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \ ++ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw41" \ + "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 1 && !defined __ICC @ gcc41" \ ++ "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 0 && !defined __ICC && \ ++ (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \ ++ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw40" \ + "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 0 && !defined __ICC @ gcc40" \ + "defined __GNUC__ && __GNUC__ == 3 && !defined __ICC \ + && (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \ +@@ -20810,7 +20866,6 @@ + "defined __ICC && (defined __unix || defined ) @ il" \ + "defined __ICL @ iw" \ + "defined _MSC_VER && _MSC_VER == 1300 @ vc7" \ +- "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 4 && !defined __ICC @ gcc44" \ + "defined __GNUC__ && __GNUC__ == 2 && __GNUC_MINOR__ == 95 && !defined __ICC @ gcc295" \ + "defined __MWERKS__ && __MWERKS__ <= 0x32FF @ cw9" \ + "defined _MSC_VER && _MSC_VER < 1300 && !defined UNDER_CE @ vc6" \ +@@ -20869,7 +20924,7 @@ + boost_cv_lib_tag= + ;; + esac +- ++fi + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $boost_cv_lib_tag" >&5 + $as_echo "$boost_cv_lib_tag" >&6; } +@@ -20881,6 +20936,11 @@ + fi + + # Check whether we do better use `mt' even though we weren't ask to. ++ac_ext=cpp ++ac_cpp='$CXXCPP $CPPFLAGS' ++ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ++ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ++ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + +@@ -20904,12 +20964,17 @@ + boost_guess_use_mt=false + fi + rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++ac_ext=cpp ++ac_cpp='$CXXCPP $CPPFLAGS' ++ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ++ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ++ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + # Do we have to check for Boost.System? This link-time dependency was + # added as of 1.35.0. If we have a version <1.35, we must not attempt to + # find Boost.System as it didn't exist by then. + if test $boost_major_version -ge 135; then +-if test x"$boost_cv_inc_path" = xno; then ++ if test x"$boost_cv_inc_path" = xno; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Boost not available, not searching for the Boost system library" >&5 + $as_echo "$as_me: Boost not available, not searching for the Boost system library" >&6;} + else +@@ -20949,13 +21014,6 @@ + + boost_save_CPPFLAGS=$CPPFLAGS + CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" +-# Now let's try to find the library. The algorithm is as follows: first look +-# for a given library name according to the user's PREFERRED-RT-OPT. For each +-# library name, we prefer to use the ones that carry the tag (toolset name). +-# Each library is searched through the various standard paths were Boost is +-# usually installed. If we can't find the standard variants, we try to +-# enforce -mt (for instance on MacOSX, libboost_threads.dylib doesn't exist +-# but there's -obviously- libboost_threads-mt.dylib). + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the Boost system library" >&5 + $as_echo_n "checking for the Boost system library... " >&6; } + if ${boost_cv_lib_system+:} false; then : +@@ -20963,19 +21021,19 @@ + else + boost_cv_lib_system=no + case "mt" in #( +- mt | mt-) boost_mt=-mt; boost_rtopt=;; #( +- mt* | mt-*) boost_mt=-mt; boost_rtopt=`expr "Xmt" : 'Xmt-*\(.*\)'`;; #( +- *) boost_mt=; boost_rtopt=mt;; ++ (mt | mt-) boost_mt=-mt; boost_rtopt=;; #( ++ (mt* | mt-*) boost_mt=-mt; boost_rtopt=`expr "Xmt" : 'Xmt-*\(.*\)'`;; #( ++ (*) boost_mt=; boost_rtopt=mt;; + esac + if test $enable_static_boost = yes; then + boost_rtopt="s$boost_rtopt" + fi + # Find the proper debug variant depending on what we've been asked to find. + case $boost_rtopt in #( +- *d*) boost_rt_d=$boost_rtopt;; #( +- *[sgpn]*) # Insert the `d' at the right place (in between `sg' and `pn') ++ (*d*) boost_rt_d=$boost_rtopt;; #( ++ (*[sgpn]*) # Insert the `d' at the right place (in between `sg' and `pn') + boost_rt_d=`echo "$boost_rtopt" | sed 's/\(s*g*\)\(p*n*\)/\1\2/'`;; #( +- *) boost_rt_d='-d';; ++ (*) boost_rt_d='-d';; + esac + # If the PREFERRED-RT-OPT are not empty, prepend a `-'. + test -n "$boost_rtopt" && boost_rtopt="-$boost_rtopt" +@@ -21006,38 +21064,42 @@ + rm -f core conftest.err conftest.$ac_objext + ac_objext=$boost_save_ac_objext + boost_failed_libs= +-# Don't bother to ident the 6 nested for loops, only the 2 innermost ones +-# matter. ++# Don't bother to ident the following nested for loops, only the 2 ++# innermost ones matter. ++for boost_lib_ in system; do + for boost_tag_ in -$boost_cv_lib_tag ''; do + for boost_ver_ in -$boost_cv_lib_version ''; do + for boost_mt_ in $boost_mt -mt ''; do + for boost_rtopt_ in $boost_rtopt '' -d; do + for boost_lib in \ +- boost_system$boost_tag_$boost_mt_$boost_rtopt_$boost_ver_ \ +- boost_system$boost_tag_$boost_rtopt_$boost_ver_ \ +- boost_system$boost_tag_$boost_mt_$boost_ver_ \ +- boost_system$boost_tag_$boost_ver_ ++ boost_$boost_lib_$boost_tag_$boost_mt_$boost_rtopt_$boost_ver_ \ ++ boost_$boost_lib_$boost_tag_$boost_rtopt_$boost_ver_ \ ++ boost_$boost_lib_$boost_tag_$boost_mt_$boost_ver_ \ ++ boost_$boost_lib_$boost_tag_$boost_ver_ + do + # Avoid testing twice the same lib + case $boost_failed_libs in #( +- *@$boost_lib@*) continue;; ++ (*@$boost_lib@*) continue;; + esac + # If with_boost is empty, we'll search in /lib first, which is not quite + # right so instead we'll try to a location based on where the headers are. + boost_tmp_lib=$with_boost + test x"$with_boost" = x && boost_tmp_lib=${boost_cv_inc_path%/include} + for boost_ldpath in "$boost_tmp_lib/lib" '' \ +- /opt/local/lib /usr/local/lib /opt/lib /usr/lib \ +- "$with_boost" C:/Boost/lib /lib /usr/lib64 /lib64 ++ /opt/local/lib* /usr/local/lib* /opt/lib* /usr/lib* \ ++ "$with_boost" C:/Boost/lib /lib* + do +- test -e "$boost_ldpath" || continue ++ # Don't waste time with directories that don't exist. ++ if test x"$boost_ldpath" != x && test ! -e "$boost_ldpath"; then ++ continue ++ fi + boost_save_LDFLAGS=$LDFLAGS + # Are we looking for a static library? + case $boost_ldpath:$boost_rtopt_ in #( +- *?*:*s*) # Yes (Non empty boost_ldpath + s in rt opt) ++ (*?*:*s*) # Yes (Non empty boost_ldpath + s in rt opt) + boost_cv_lib_system_LIBS="$boost_ldpath/lib$boost_lib.$libext" + test -e "$boost_cv_lib_system_LIBS" || continue;; #( +- *) # No: use -lboost_foo to find the shared library. ++ (*) # No: use -lboost_foo to find the shared library. + boost_cv_lib_system_LIBS="-l$boost_lib";; + esac + boost_save_LIBS=$LIBS +@@ -21066,11 +21128,11 @@ + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { +- test -z "$ac_cxx_werror_flag" || +- test ! -s conftest.err ++ test -z "$ac_cxx_werror_flag" || ++ test ! -s conftest.err + } && test -s conftest$ac_exeext && { +- test "$cross_compiling" = yes || +- $as_executable_p conftest$ac_exeext ++ test "$cross_compiling" = yes || ++ $as_executable_p conftest$ac_exeext + }; then : + boost_cv_lib_system=yes + else +@@ -21089,8 +21151,79 @@ + LDFLAGS=$boost_save_LDFLAGS + LIBS=$boost_save_LIBS + if test x"$boost_cv_lib_system" = xyes; then +- boost_cv_lib_system_LDFLAGS="-L$boost_ldpath" +- break 6 ++ # Check or used cached result of whether or not using -R or ++ # -rpath makes sense. Some implementations of ld, such as for ++ # Mac OSX, require -rpath but -R is the flag known to work on ++ # other systems. https://github.com/tsuna/boost.m4/issues/19 ++ if ${boost_cv_rpath_link_ldflag+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ case $boost_ldpath in ++ '') # Nothing to do. ++ boost_cv_rpath_link_ldflag= ++ boost_rpath_link_ldflag_found=yes;; ++ *) ++ for boost_cv_rpath_link_ldflag in -Wl,-R, -Wl,-rpath,; do ++ LDFLAGS="$boost_save_LDFLAGS -L$boost_ldpath $boost_cv_rpath_link_ldflag$boost_ldpath" ++ LIBS="$boost_save_LIBS $boost_cv_lib_system_LIBS" ++ rm -f conftest$ac_exeext ++boost_save_ac_ext=$ac_ext ++boost_use_source=: ++# If we already have a .o, re-use it. We change $ac_ext so that $ac_link ++# tries to link the existing object file instead of compiling from source. ++test -f conftest.$ac_objext && ac_ext=$ac_objext && boost_use_source=false && ++ $as_echo "$as_me:${as_lineno-$LINENO}: re-using the existing conftest.$ac_objext" >&5 ++if { { ac_try="$ac_link" ++case "(($ac_try" in ++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; ++ *) ac_try_echo=$ac_try;; ++esac ++eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" ++$as_echo "$ac_try_echo"; } >&5 ++ (eval "$ac_link") 2>conftest.err ++ ac_status=$? ++ if test -s conftest.err; then ++ grep -v '^ *+' conftest.err >conftest.er1 ++ cat conftest.er1 >&5 ++ mv -f conftest.er1 conftest.err ++ fi ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; } && { ++ test -z "$ac_cxx_werror_flag" || ++ test ! -s conftest.err ++ } && test -s conftest$ac_exeext && { ++ test "$cross_compiling" = yes || ++ $as_executable_p conftest$ac_exeext ++ }; then : ++ boost_rpath_link_ldflag_found=yes ++ break ++else ++ if $boost_use_source; then ++ $as_echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ fi ++ boost_rpath_link_ldflag_found=no ++fi ++ac_objext=$boost_save_ac_objext ++ac_ext=$boost_save_ac_ext ++rm -f core conftest.err conftest_ipa8_conftest.oo \ ++ conftest$ac_exeext ++ done ++ ;; ++ esac ++ if test "x$boost_rpath_link_ldflag_found" != "xyes"; then : ++ as_fn_error $? "Unable to determine whether to use -R or -rpath" "$LINENO" 5 ++fi ++ LDFLAGS=$boost_save_LDFLAGS ++ LIBS=$boost_save_LIBS ++ ++fi ++ ++ test x"$boost_ldpath" != x && ++ boost_cv_lib_system_LDFLAGS="-L$boost_ldpath $boost_cv_rpath_link_ldflag$boost_ldpath" ++ boost_cv_lib_system_LDPATH="$boost_ldpath" ++ break 7 + else + boost_failed_libs="$boost_failed_libs@$boost_lib@" + fi +@@ -21100,22 +21233,23 @@ + done + done + done ++done # boost_lib_ + rm -f conftest.$ac_objext + + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $boost_cv_lib_system" >&5 + $as_echo "$boost_cv_lib_system" >&6; } + case $boost_cv_lib_system in #( +- no) $as_echo "$as_me: failed program was:" >&5 ++ (no) $as_echo "$as_me: failed program was:" >&5 + sed 's/^/| /' conftest.$ac_ext >&5 + +- as_fn_error $? "cannot not find the flags to link with Boost system" "$LINENO" 5 ++ as_fn_error $? "cannot find the flags to link with Boost system" "$LINENO" 5 + ;; + esac + BOOST_SYSTEM_LDFLAGS=$boost_cv_lib_system_LDFLAGS +- ++BOOST_SYSTEM_LDPATH=$boost_cv_lib_system_LDPATH ++BOOST_LDPATH=$boost_cv_lib_system_LDPATH + BOOST_SYSTEM_LIBS=$boost_cv_lib_system_LIBS +- + CPPFLAGS=$boost_save_CPPFLAGS + ac_ext=cpp + ac_cpp='$CXXCPP $CPPFLAGS' +@@ -21125,6 +21259,7 @@ + fi + + ++ + fi # end of the Boost.System check. + boost_filesystem_save_LIBS=$LIBS + boost_filesystem_save_LDFLAGS=$LDFLAGS +@@ -21170,13 +21305,6 @@ + + boost_save_CPPFLAGS=$CPPFLAGS + CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" +-# Now let's try to find the library. The algorithm is as follows: first look +-# for a given library name according to the user's PREFERRED-RT-OPT. For each +-# library name, we prefer to use the ones that carry the tag (toolset name). +-# Each library is searched through the various standard paths were Boost is +-# usually installed. If we can't find the standard variants, we try to +-# enforce -mt (for instance on MacOSX, libboost_threads.dylib doesn't exist +-# but there's -obviously- libboost_threads-mt.dylib). + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the Boost filesystem library" >&5 + $as_echo_n "checking for the Boost filesystem library... " >&6; } + if ${boost_cv_lib_filesystem+:} false; then : +@@ -21184,19 +21312,19 @@ + else + boost_cv_lib_filesystem=no + case "mt" in #( +- mt | mt-) boost_mt=-mt; boost_rtopt=;; #( +- mt* | mt-*) boost_mt=-mt; boost_rtopt=`expr "Xmt" : 'Xmt-*\(.*\)'`;; #( +- *) boost_mt=; boost_rtopt=mt;; ++ (mt | mt-) boost_mt=-mt; boost_rtopt=;; #( ++ (mt* | mt-*) boost_mt=-mt; boost_rtopt=`expr "Xmt" : 'Xmt-*\(.*\)'`;; #( ++ (*) boost_mt=; boost_rtopt=mt;; + esac + if test $enable_static_boost = yes; then + boost_rtopt="s$boost_rtopt" + fi + # Find the proper debug variant depending on what we've been asked to find. + case $boost_rtopt in #( +- *d*) boost_rt_d=$boost_rtopt;; #( +- *[sgpn]*) # Insert the `d' at the right place (in between `sg' and `pn') ++ (*d*) boost_rt_d=$boost_rtopt;; #( ++ (*[sgpn]*) # Insert the `d' at the right place (in between `sg' and `pn') + boost_rt_d=`echo "$boost_rtopt" | sed 's/\(s*g*\)\(p*n*\)/\1\2/'`;; #( +- *) boost_rt_d='-d';; ++ (*) boost_rt_d='-d';; + esac + # If the PREFERRED-RT-OPT are not empty, prepend a `-'. + test -n "$boost_rtopt" && boost_rtopt="-$boost_rtopt" +@@ -21227,38 +21355,42 @@ + rm -f core conftest.err conftest.$ac_objext + ac_objext=$boost_save_ac_objext + boost_failed_libs= +-# Don't bother to ident the 6 nested for loops, only the 2 innermost ones +-# matter. ++# Don't bother to ident the following nested for loops, only the 2 ++# innermost ones matter. ++for boost_lib_ in filesystem; do + for boost_tag_ in -$boost_cv_lib_tag ''; do + for boost_ver_ in -$boost_cv_lib_version ''; do + for boost_mt_ in $boost_mt -mt ''; do + for boost_rtopt_ in $boost_rtopt '' -d; do + for boost_lib in \ +- boost_filesystem$boost_tag_$boost_mt_$boost_rtopt_$boost_ver_ \ +- boost_filesystem$boost_tag_$boost_rtopt_$boost_ver_ \ +- boost_filesystem$boost_tag_$boost_mt_$boost_ver_ \ +- boost_filesystem$boost_tag_$boost_ver_ ++ boost_$boost_lib_$boost_tag_$boost_mt_$boost_rtopt_$boost_ver_ \ ++ boost_$boost_lib_$boost_tag_$boost_rtopt_$boost_ver_ \ ++ boost_$boost_lib_$boost_tag_$boost_mt_$boost_ver_ \ ++ boost_$boost_lib_$boost_tag_$boost_ver_ + do + # Avoid testing twice the same lib + case $boost_failed_libs in #( +- *@$boost_lib@*) continue;; ++ (*@$boost_lib@*) continue;; + esac + # If with_boost is empty, we'll search in /lib first, which is not quite + # right so instead we'll try to a location based on where the headers are. + boost_tmp_lib=$with_boost + test x"$with_boost" = x && boost_tmp_lib=${boost_cv_inc_path%/include} + for boost_ldpath in "$boost_tmp_lib/lib" '' \ +- /opt/local/lib /usr/local/lib /opt/lib /usr/lib \ +- "$with_boost" C:/Boost/lib /lib /usr/lib64 /lib64 ++ /opt/local/lib* /usr/local/lib* /opt/lib* /usr/lib* \ ++ "$with_boost" C:/Boost/lib /lib* + do +- test -e "$boost_ldpath" || continue ++ # Don't waste time with directories that don't exist. ++ if test x"$boost_ldpath" != x && test ! -e "$boost_ldpath"; then ++ continue ++ fi + boost_save_LDFLAGS=$LDFLAGS + # Are we looking for a static library? + case $boost_ldpath:$boost_rtopt_ in #( +- *?*:*s*) # Yes (Non empty boost_ldpath + s in rt opt) ++ (*?*:*s*) # Yes (Non empty boost_ldpath + s in rt opt) + boost_cv_lib_filesystem_LIBS="$boost_ldpath/lib$boost_lib.$libext" + test -e "$boost_cv_lib_filesystem_LIBS" || continue;; #( +- *) # No: use -lboost_foo to find the shared library. ++ (*) # No: use -lboost_foo to find the shared library. + boost_cv_lib_filesystem_LIBS="-l$boost_lib";; + esac + boost_save_LIBS=$LIBS +@@ -21287,11 +21419,11 @@ + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { +- test -z "$ac_cxx_werror_flag" || +- test ! -s conftest.err ++ test -z "$ac_cxx_werror_flag" || ++ test ! -s conftest.err + } && test -s conftest$ac_exeext && { +- test "$cross_compiling" = yes || +- $as_executable_p conftest$ac_exeext ++ test "$cross_compiling" = yes || ++ $as_executable_p conftest$ac_exeext + }; then : + boost_cv_lib_filesystem=yes + else +@@ -21310,8 +21442,79 @@ + LDFLAGS=$boost_save_LDFLAGS + LIBS=$boost_save_LIBS + if test x"$boost_cv_lib_filesystem" = xyes; then +- boost_cv_lib_filesystem_LDFLAGS="-L$boost_ldpath" +- break 6 ++ # Check or used cached result of whether or not using -R or ++ # -rpath makes sense. Some implementations of ld, such as for ++ # Mac OSX, require -rpath but -R is the flag known to work on ++ # other systems. https://github.com/tsuna/boost.m4/issues/19 ++ if ${boost_cv_rpath_link_ldflag+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ case $boost_ldpath in ++ '') # Nothing to do. ++ boost_cv_rpath_link_ldflag= ++ boost_rpath_link_ldflag_found=yes;; ++ *) ++ for boost_cv_rpath_link_ldflag in -Wl,-R, -Wl,-rpath,; do ++ LDFLAGS="$boost_save_LDFLAGS -L$boost_ldpath $boost_cv_rpath_link_ldflag$boost_ldpath" ++ LIBS="$boost_save_LIBS $boost_cv_lib_filesystem_LIBS" ++ rm -f conftest$ac_exeext ++boost_save_ac_ext=$ac_ext ++boost_use_source=: ++# If we already have a .o, re-use it. We change $ac_ext so that $ac_link ++# tries to link the existing object file instead of compiling from source. ++test -f conftest.$ac_objext && ac_ext=$ac_objext && boost_use_source=false && ++ $as_echo "$as_me:${as_lineno-$LINENO}: re-using the existing conftest.$ac_objext" >&5 ++if { { ac_try="$ac_link" ++case "(($ac_try" in ++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; ++ *) ac_try_echo=$ac_try;; ++esac ++eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" ++$as_echo "$ac_try_echo"; } >&5 ++ (eval "$ac_link") 2>conftest.err ++ ac_status=$? ++ if test -s conftest.err; then ++ grep -v '^ *+' conftest.err >conftest.er1 ++ cat conftest.er1 >&5 ++ mv -f conftest.er1 conftest.err ++ fi ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; } && { ++ test -z "$ac_cxx_werror_flag" || ++ test ! -s conftest.err ++ } && test -s conftest$ac_exeext && { ++ test "$cross_compiling" = yes || ++ $as_executable_p conftest$ac_exeext ++ }; then : ++ boost_rpath_link_ldflag_found=yes ++ break ++else ++ if $boost_use_source; then ++ $as_echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ fi ++ boost_rpath_link_ldflag_found=no ++fi ++ac_objext=$boost_save_ac_objext ++ac_ext=$boost_save_ac_ext ++rm -f core conftest.err conftest_ipa8_conftest.oo \ ++ conftest$ac_exeext ++ done ++ ;; ++ esac ++ if test "x$boost_rpath_link_ldflag_found" != "xyes"; then : ++ as_fn_error $? "Unable to determine whether to use -R or -rpath" "$LINENO" 5 ++fi ++ LDFLAGS=$boost_save_LDFLAGS ++ LIBS=$boost_save_LIBS ++ ++fi ++ ++ test x"$boost_ldpath" != x && ++ boost_cv_lib_filesystem_LDFLAGS="-L$boost_ldpath $boost_cv_rpath_link_ldflag$boost_ldpath" ++ boost_cv_lib_filesystem_LDPATH="$boost_ldpath" ++ break 7 + else + boost_failed_libs="$boost_failed_libs@$boost_lib@" + fi +@@ -21321,22 +21524,23 @@ + done + done + done ++done # boost_lib_ + rm -f conftest.$ac_objext + + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $boost_cv_lib_filesystem" >&5 + $as_echo "$boost_cv_lib_filesystem" >&6; } + case $boost_cv_lib_filesystem in #( +- no) $as_echo "$as_me: failed program was:" >&5 ++ (no) $as_echo "$as_me: failed program was:" >&5 + sed 's/^/| /' conftest.$ac_ext >&5 + +- as_fn_error $? "cannot not find the flags to link with Boost filesystem" "$LINENO" 5 ++ as_fn_error $? "cannot find the flags to link with Boost filesystem" "$LINENO" 5 + ;; + esac + BOOST_FILESYSTEM_LDFLAGS=$boost_cv_lib_filesystem_LDFLAGS +- ++BOOST_FILESYSTEM_LDPATH=$boost_cv_lib_filesystem_LDPATH ++BOOST_LDPATH=$boost_cv_lib_filesystem_LDPATH + BOOST_FILESYSTEM_LIBS=$boost_cv_lib_filesystem_LIBS +- + CPPFLAGS=$boost_save_CPPFLAGS + ac_ext=cpp + ac_cpp='$CXXCPP $CPPFLAGS' +@@ -21345,9 +21549,13 @@ + ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + fi + ++if test $enable_static_boost = yes && test $boost_major_version -ge 135; then ++ BOOST_FILESYSTEM_LIBS="$BOOST_FILESYSTEM_LIBS $BOOST_SYSTEM_LIBS" ++fi + LIBS=$boost_filesystem_save_LIBS + LDFLAGS=$boost_filesystem_save_LDFLAGS + ++ + if test x"$boost_cv_inc_path" = xno; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Boost not available, not searching for the Boost date_time library" >&5 + $as_echo "$as_me: Boost not available, not searching for the Boost date_time library" >&6;} +@@ -21388,13 +21596,6 @@ + + boost_save_CPPFLAGS=$CPPFLAGS + CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" +-# Now let's try to find the library. The algorithm is as follows: first look +-# for a given library name according to the user's PREFERRED-RT-OPT. For each +-# library name, we prefer to use the ones that carry the tag (toolset name). +-# Each library is searched through the various standard paths were Boost is +-# usually installed. If we can't find the standard variants, we try to +-# enforce -mt (for instance on MacOSX, libboost_threads.dylib doesn't exist +-# but there's -obviously- libboost_threads-mt.dylib). + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the Boost date_time library" >&5 + $as_echo_n "checking for the Boost date_time library... " >&6; } + if ${boost_cv_lib_date_time+:} false; then : +@@ -21402,19 +21603,19 @@ + else + boost_cv_lib_date_time=no + case "mt" in #( +- mt | mt-) boost_mt=-mt; boost_rtopt=;; #( +- mt* | mt-*) boost_mt=-mt; boost_rtopt=`expr "Xmt" : 'Xmt-*\(.*\)'`;; #( +- *) boost_mt=; boost_rtopt=mt;; ++ (mt | mt-) boost_mt=-mt; boost_rtopt=;; #( ++ (mt* | mt-*) boost_mt=-mt; boost_rtopt=`expr "Xmt" : 'Xmt-*\(.*\)'`;; #( ++ (*) boost_mt=; boost_rtopt=mt;; + esac + if test $enable_static_boost = yes; then + boost_rtopt="s$boost_rtopt" + fi + # Find the proper debug variant depending on what we've been asked to find. + case $boost_rtopt in #( +- *d*) boost_rt_d=$boost_rtopt;; #( +- *[sgpn]*) # Insert the `d' at the right place (in between `sg' and `pn') ++ (*d*) boost_rt_d=$boost_rtopt;; #( ++ (*[sgpn]*) # Insert the `d' at the right place (in between `sg' and `pn') + boost_rt_d=`echo "$boost_rtopt" | sed 's/\(s*g*\)\(p*n*\)/\1\2/'`;; #( +- *) boost_rt_d='-d';; ++ (*) boost_rt_d='-d';; + esac + # If the PREFERRED-RT-OPT are not empty, prepend a `-'. + test -n "$boost_rtopt" && boost_rtopt="-$boost_rtopt" +@@ -21445,38 +21646,42 @@ + rm -f core conftest.err conftest.$ac_objext + ac_objext=$boost_save_ac_objext + boost_failed_libs= +-# Don't bother to ident the 6 nested for loops, only the 2 innermost ones +-# matter. ++# Don't bother to ident the following nested for loops, only the 2 ++# innermost ones matter. ++for boost_lib_ in date_time; do + for boost_tag_ in -$boost_cv_lib_tag ''; do + for boost_ver_ in -$boost_cv_lib_version ''; do + for boost_mt_ in $boost_mt -mt ''; do + for boost_rtopt_ in $boost_rtopt '' -d; do + for boost_lib in \ +- boost_date_time$boost_tag_$boost_mt_$boost_rtopt_$boost_ver_ \ +- boost_date_time$boost_tag_$boost_rtopt_$boost_ver_ \ +- boost_date_time$boost_tag_$boost_mt_$boost_ver_ \ +- boost_date_time$boost_tag_$boost_ver_ ++ boost_$boost_lib_$boost_tag_$boost_mt_$boost_rtopt_$boost_ver_ \ ++ boost_$boost_lib_$boost_tag_$boost_rtopt_$boost_ver_ \ ++ boost_$boost_lib_$boost_tag_$boost_mt_$boost_ver_ \ ++ boost_$boost_lib_$boost_tag_$boost_ver_ + do + # Avoid testing twice the same lib + case $boost_failed_libs in #( +- *@$boost_lib@*) continue;; ++ (*@$boost_lib@*) continue;; + esac + # If with_boost is empty, we'll search in /lib first, which is not quite + # right so instead we'll try to a location based on where the headers are. + boost_tmp_lib=$with_boost + test x"$with_boost" = x && boost_tmp_lib=${boost_cv_inc_path%/include} + for boost_ldpath in "$boost_tmp_lib/lib" '' \ +- /opt/local/lib /usr/local/lib /opt/lib /usr/lib \ +- "$with_boost" C:/Boost/lib /lib /usr/lib64 /lib64 ++ /opt/local/lib* /usr/local/lib* /opt/lib* /usr/lib* \ ++ "$with_boost" C:/Boost/lib /lib* + do +- test -e "$boost_ldpath" || continue ++ # Don't waste time with directories that don't exist. ++ if test x"$boost_ldpath" != x && test ! -e "$boost_ldpath"; then ++ continue ++ fi + boost_save_LDFLAGS=$LDFLAGS + # Are we looking for a static library? + case $boost_ldpath:$boost_rtopt_ in #( +- *?*:*s*) # Yes (Non empty boost_ldpath + s in rt opt) ++ (*?*:*s*) # Yes (Non empty boost_ldpath + s in rt opt) + boost_cv_lib_date_time_LIBS="$boost_ldpath/lib$boost_lib.$libext" + test -e "$boost_cv_lib_date_time_LIBS" || continue;; #( +- *) # No: use -lboost_foo to find the shared library. ++ (*) # No: use -lboost_foo to find the shared library. + boost_cv_lib_date_time_LIBS="-l$boost_lib";; + esac + boost_save_LIBS=$LIBS +@@ -21505,11 +21710,11 @@ + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { +- test -z "$ac_cxx_werror_flag" || +- test ! -s conftest.err ++ test -z "$ac_cxx_werror_flag" || ++ test ! -s conftest.err + } && test -s conftest$ac_exeext && { +- test "$cross_compiling" = yes || +- $as_executable_p conftest$ac_exeext ++ test "$cross_compiling" = yes || ++ $as_executable_p conftest$ac_exeext + }; then : + boost_cv_lib_date_time=yes + else +@@ -21528,8 +21733,79 @@ + LDFLAGS=$boost_save_LDFLAGS + LIBS=$boost_save_LIBS + if test x"$boost_cv_lib_date_time" = xyes; then +- boost_cv_lib_date_time_LDFLAGS="-L$boost_ldpath" +- break 6 ++ # Check or used cached result of whether or not using -R or ++ # -rpath makes sense. Some implementations of ld, such as for ++ # Mac OSX, require -rpath but -R is the flag known to work on ++ # other systems. https://github.com/tsuna/boost.m4/issues/19 ++ if ${boost_cv_rpath_link_ldflag+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ case $boost_ldpath in ++ '') # Nothing to do. ++ boost_cv_rpath_link_ldflag= ++ boost_rpath_link_ldflag_found=yes;; ++ *) ++ for boost_cv_rpath_link_ldflag in -Wl,-R, -Wl,-rpath,; do ++ LDFLAGS="$boost_save_LDFLAGS -L$boost_ldpath $boost_cv_rpath_link_ldflag$boost_ldpath" ++ LIBS="$boost_save_LIBS $boost_cv_lib_date_time_LIBS" ++ rm -f conftest$ac_exeext ++boost_save_ac_ext=$ac_ext ++boost_use_source=: ++# If we already have a .o, re-use it. We change $ac_ext so that $ac_link ++# tries to link the existing object file instead of compiling from source. ++test -f conftest.$ac_objext && ac_ext=$ac_objext && boost_use_source=false && ++ $as_echo "$as_me:${as_lineno-$LINENO}: re-using the existing conftest.$ac_objext" >&5 ++if { { ac_try="$ac_link" ++case "(($ac_try" in ++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; ++ *) ac_try_echo=$ac_try;; ++esac ++eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" ++$as_echo "$ac_try_echo"; } >&5 ++ (eval "$ac_link") 2>conftest.err ++ ac_status=$? ++ if test -s conftest.err; then ++ grep -v '^ *+' conftest.err >conftest.er1 ++ cat conftest.er1 >&5 ++ mv -f conftest.er1 conftest.err ++ fi ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; } && { ++ test -z "$ac_cxx_werror_flag" || ++ test ! -s conftest.err ++ } && test -s conftest$ac_exeext && { ++ test "$cross_compiling" = yes || ++ $as_executable_p conftest$ac_exeext ++ }; then : ++ boost_rpath_link_ldflag_found=yes ++ break ++else ++ if $boost_use_source; then ++ $as_echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ fi ++ boost_rpath_link_ldflag_found=no ++fi ++ac_objext=$boost_save_ac_objext ++ac_ext=$boost_save_ac_ext ++rm -f core conftest.err conftest_ipa8_conftest.oo \ ++ conftest$ac_exeext ++ done ++ ;; ++ esac ++ if test "x$boost_rpath_link_ldflag_found" != "xyes"; then : ++ as_fn_error $? "Unable to determine whether to use -R or -rpath" "$LINENO" 5 ++fi ++ LDFLAGS=$boost_save_LDFLAGS ++ LIBS=$boost_save_LIBS ++ ++fi ++ ++ test x"$boost_ldpath" != x && ++ boost_cv_lib_date_time_LDFLAGS="-L$boost_ldpath $boost_cv_rpath_link_ldflag$boost_ldpath" ++ boost_cv_lib_date_time_LDPATH="$boost_ldpath" ++ break 7 + else + boost_failed_libs="$boost_failed_libs@$boost_lib@" + fi +@@ -21539,22 +21815,23 @@ + done + done + done ++done # boost_lib_ + rm -f conftest.$ac_objext + + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $boost_cv_lib_date_time" >&5 + $as_echo "$boost_cv_lib_date_time" >&6; } + case $boost_cv_lib_date_time in #( +- no) $as_echo "$as_me: failed program was:" >&5 ++ (no) $as_echo "$as_me: failed program was:" >&5 + sed 's/^/| /' conftest.$ac_ext >&5 + +- as_fn_error $? "cannot not find the flags to link with Boost date_time" "$LINENO" 5 ++ as_fn_error $? "cannot find the flags to link with Boost date_time" "$LINENO" 5 + ;; + esac + BOOST_DATE_TIME_LDFLAGS=$boost_cv_lib_date_time_LDFLAGS +- ++BOOST_DATE_TIME_LDPATH=$boost_cv_lib_date_time_LDPATH ++BOOST_LDPATH=$boost_cv_lib_date_time_LDPATH + BOOST_DATE_TIME_LIBS=$boost_cv_lib_date_time_LIBS +- + CPPFLAGS=$boost_save_CPPFLAGS + ac_ext=cpp + ac_cpp='$CXXCPP $CPPFLAGS' +@@ -21565,6 +21842,7 @@ + + + ++ + # Check whether --enable-icu was given. + if test "${enable_icu+set}" = set; then : + enableval=$enable_icu; want_icu=${enableval} diff --git a/zarafa.spec b/zarafa.spec index 3821ad1..648d177 100644 --- a/zarafa.spec +++ b/zarafa.spec @@ -1,5 +1,5 @@ %global beta_or_rc 0 -%global actual_release 2 +%global actual_release 3 %global svnrevision 49411 %global with_search 1 %global with_ldap 1 @@ -69,6 +69,7 @@ Patch11: zarafa-7.1.12-webaccess-mcrypt.patch Patch12: zarafa-7.1.12-gsoap-sslv3.patch Patch13: zarafa-7.1.12-licensed-archiver.patch Patch14: zarafa-7.1.12-upgrade-lock.patch +Patch15: zarafa-7.1.12-gcc5.patch BuildRequires: bison BuildRequires: gcc-c++ @@ -410,6 +411,8 @@ rm -f php-webclient-ajax/{.,*,*/*}/*.webaccess-* %patch12 -p1 -b .gsoap-sslv3 %patch13 -p1 -b .licensed-archiver %patch14 -p1 -b .upgrade-lock +%patch15 -p1 -b .gcc5 +touch -c -r autoconf/boost.m4.gcc5 autoconf/boost.m4 %build %if 0%{?rhel}%{?fedora} < 6 @@ -953,6 +956,9 @@ fi %{python_sitearch}/* %changelog +* Wed Jul 01 2015 Robert Scheck 7.1.12-3 +- Added patch to build using GCC 5.x + * Mon May 18 2015 Robert Scheck 7.1.12-2 - Upgrade to 7.1.12 (re-released) - Backported patch from Zarafa 7.2 to fix CVE-2015-3436 (#1222151) From 8735de08acbf87e1803cb2c8f437dd8f4dc89fa2 Mon Sep 17 00:00:00 2001 From: Robert Scheck Date: Wed, 5 Aug 2015 08:48:55 +0200 Subject: [PATCH 20/23] - Upgrade to 7.1.13 - Added patch to fix a possible XSS situation in WebAccess - Added patch to avoid non-working default font in WebAccess - Added patch to implement DHE/EDH support (aside of ECDHE) --- sources | 2 +- zarafa-7.1.12-licensed-archiver.patch | 117 --------- zarafa-7.1.12-webaccess-defaultfont.patch | 18 ++ zarafa-7.1.12-webaccess-xss.patch | 30 +++ zarafa-7.1.13-ssl_dhe.patch | 298 ++++++++++++++++++++++ zarafa.spec | 22 +- 6 files changed, 363 insertions(+), 124 deletions(-) delete mode 100644 zarafa-7.1.12-licensed-archiver.patch create mode 100644 zarafa-7.1.12-webaccess-defaultfont.patch create mode 100644 zarafa-7.1.12-webaccess-xss.patch create mode 100644 zarafa-7.1.13-ssl_dhe.patch diff --git a/sources b/sources index a15167f..9e2492a 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -4744f5c09ca082ea23cd28ea1d10941f zcp-7.1.12.tar.gz +184a6d918703a9e517859a6e1ef97445 zcp-7.1.13.tar.gz diff --git a/zarafa-7.1.12-licensed-archiver.patch b/zarafa-7.1.12-licensed-archiver.patch deleted file mode 100644 index 0ccde8c..0000000 --- a/zarafa-7.1.12-licensed-archiver.patch +++ /dev/null @@ -1,117 +0,0 @@ -Patch by Robert Scheck for Zarafa >= 7.1.12 which removes a wrongly introduced dependency to the -proprietary zarafa-licensed. From Zarafa 7.1.11 to 7.1.12 there were some changes to the ValidateArchiverLicense() method; -due to these changes rebuilding fails with "ArchiverSession.cpp:53:23: fatal error: ECLicense.h: No such file or directory" -now. The patch just reverts the changes that were introduced from 7.1.11 to 7.1.12 to get the code building again. - ---- zarafa-7.1.12/ECtools/zarafa-archiver/ArchiverSession.cpp 2015-04-07 13:10:12.000000000 +0200 -+++ zarafa-7.1.12/ECtools/zarafa-archiver/ArchiverSession.cpp.licensed-archiver 2015-04-07 15:55:07.000000000 +0200 -@@ -50,8 +50,6 @@ - #include "mapiext.h" - #include "userutil.h" - #include "ECMsgStore.h" --#include "ECLicense.h" --#include "ECMAPILicense.h" - - typedef mapi_memory_ptr ECServerListPtr; - -@@ -879,38 +877,7 @@ - typedef mapi_object_ptr 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 -- { -+ HRESULT hr; - unsigned int ulArchivedUsers = 0; - unsigned int ulMaxUsers = 0; - -@@ -931,7 +898,6 @@ - } 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; ---- zarafa-7.1.12/ECtools/zarafa-archiver/Makefile.am 2015-04-07 12:00:49.000000000 +0200 -+++ zarafa-7.1.12/ECtools/zarafa-archiver/Makefile.am.licensed-archiver 2015-04-07 15:59:42.000000000 +0200 -@@ -9,7 +9,6 @@ - -I${top_srcdir}/provider/client \ - -I${top_srcdir}/provider/include \ - -I${top_srcdir}/provider/soap \ -- -I${top_srcdir}/liblicense \ - -I${top_builddir}/provider/soap \ - $(GSOAP_CFLAGS) \ - -I${top_srcdir}/common \ -@@ -17,9 +16,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 \ ---- zarafa-7.1.12/ECtools/zarafa-archiver/Makefile.in 2015-04-07 12:03:40.000000000 +0200 -+++ zarafa-7.1.12/ECtools/zarafa-archiver/Makefile.in.licensed-archiver 2015-04-07 16:00:15.000000000 +0200 -@@ -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 \ -@@ -395,7 +393,6 @@ - -I${top_srcdir}/provider/client \ - -I${top_srcdir}/provider/include \ - -I${top_srcdir}/provider/soap \ -- -I${top_srcdir}/liblicense \ - -I${top_builddir}/provider/soap \ - $(GSOAP_CFLAGS) \ - -I${top_srcdir}/common \ -@@ -403,9 +400,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 \ diff --git a/zarafa-7.1.12-webaccess-defaultfont.patch b/zarafa-7.1.12-webaccess-defaultfont.patch new file mode 100644 index 0000000..2b261b6 --- /dev/null +++ b/zarafa-7.1.12-webaccess-defaultfont.patch @@ -0,0 +1,18 @@ +Patch by Robert Scheck for Zarafa WebAccess >= 7.1.12 which fixes the issue that the configured +default font from the settings (for HTML e-mails) is just not applied when creating a new e-mail. This issue is also known +to Zarafa since at least April 2011 - but will be not fixed at upstream; see also: https://jira.zarafa.com/browse/ZCP-7492 + +This patch is is free software: You can redistribute it and/or modify it under the terms of the GNU Affero General +Public License, version 3, as published by the Free Software Foundation. + +--- zarafa-7.1.12/php-webclient-ajax/client/layout/dialogs/standard/createmail.php 2015-05-08 15:09:05.000000000 +0200 ++++ zarafa-7.1.12/php-webclient-ajax/client/layout/dialogs/standard/createmail.php.rsc 2015-07-12 04:26:59.000000000 +0200 +@@ -381,7 +381,7 @@ + + //set the default font-family for editorarea + var font_family = parentWebclient.settings.get("createmail/maildefaultfont","Arial"); +- document.fckEditor.EditorDocument.body.style.fontFamily = font_family; ++ document.fckEditor.EditorDocument.body.getElementsByTagName("p")[0].style.fontFamily = font_family; + + // set content of body if it is passed in URL + diff --git a/zarafa-7.1.12-webaccess-xss.patch b/zarafa-7.1.12-webaccess-xss.patch new file mode 100644 index 0000000..7bd5b28 --- /dev/null +++ b/zarafa-7.1.12-webaccess-xss.patch @@ -0,0 +1,30 @@ +Patch by Robert Scheck for Zarafa WebAccess >= 6.00 which ensures proper escaping of +multiple user properties like fullname/realname, username and e-mail address. Without this patch a user having +the unlikely fullname/realname '' (without the '') is not properly escaped +on all places within the Zarafa WebAccess; this might be an XSS flaw. + +This patch is is free software: You can redistribute it and/or modify it under the terms of the GNU Affero General +Public License, version 3, as published by the Free Software Foundation. + +--- zarafa-7.1.12/php-webclient-ajax/client/webclient.php 2015-05-08 15:09:05.000000000 +0200 ++++ zarafa-7.1.12/php-webclient-ajax/client/webclient.php.webaccess-xss 2015-07-09 23:42:35.000000000 +0200 +@@ -220,7 +220,7 @@ + dhtml.executeEvent(document.body, "ZarafaDnD:initDragMsgsToDesktop"); + } + +- webclient.setUserInfo("getUserName()))?>", "getFullName()))?>", "getUserEntryid())?>" , "getEmail()))?>"); ++ webclient.setUserInfo("getUserName())))?>", "getFullName())))?>", "getUserEntryid())?>" , "getEmail())))?>"); + + // Store current sessionid in sessionid variable + webclient.sessionid = ""; +--- zarafa-7.1.12/php-webclient-ajax/client/core/layoutmanager.js 2015-05-08 15:09:06.000000000 +0200 ++++ zarafa-7.1.12/php-webclient-ajax/client/core/layoutmanager.js.webaccess-xss 2015-07-09 23:43:39.000000000 +0200 +@@ -324,7 +324,7 @@ + var loggedon = dhtml.getElementById("loggedon"); + + var loggedonas = document.createElement("span"); +- loggedonas.innerHTML = _("you are logged on as") + " " + escapeHtml(webclient.fullname); ++ loggedonas.innerHTML = _("you are logged on as") + " " + webclient.fullname; + loggedon.appendChild(loggedonas); + + var seperator = document.createElement("span"); diff --git a/zarafa-7.1.13-ssl_dhe.patch b/zarafa-7.1.13-ssl_dhe.patch new file mode 100644 index 0000000..9eae54a --- /dev/null +++ b/zarafa-7.1.13-ssl_dhe.patch @@ -0,0 +1,298 @@ +Patch by Robert Scheck for Zarafa >= 7.1.13 which implements DHE aka EDH +(diffie-hellman key exchange) support. https://en.wikipedia.org/wiki/Diffie-Hellman_key_exchange is +providing more information about Perfect Forward Secrecy (PFS). This implementation might need some +more resources compared to ECDHE, however not all servers and/or clients are supporting it through; +e.g. Red Hat Enterprise Linux 5 (and derivates). The prime length of 1024, 2048, 3072, 4096, 6144 +and 8192 bits are based on the private key size to avoid any static DH parameters. Please be aware +that this patch may cause issues with some older SSL/TLS clients, mostly Java 7 or earlier, that do +not support primes larger than 1024 bits. + +Suggestions for testing; run the following openssl(1) commands before and after applying this patch: + +1. echo QUIT | openssl s_client -cipher 'kEDH:ALL' -connect :110 -starttls pop3 2>&1 | grep Cipher +2. echo QUIT | openssl s_client -cipher 'kEDH:ALL' -connect :143 -starttls imap 2>&1 | grep Cipher +3. echo QUIT | openssl s_client -cipher 'kEDH:ALL' -connect :237 2>&1 | grep Cipher +4. echo QUIT | openssl s_client -cipher 'kEDH:ALL' -connect :993 2>&1 | grep Cipher +5. echo QUIT | openssl s_client -cipher 'kEDH:ALL' -connect :995 2>&1 | grep Cipher +6. echo QUIT | openssl s_client -cipher 'kEDH:ALL' -connect :8443 2>&1 | grep Cipher + +After applying this patch the output should contain e.g. "DHE-RSA-AES256-GCM-SHA384" on a Red Hat +Enterprise Linux 6 (and derivates). Without this patch the result is e.g. "AES256-GCM-SHA384". Note +that ZCP-12237 is maybe having influence on the result depending on the exact test case. + +Important: As https://www.mail-archive.com/haproxy@formilux.org/msg13274.html is the origin for this +patch (a HAProxy patch suggestion, which itself bases on mod_ssl of Apache httpd), the licensing is +likely a combination out of the Apache License, Version 2.0, the GNU General Public License, version +2 (or later) and the GNU Affero General Public License, version 3 (and thus excludes dual-licensing +situations such as at the upstream of Zarafa). + +This patch should be only applied after ZCP-12237 and its dependencies. + +--- zarafa-7.1.13/common/ECChannel.cpp 2015-07-30 01:01:07.212313822 +0200 ++++ zarafa-7.1.13/common/ECChannel.cpp.ssl_dhe 2015-07-30 02:05:36.045747555 +0200 +@@ -85,6 +85,119 @@ + // because of statics + SSL_CTX* ECChannel::lpCTX = NULL; + ++#if !defined(OPENSSL_NO_DH) ++static DH *ssl_get_dh_1024(void) { ++ DH *dh = DH_new(); ++ if (dh) { ++ dh->p = get_rfc2409_prime_1024(NULL); ++ // See RFC 2409, Section 6 "Oakley Groups" for the reason why we use 2 as a generator ++ BN_dec2bn(&dh->g, "2"); ++ if (!dh->p || !dh->g) { ++ DH_free(dh); ++ dh = NULL; ++ } ++ } ++ return dh; ++} ++ ++static DH *ssl_get_dh_2048(void) { ++ DH *dh = DH_new(); ++ if (dh) { ++ dh->p = get_rfc3526_prime_2048(NULL); ++ // See RFC 3526, Section 3 "2048-bit MODP Group" for the reason why we use 2 as a generator ++ BN_dec2bn(&dh->g, "2"); ++ if (!dh->p || !dh->g) { ++ DH_free(dh); ++ dh = NULL; ++ } ++ } ++ return dh; ++} ++ ++static DH *ssl_get_dh_3072(void) { ++ DH *dh = DH_new(); ++ if (dh) { ++ dh->p = get_rfc3526_prime_3072(NULL); ++ // See RFC 3526, Section 4 "3072-bit MODP Group" for the reason why we use 2 as a generator ++ BN_dec2bn(&dh->g, "2"); ++ if (!dh->p || !dh->g) { ++ DH_free(dh); ++ dh = NULL; ++ } ++ } ++ return dh; ++} ++ ++static DH *ssl_get_dh_4096(void) { ++ DH *dh = DH_new(); ++ if (dh) { ++ dh->p = get_rfc3526_prime_4096(NULL); ++ // See RFC 3526, Section 5 "4096-bit MODP Group" for the reason why we use 2 as a generator ++ BN_dec2bn(&dh->g, "2"); ++ if (!dh->p || !dh->g) { ++ DH_free(dh); ++ dh = NULL; ++ } ++ } ++ return dh; ++} ++ ++static DH *ssl_get_dh_6144(void) { ++ DH *dh = DH_new(); ++ if (dh) { ++ dh->p = get_rfc3526_prime_6144(NULL); ++ // See RFC 3526, Section 6 "6144-bit MODP Group" for the reason why we use 2 as a generator ++ BN_dec2bn(&dh->g, "2"); ++ if (!dh->p || !dh->g) { ++ DH_free(dh); ++ dh = NULL; ++ } ++ } ++ return dh; ++} ++ ++static DH *ssl_get_dh_8192(void) { ++ DH *dh = DH_new(); ++ if (dh) { ++ dh->p = get_rfc3526_prime_8192(NULL); ++ // See RFC 3526, Section 7 "8192-bit MODP Group" for the reason why we use 2 as a generator ++ BN_dec2bn(&dh->g, "2"); ++ if (!dh->p || !dh->g) { ++ DH_free(dh); ++ dh = NULL; ++ } ++ } ++ return dh; ++} ++ ++// Returns Diffie-Hellman parameters matching the private key length ++static DH *ssl_get_tmp_dh(SSL *ssl, int exporting, int keylen) { ++ DH *dh = NULL; ++ EVP_PKEY *pkey = SSL_get_privatekey(ssl); ++ int type = pkey ? EVP_PKEY_type(pkey->type) : EVP_PKEY_NONE; ++ ++ if (type == EVP_PKEY_RSA || type == EVP_PKEY_DSA) { ++ keylen = EVP_PKEY_bits(pkey); ++ } ++ ++ if (keylen >= 8192) { ++ dh = ssl_get_dh_8192(); ++ } else if (keylen >= 6144) { ++ dh = ssl_get_dh_6144(); ++ } else if (keylen >= 4096) { ++ dh = ssl_get_dh_4096(); ++ } else if (keylen >= 3072) { ++ dh = ssl_get_dh_3072(); ++ } else if (keylen >= 2048) { ++ dh = ssl_get_dh_2048(); ++ } else { ++ dh = ssl_get_dh_1024(); ++ } ++ ++ return dh; ++} ++#endif ++ + HRESULT ECChannel::HrSetCtx(ECConfig *lpConfig, ECLogger *lpLogger) { + HRESULT hr = hrSuccess; + char *szFile = NULL; +@@ -116,6 +229,11 @@ + + SSL_CTX_set_options(lpCTX, SSL_OP_ALL); // enable quirk and bug workarounds + ++#if !defined(OPENSSL_NO_DH) ++ SSL_CTX_set_options(lpCTX, SSL_OP_SINGLE_DH_USE); ++ SSL_CTX_set_tmp_dh_callback(lpCTX, ssl_get_tmp_dh); ++#endif ++ + #if !defined(OPENSSL_NO_ECDH) && defined(NID_X9_62_prime256v1) + ecdh = EC_KEY_new_by_curve_name(NID_X9_62_prime256v1); + +--- zarafa-7.1.13/provider/server/ECSoapServerConnection.cpp 2015-07-30 01:01:07.212313822 +0200 ++++ zarafa-7.1.13/provider/server/ECSoapServerConnection.cpp.ssl_dhe 2015-07-30 02:05:54.658626465 +0200 +@@ -165,6 +165,119 @@ + return nRet; + } + ++#if !defined(OPENSSL_NO_DH) ++static DH *ssl_get_dh_1024(void) { ++ DH *dh = DH_new(); ++ if (dh) { ++ dh->p = get_rfc2409_prime_1024(NULL); ++ // See RFC 2409, Section 6 "Oakley Groups" for the reason why we use 2 as a generator ++ BN_dec2bn(&dh->g, "2"); ++ if (!dh->p || !dh->g) { ++ DH_free(dh); ++ dh = NULL; ++ } ++ } ++ return dh; ++} ++ ++static DH *ssl_get_dh_2048(void) { ++ DH *dh = DH_new(); ++ if (dh) { ++ dh->p = get_rfc3526_prime_2048(NULL); ++ // See RFC 3526, Section 3 "2048-bit MODP Group" for the reason why we use 2 as a generator ++ BN_dec2bn(&dh->g, "2"); ++ if (!dh->p || !dh->g) { ++ DH_free(dh); ++ dh = NULL; ++ } ++ } ++ return dh; ++} ++ ++static DH *ssl_get_dh_3072(void) { ++ DH *dh = DH_new(); ++ if (dh) { ++ dh->p = get_rfc3526_prime_3072(NULL); ++ // See RFC 3526, Section 4 "3072-bit MODP Group" for the reason why we use 2 as a generator ++ BN_dec2bn(&dh->g, "2"); ++ if (!dh->p || !dh->g) { ++ DH_free(dh); ++ dh = NULL; ++ } ++ } ++ return dh; ++} ++ ++static DH *ssl_get_dh_4096(void) { ++ DH *dh = DH_new(); ++ if (dh) { ++ dh->p = get_rfc3526_prime_4096(NULL); ++ // See RFC 3526, Section 5 "4096-bit MODP Group" for the reason why we use 2 as a generator ++ BN_dec2bn(&dh->g, "2"); ++ if (!dh->p || !dh->g) { ++ DH_free(dh); ++ dh = NULL; ++ } ++ } ++ return dh; ++} ++ ++static DH *ssl_get_dh_6144(void) { ++ DH *dh = DH_new(); ++ if (dh) { ++ dh->p = get_rfc3526_prime_6144(NULL); ++ // See RFC 3526, Section 6 "6144-bit MODP Group" for the reason why we use 2 as a generator ++ BN_dec2bn(&dh->g, "2"); ++ if (!dh->p || !dh->g) { ++ DH_free(dh); ++ dh = NULL; ++ } ++ } ++ return dh; ++} ++ ++static DH *ssl_get_dh_8192(void) { ++ DH *dh = DH_new(); ++ if (dh) { ++ dh->p = get_rfc3526_prime_8192(NULL); ++ // See RFC 3526, Section 7 "8192-bit MODP Group" for the reason why we use 2 as a generator ++ BN_dec2bn(&dh->g, "2"); ++ if (!dh->p || !dh->g) { ++ DH_free(dh); ++ dh = NULL; ++ } ++ } ++ return dh; ++} ++ ++// Returns Diffie-Hellman parameters matching the private key length ++static DH *ssl_get_tmp_dh(SSL *ssl, int exporting, int keylen) { ++ DH *dh = NULL; ++ EVP_PKEY *pkey = SSL_get_privatekey(ssl); ++ int type = pkey ? EVP_PKEY_type(pkey->type) : EVP_PKEY_NONE; ++ ++ if (type == EVP_PKEY_RSA || type == EVP_PKEY_DSA) { ++ keylen = EVP_PKEY_bits(pkey); ++ } ++ ++ if (keylen >= 8192) { ++ dh = ssl_get_dh_8192(); ++ } else if (keylen >= 6144) { ++ dh = ssl_get_dh_6144(); ++ } else if (keylen >= 4096) { ++ dh = ssl_get_dh_4096(); ++ } else if (keylen >= 3072) { ++ dh = ssl_get_dh_3072(); ++ } else if (keylen >= 2048) { ++ dh = ssl_get_dh_2048(); ++ } else { ++ dh = ssl_get_dh_1024(); ++ } ++ ++ return dh; ++} ++#endif ++ + ECSoapServerConnection::ECSoapServerConnection(ECConfig* lpConfig, ECLogger* lpLogger) + { + m_lpConfig = lpConfig; +@@ -271,6 +384,11 @@ + + SSL_CTX_set_options(lpsSoap->ctx, SSL_OP_ALL); + ++#if !defined(OPENSSL_NO_DH) ++ SSL_CTX_set_options(lpsSoap->ctx, SSL_OP_SINGLE_DH_USE); ++ SSL_CTX_set_tmp_dh_callback(lpsSoap->ctx, ssl_get_tmp_dh); ++#endif ++ + #if !defined(OPENSSL_NO_ECDH) && defined(NID_X9_62_prime256v1) + ecdh = EC_KEY_new_by_curve_name(NID_X9_62_prime256v1); + diff --git a/zarafa.spec b/zarafa.spec index 648d177..e9fda9b 100644 --- a/zarafa.spec +++ b/zarafa.spec @@ -1,6 +1,6 @@ %global beta_or_rc 0 -%global actual_release 3 -%global svnrevision 49411 +%global actual_release 1 +%global svnrevision 51032 %global with_search 1 %global with_ldap 1 %global with_xmlto 1 @@ -31,7 +31,7 @@ Summary: Open Source Edition of the Zarafa Collaboration Platform Name: zarafa -Version: 7.1.12 +Version: 7.1.13 %if %{beta_or_rc} Release: 0.%{actual_release}.svn%{svnrevision}%{?dist} %else @@ -67,9 +67,11 @@ Patch9: zarafa-7.1.11-vacation-headers2.patch Patch10: zarafa-7.1.11-webaccess-fail2ban.patch Patch11: zarafa-7.1.12-webaccess-mcrypt.patch Patch12: zarafa-7.1.12-gsoap-sslv3.patch -Patch13: zarafa-7.1.12-licensed-archiver.patch Patch14: zarafa-7.1.12-upgrade-lock.patch Patch15: zarafa-7.1.12-gcc5.patch +Patch16: zarafa-7.1.12-webaccess-xss.patch +Patch17: zarafa-7.1.12-webaccess-defaultfont.patch +Patch18: zarafa-7.1.13-ssl_dhe.patch BuildRequires: bison BuildRequires: gcc-c++ @@ -407,12 +409,14 @@ touch -c -r aclocal.m4.rpath aclocal.m4 %patch9 -p1 -b .vacation-headers2 %patch10 -p1 -b .webaccess-fail2ban %patch11 -p1 -b .webaccess-mcrypt -rm -f php-webclient-ajax/{.,*,*/*}/*.webaccess-* %patch12 -p1 -b .gsoap-sslv3 -%patch13 -p1 -b .licensed-archiver %patch14 -p1 -b .upgrade-lock %patch15 -p1 -b .gcc5 touch -c -r autoconf/boost.m4.gcc5 autoconf/boost.m4 +%patch16 -p1 -b .webaccess-xss +%patch17 -p1 -b .webaccess-defaultfont +rm -f php-webclient-ajax/{.,*,*/*,*/*/*/*}/*.webaccess-* +%patch18 -p1 -b .ssl_dhe %build %if 0%{?rhel}%{?fedora} < 6 @@ -956,6 +960,12 @@ fi %{python_sitearch}/* %changelog +* Wed Aug 05 2015 Robert Scheck 7.1.13-1 +- Upgrade to 7.1.13 +- Added patch to fix a possible XSS situation in WebAccess +- Added patch to avoid non-working default font in WebAccess +- Added patch to implement DHE/EDH support (aside of ECDHE) + * Wed Jul 01 2015 Robert Scheck 7.1.12-3 - Added patch to build using GCC 5.x From 4e07fdc3d53ca66315c7ebb1955bdf82d0ae4b40 Mon Sep 17 00:00:00 2001 From: Robert Scheck Date: Tue, 10 Nov 2015 19:01:00 +0100 Subject: [PATCH 21/23] Upgrade to 7.1.14 (#1263006) --- sources | 2 +- zarafa.spec | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/sources b/sources index 9e2492a..32260d6 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -184a6d918703a9e517859a6e1ef97445 zcp-7.1.13.tar.gz +ded12c2363c7205889b8c68519140a4b zcp-7.1.14.tar.gz diff --git a/zarafa.spec b/zarafa.spec index e9fda9b..a0918f4 100644 --- a/zarafa.spec +++ b/zarafa.spec @@ -1,6 +1,6 @@ %global beta_or_rc 0 %global actual_release 1 -%global svnrevision 51032 +%global svnrevision 51822 %global with_search 1 %global with_ldap 1 %global with_xmlto 1 @@ -31,7 +31,7 @@ Summary: Open Source Edition of the Zarafa Collaboration Platform Name: zarafa -Version: 7.1.13 +Version: 7.1.14 %if %{beta_or_rc} Release: 0.%{actual_release}.svn%{svnrevision}%{?dist} %else @@ -385,6 +385,8 @@ PHP projects, using the MAPI functions like a normal MAPI program. %package -n python-MAPI Summary: The Python MAPI extension by Zarafa Group: Development/Languages +Provides: python-mapi = %{version}-%{release} +Provides: python-mapi%{?_isa} = %{version}-%{release} %description -n python-MAPI The python-MAPI package contains the Python MAPI extension to provide the @@ -960,6 +962,9 @@ fi %{python_sitearch}/* %changelog +* Tue Nov 10 2015 Robert Scheck 7.1.14-1 +- Upgrade to 7.1.14 (#1263006) + * Wed Aug 05 2015 Robert Scheck 7.1.13-1 - Upgrade to 7.1.13 - Added patch to fix a possible XSS situation in WebAccess From a56a8a43af83961725640b22ac63cb28d210d7c0 Mon Sep 17 00:00:00 2001 From: Robert Scheck Date: Wed, 23 Dec 2015 16:12:03 +0100 Subject: [PATCH 22/23] Rebuild for libical soname bump (#1288284) --- zarafa.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zarafa.spec b/zarafa.spec index a0918f4..5b9f2cd 100644 --- a/zarafa.spec +++ b/zarafa.spec @@ -1,5 +1,5 @@ %global beta_or_rc 0 -%global actual_release 1 +%global actual_release 2 %global svnrevision 51822 %global with_search 1 %global with_ldap 1 @@ -962,6 +962,9 @@ fi %{python_sitearch}/* %changelog +* Wed Dec 23 2015 Robert Scheck 7.1.14-2 +- Rebuild for libical soname bump (#1288284) + * Tue Nov 10 2015 Robert Scheck 7.1.14-1 - Upgrade to 7.1.14 (#1263006) From e225a36f015c61497d8c7c84dccc025cff2c8b92 Mon Sep 17 00:00:00 2001 From: Robert Scheck Date: Tue, 29 Nov 2016 02:53:36 +0100 Subject: [PATCH 23/23] Added upstream patch to fix broken group expansion (ZCP-12148) --- zarafa-7.1.14-spooler-expand_groups.patch | 147 ++++++++++++++++++++++ zarafa.spec | 7 +- 2 files changed, 153 insertions(+), 1 deletion(-) create mode 100644 zarafa-7.1.14-spooler-expand_groups.patch diff --git a/zarafa-7.1.14-spooler-expand_groups.patch b/zarafa-7.1.14-spooler-expand_groups.patch new file mode 100644 index 0000000..f322ba8 --- /dev/null +++ b/zarafa-7.1.14-spooler-expand_groups.patch @@ -0,0 +1,147 @@ +Backport of upstream patch from subversion revision 50583 to fix https://jira.zarafa.com/browse/ZCP-12148 + +--- zarafa-7.1.14/inetmapi/ECVMIMEUtils.cpp 2015-10-20 11:13:43.000000000 +0200 ++++ zarafa-7.1.14/inetmapi/ECVMIMEUtils.cpp.spooler-expand_groups 2016-11-28 22:46:59.000000000 +0100 +@@ -112,7 +112,7 @@ + * This function takes a MAPI table, reads all items from it, expands any groups and adds all expanded recipients into the passed + * recipient table. Group expansion is recursive. + */ +-HRESULT ECVMIMESender::HrAddRecipsFromTable(LPADRBOOK lpAdrBook, IMAPITable *lpTable, vmime::mailboxList &recipients, std::set &setGroups, std::set &setRecips, bool bAllowEveryone) ++HRESULT ECVMIMESender::HrAddRecipsFromTable(LPADRBOOK lpAdrBook, IMAPITable *lpTable, vmime::mailboxList &recipients, std::set &setGroups, std::set &setRecips, bool bAllowEveryone, bool bAlwaysExpandDistrList) + { + HRESULT hr = hrSuccess; + LPSRowSet lpRowSet = NULL; +@@ -125,14 +125,10 @@ + // Get all recipients from the group + for (ULONG i = 0; i < lpRowSet->cRows; i++) { + LPSPropValue lpPropObjectType = PpropFindProp( lpRowSet->aRow[i].lpProps, lpRowSet->aRow[i].cValues, PR_OBJECT_TYPE); ++ bool bAddrFetchSuccess = HrGetAddress(lpAdrBook, lpRowSet->aRow[i].lpProps, lpRowSet->aRow[i].cValues, PR_ENTRYID, PR_DISPLAY_NAME_W, PR_ADDRTYPE_W, PR_EMAIL_ADDRESS_W, strName, strType, strEmail) == hrSuccess; + +- if(lpPropObjectType == NULL || lpPropObjectType->Value.ul == MAPI_MAILUSER) { +- // Normal recipient +- if (HrGetAddress(lpAdrBook, lpRowSet->aRow[i].lpProps, lpRowSet->aRow[i].cValues, +- PR_ENTRYID, PR_DISPLAY_NAME_W, PR_ADDRTYPE_W, PR_EMAIL_ADDRESS_W, +- strName, strType, strEmail) == hrSuccess) +- { +- ++ if (bAddrFetchSuccess && (lpPropObjectType == NULL || lpPropObjectType->Value.ul == MAPI_MAILUSER || (lpPropObjectType->Value.ul == MAPI_DISTLIST && !bAlwaysExpandDistrList))) { ++ if (bAddrFetchSuccess) { + if(!strEmail.empty() && setRecips.find(strEmail) == setRecips.end()) { + recipients.appendMailbox(vmime::create(convert_to(strEmail))); + setRecips.insert(strEmail); +@@ -263,7 +259,7 @@ + if(hr != hrSuccess) + goto exit; + +- hr = HrAddRecipsFromTable(lpAdrBook, lpTable, recipients, setGroups, setRecips, bAllowEveryone); ++ hr = HrAddRecipsFromTable(lpAdrBook, lpTable, recipients, setGroups, setRecips, bAllowEveryone, true); + if(hr != hrSuccess) + goto exit; + +@@ -283,7 +279,7 @@ + return hr; + } + +-HRESULT ECVMIMESender::HrMakeRecipientsList(LPADRBOOK lpAdrBook, LPMESSAGE lpMessage, vmime::ref vmMessage, vmime::mailboxList &recipients, bool bAllowEveryone) ++HRESULT ECVMIMESender::HrMakeRecipientsList(LPADRBOOK lpAdrBook, LPMESSAGE lpMessage, vmime::ref vmMessage, vmime::mailboxList &recipients, bool bAllowEveryone, bool bAlwaysExpandDistrList) + { + HRESULT hr = hrSuccess; + SRestriction sRestriction; +@@ -320,7 +316,7 @@ + goto exit; + } + +- hr = HrAddRecipsFromTable(lpAdrBook, lpRTable, recipients, setGroups, setRecips, bAllowEveryone); ++ hr = HrAddRecipsFromTable(lpAdrBook, lpRTable, recipients, setGroups, setRecips, bAllowEveryone, true); + if (hr != hrSuccess) + goto exit; + +@@ -338,7 +334,7 @@ + // This function does not catch the vmime exception + // it should be handled by the calling party. + +-HRESULT ECVMIMESender::sendMail(LPADRBOOK lpAdrBook, LPMESSAGE lpMessage, vmime::ref vmMessage, bool bAllowEveryone) ++HRESULT ECVMIMESender::sendMail(LPADRBOOK lpAdrBook, LPMESSAGE lpMessage, vmime::ref vmMessage, bool bAllowEveryone, bool bAlwaysExpandDistrList) + { + HRESULT hr = hrSuccess; + vmime::mailbox expeditor; +@@ -386,7 +382,7 @@ + goto exit; + } + +- hr = HrMakeRecipientsList(lpAdrBook, lpMessage, vmMessage, recipients, bAllowEveryone); ++ hr = HrMakeRecipientsList(lpAdrBook, lpMessage, vmMessage, recipients, bAllowEveryone, bAlwaysExpandDistrList); + if (hr != hrSuccess) + goto exit; + +--- zarafa-7.1.14/inetmapi/ECVMIMEUtils.h 2015-10-20 11:13:43.000000000 +0200 ++++ zarafa-7.1.14/inetmapi/ECVMIMEUtils.h.spooler-expand_groups 2016-11-28 22:51:24.000000000 +0100 +@@ -55,15 +55,15 @@ + { + private: + +- HRESULT HrMakeRecipientsList(LPADRBOOK lpAdrBook, LPMESSAGE lpMessage, vmime::ref vmMessage, vmime::mailboxList &recipients, bool bAllowEveryone); ++ HRESULT HrMakeRecipientsList(LPADRBOOK lpAdrBook, LPMESSAGE lpMessage, vmime::ref vmMessage, vmime::mailboxList &recipients, bool bAllowEveryone, bool bAlwaysExpandDistrList); + HRESULT HrExpandGroup(LPADRBOOK lpAdrBook, LPSPropValue lpGroupName, LPSPropValue lpGroupEntryID, vmime::mailboxList &recipients, std::set &setGroups, std::set &setRecips, bool bAllowEveryone); +- HRESULT HrAddRecipsFromTable(LPADRBOOK lpAdrBook, IMAPITable *lpTable, vmime::mailboxList &recipients, std::set &setGroups, std::set &setRecips, bool bAllowEveryone); ++ HRESULT HrAddRecipsFromTable(LPADRBOOK lpAdrBook, IMAPITable *lpTable, vmime::mailboxList &recipients, std::set &setGroups, std::set &setRecips, bool bAllowEveryone, bool bAlwaysExpandDistrList); + + public: + ECVMIMESender(ECLogger *newlpLogger, std::string strSMTPHost, int port); + virtual ~ECVMIMESender(); + +- HRESULT sendMail(LPADRBOOK lpAdrBook, LPMESSAGE lpMessage, vmime::ref vmMessage, bool bAllowEveryone); ++ HRESULT sendMail(LPADRBOOK lpAdrBook, LPMESSAGE lpMessage, vmime::ref vmMessage, bool bAllowEveryone, bool bAlwaysExpandDistrList); + }; + + #endif +--- zarafa-7.1.14/inetmapi/inetmapi.cpp 2015-10-20 11:13:43.000000000 +0200 ++++ zarafa-7.1.14/inetmapi/inetmapi.cpp.spooler-expand_groups 2016-11-28 22:50:04.000000000 +0100 +@@ -331,7 +331,7 @@ + goto exit; + } + +- hr = mailer->sendMail(lpAddrBook, lpMessage, vmMessage, sopt.allow_send_to_everyone); ++ hr = mailer->sendMail(lpAddrBook, lpMessage, vmMessage, sopt.allow_send_to_everyone, sopt.always_expand_distr_list); + + exit: + delete mToVM; +--- zarafa-7.1.14/inetmapi/options.h 2015-10-20 11:13:43.000000000 +0200 ++++ zarafa-7.1.14/inetmapi/options.h.spooler-expand_groups 2016-11-28 22:55:44.000000000 +0100 +@@ -68,6 +68,7 @@ + char *charset_upgrade; + bool allow_send_to_everyone; + bool enable_dsn; /**< Enable SMTP Delivery Status Notifications */ ++ bool always_expand_distr_list; + } sending_options; + + void INETMAPI_API imopt_default_delivery_options(delivery_options *dopt); +--- zarafa-7.1.14/spooler/mailer.cpp 2015-10-20 11:13:43.000000000 +0200 ++++ zarafa-7.1.14/spooler/mailer.cpp.spooler-expand_groups 2016-11-28 22:54:38.000000000 +0100 +@@ -2178,6 +2178,8 @@ + // Enable SMTP Delivery Status Notifications + sopt.enable_dsn = parseBool(g_lpConfig->GetSetting("enable_dsn")); + ++ sopt.always_expand_distr_list = parseBool(g_lpConfig->GetSetting("expand_groups")); ++ + // Init plugin system + hr = pyMapiPluginFactory.Init(g_lpConfig, g_lpLogger); + if (hr != hrSuccess) { +@@ -2427,7 +2429,7 @@ + */ + } + +- if(parseBool(g_lpConfig->GetSetting("expand_groups"))) { ++ if (sopt.always_expand_distr_list) { + // Expand recipients with ADDRTYPE=ZARAFA to multiple ADDRTYPE=SMTP recipients + hr = ExpandRecipients(lpAddrBook, lpMessage); + if(hr != hrSuccess) +@@ -2438,7 +2440,7 @@ + if (hr != hrSuccess) + g_lpLogger->Log(EC_LOGLEVEL_WARNING, "Unable to rewrite recipients"); + +- if(parseBool(g_lpConfig->GetSetting("expand_groups"))) { ++ if (sopt.always_expand_distr_list) { + // Only touch recips if we're expanding groups; the rationale is here that the user + // has typed a recipient twice if we have duplicates and expand_groups = no, so that's + // what the user wanted apparently. What's more, duplicate recips are filtered for RCPT TO diff --git a/zarafa.spec b/zarafa.spec index 5b9f2cd..067aed8 100644 --- a/zarafa.spec +++ b/zarafa.spec @@ -1,5 +1,5 @@ %global beta_or_rc 0 -%global actual_release 2 +%global actual_release 3 %global svnrevision 51822 %global with_search 1 %global with_ldap 1 @@ -72,6 +72,7 @@ Patch15: zarafa-7.1.12-gcc5.patch Patch16: zarafa-7.1.12-webaccess-xss.patch Patch17: zarafa-7.1.12-webaccess-defaultfont.patch Patch18: zarafa-7.1.13-ssl_dhe.patch +Patch19: zarafa-7.1.14-spooler-expand_groups.patch BuildRequires: bison BuildRequires: gcc-c++ @@ -419,6 +420,7 @@ touch -c -r autoconf/boost.m4.gcc5 autoconf/boost.m4 %patch17 -p1 -b .webaccess-defaultfont rm -f php-webclient-ajax/{.,*,*/*,*/*/*/*}/*.webaccess-* %patch18 -p1 -b .ssl_dhe +%patch19 -p1 -b .spooler-expand_groups %build %if 0%{?rhel}%{?fedora} < 6 @@ -962,6 +964,9 @@ fi %{python_sitearch}/* %changelog +* Mon Nov 28 2016 Robert Scheck 7.1.14-3 +- Added upstream patch to fix broken group expansion (ZCP-12148) + * Wed Dec 23 2015 Robert Scheck 7.1.14-2 - Rebuild for libical soname bump (#1288284)