From 1292c191eca61027b9856b04840105fde588d42c Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Tue, 10 Jun 2014 08:46:35 -0400 Subject: [PATCH] Make sure we don't have '-' in table names. --- OpenChange/MAPIStoreUserContext.m | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/OpenChange/MAPIStoreUserContext.m b/OpenChange/MAPIStoreUserContext.m index d0284eb6f..bad00b260 100644 --- a/OpenChange/MAPIStoreUserContext.m +++ b/OpenChange/MAPIStoreUserContext.m @@ -294,9 +294,12 @@ static NSMapTable *contextsTable = nil; if ([parts count] == 5) { /* If "OCSFolderInfoURL" is properly configured, we must have 5 - parts in this url. */ + parts in this url. We strip the '-' character in case we have + this in the domain part - like foo@bar-zot.com */ ocFSTableName = [NSString stringWithFormat: @"sogo_cache_folder_%@", - [username asCSSIdentifier]]; + [[[user loginInDomain] asCSSIdentifier] + stringByReplacingOccurrencesOfString: @"-" + withString: @"_"]]; [parts replaceObjectAtIndex: 4 withObject: ocFSTableName]; folderTableURL = [NSURL URLWithString: [parts componentsJoinedByString: @"/"]];