diff --git a/ChangeLog b/ChangeLog index db56264e0..6e9bf3eba 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2012-03-06 Wolfgang Sourdeau + * SoObjects/Mailer/SOGoMailFolder.m + (-archiveUIDs:inArchiveNamed:inContext:): output filename is now + escaped without its extension. + * SoObjects/Contacts/NGVCard+SOGo.m (-_setupEmailFieldsInLDIFRecord:): simplified code and fixed a bug where the home mail would be taken for both first and second email diff --git a/SoObjects/Mailer/SOGoMailFolder.m b/SoObjects/Mailer/SOGoMailFolder.m index 87cece7d8..a1c3b5e3d 100644 --- a/SoObjects/Mailer/SOGoMailFolder.m +++ b/SoObjects/Mailer/SOGoMailFolder.m @@ -468,7 +468,7 @@ static NSString *defaultUserID = @"anyone"; { NSException *error; NSFileManager *fm; - NSString *spoolPath, *fileName, *zipPath, *qpFileName; + NSString *spoolPath, *fileName, *baseName, *extension, *zipPath, *qpFileName; NSDictionary *msgs; NSArray *messages; NSData *content, *zipContent; @@ -533,7 +533,17 @@ static NSString *defaultUserID = @"anyone"; } response = [context response]; - qpFileName = [archiveName asQPSubjectString: @"utf-8"]; + + baseName = [archiveName stringByDeletingPathExtension]; + extension = [archiveName pathExtension]; + if ([extension length] > 0) + extension = [@"." stringByAppendingString: extension]; + else + extension = @""; + + qpFileName = [NSString stringWithFormat: @"%@%@", + [baseName asQPSubjectString: @"utf-8"], + extension]; [response setHeader: [NSString stringWithFormat: @"application/zip;" @" name=\"%@\"", qpFileName]