From 57674195543efb18ebf01f1c3a77ab3f9e6f5281 Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Thu, 11 Jan 2018 11:10:35 -0500 Subject: [PATCH] (fix) find the proper container (fixes #4371) --- SoObjects/Mailer/SOGoMailBodyPart.m | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/SoObjects/Mailer/SOGoMailBodyPart.m b/SoObjects/Mailer/SOGoMailBodyPart.m index 5cb01b106..1cc1d485d 100644 --- a/SoObjects/Mailer/SOGoMailBodyPart.m +++ b/SoObjects/Mailer/SOGoMailBodyPart.m @@ -292,7 +292,16 @@ static BOOL debugOn = NO; - (NSData *) fetchBLOB { - if ([[self container] isEncrypted]) + id o; + + // We check if the associated SOGoMailObject is encrypted, we must navigate + // in the container list until we find the proper container. + o = [self container]; + + while (![o isKindOfClass: [SOGoMailObject class]]) + o = [o container]; + + if ([o isEncrypted]) { NSData *certificate;