(fix) remaining S/MIME fixes to handle image/CIDs in HTML mails

This commit is contained in:
Ludovic Marcotte
2018-01-23 10:35:46 -05:00
parent 341e5cbab0
commit 511aa63a34
13 changed files with 221 additions and 92 deletions
+4 -1
View File
@@ -1,6 +1,6 @@
/* NSObject+Utilities.h - this file is part of SOGo
*
* Copyright (C) 2007-2015 Inverse inc.
* Copyright (C) 2007-2017 Inverse inc.
*
* This file is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -24,6 +24,7 @@
#import <DOM/DOMProtocols.h>
@class NSArray;
@class NSString;
@class WOContext;
@@ -39,6 +40,8 @@
+ (void) memoryStatistics;
- (NSArray *) parts;
@end
#endif /* NSOBJECT+UTILITIES_H */
+20 -1
View File
@@ -1,6 +1,6 @@
/* NSObject+Utilities.m - this file is part of SOGo
*
* Copyright (C) 2007-2015 Inverse inc.
* Copyright (C) 2007-2018 Inverse inc.
*
* This file is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -24,6 +24,9 @@
#import <NGObjWeb/WOContext+SoObjects.h>
#import <NGObjWeb/WORequest.h>
#import <NGMime/NGMimeBodyPart.h>
#import <NGMime/NGMimeMultipartBody.h>
#import "NSDictionary+Utilities.h"
#import "SOGoUser.h"
#import "SOGoUserDefaults.h"
@@ -147,4 +150,20 @@
printf("Done!\n");
}
//
// Small hack to avoid SOPE's stupid behavior to wrap a multipart
// object in a NGMimeBodyPart.
//
- (NSArray *) parts
{
if ([self isKindOfClass: [NGMimeMultipartBody class]])
return [self parts];
if ([self isKindOfClass: [NGMimeBodyPart class]] &&
[[(id)self body] isKindOfClass: [NGMimeMultipartBody class]])
return [[(id)self body] parts];
return [NSArray array];
}
@end