e5b36c
diff -up openchange-openchange-2.3-VULCAN/libmapi/IMSProvider.c.fix-connection-args openchange-openchange-2.3-VULCAN/libmapi/IMSProvider.c
e5b36c
--- openchange-openchange-2.3-VULCAN/libmapi/IMSProvider.c.fix-connection-args	2015-05-16 17:22:04.000000000 +0200
e5b36c
+++ openchange-openchange-2.3-VULCAN/libmapi/IMSProvider.c	2016-04-07 19:10:30.340959912 +0200
e5b36c
@@ -91,6 +91,7 @@ static char *build_binding_string(struct
e5b36c
 				  struct mapi_profile *profile)
e5b36c
 {
e5b36c
 	char	*binding;
e5b36c
+	bool	any_string_added = false;
e5b36c
 
e5b36c
 	/* Sanity Checks */
e5b36c
 	if (!profile) return NULL;
e5b36c
@@ -101,15 +102,23 @@ static char *build_binding_string(struct
e5b36c
 
e5b36c
 	/* If dump-data option is enabled */
e5b36c
 	if (mapi_ctx->dumpdata == true) {
e5b36c
-		binding = talloc_strdup_append(binding, "print,");
e5b36c
+		binding = talloc_strdup_append(binding, "print");
e5b36c
+		any_string_added = true;
e5b36c
 	}
e5b36c
 	/* If seal option is enabled in the profile */
e5b36c
 	if (profile->seal == true) {
e5b36c
-		binding = talloc_strdup_append(binding, "seal,");
e5b36c
+		if (any_string_added) {
e5b36c
+			binding = talloc_strdup_append(binding, ",");
e5b36c
+		}
e5b36c
+		binding = talloc_strdup_append(binding, "seal");
e5b36c
+		any_string_added = true;
e5b36c
 	}
e5b36c
 	/* If localaddress parameter is available in the profile */
e5b36c
 	if (profile->localaddr) {
e5b36c
-		binding = talloc_asprintf_append(binding, "localaddress=%s,", profile->localaddr);
e5b36c
+		if (any_string_added) {
e5b36c
+			binding = talloc_strdup_append(binding, ",");
e5b36c
+		}
e5b36c
+		binding = talloc_asprintf_append(binding, "localaddress=%s", profile->localaddr);
e5b36c
 	}
e5b36c
 	
e5b36c
 	binding = talloc_strdup_append(binding, "]");