From b988055937e7f77e0cfb1a076b5e198755830c9b Mon Sep 17 00:00:00 2001
From: root <root@example.com>
Date: Mon, 7 Apr 2014 13:26:09 +0200
Subject: [PATCH 2/2] outlook folder mgmt1

---
 SoObjects/Mailer/SOGoMailFolder.m |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/SoObjects/Mailer/SOGoMailFolder.m b/SoObjects/Mailer/SOGoMailFolder.m
index 7f45ec8..7170f0a 100644
--- a/SoObjects/Mailer/SOGoMailFolder.m
+++ b/SoObjects/Mailer/SOGoMailFolder.m
@@ -291,10 +291,18 @@ static NSString *defaultUserID =  @"anyone";
           path = [[imap4URL path] stringByDeletingLastPathComponent];
           if (![path hasSuffix: @"/"])
             path = [path stringByAppendingString: @"/"];
+
+	  // tfu if new name contains the path - dont't need to add
+          if ([newName rangeOfString: @"/"].location == NSNotFound)
           destURL = [[NSURL alloc] initWithScheme: [imap4URL scheme]
                                              host: [imap4URL host]
                                              path: [NSString stringWithFormat: @"%@%@",
                                                              path, [newName stringByEncodingImap4FolderName]]];
+          else
+          destURL = [[NSURL alloc] initWithScheme: [imap4URL scheme]
+                                             host: [imap4URL host]
+                                             path: [NSString stringWithFormat: @"%@",
+                                                              [newName stringByEncodingImap4FolderName]]];
           [destURL autorelease];
           error = [imap4 moveMailboxAtURL: imap4URL
                                     toURL: destURL];
-- 
1.7.9.5

