From 93dff697e7aebe7ec95437b5f7b07a85f3a0bb06 Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Fri, 10 Dec 2021 14:33:10 -0500 Subject: [PATCH] fix(mail(web)): display emails extracted from smime certificate Fixes #5440 --- UI/MailPartViewers/UIxMailPartSignedViewer.h | 5 +++-- UI/MailPartViewers/UIxMailPartSignedViewer.m | 9 ++++++--- UI/Templates/MailerUI/UIxMailViewTemplate.wox | 7 +++++++ 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/UI/MailPartViewers/UIxMailPartSignedViewer.h b/UI/MailPartViewers/UIxMailPartSignedViewer.h index ec7e93e6e6..b9f8e25850 100644 --- a/UI/MailPartViewers/UIxMailPartSignedViewer.h +++ b/UI/MailPartViewers/UIxMailPartSignedViewer.h @@ -1,6 +1,6 @@ /* UIxMailPartSignedViewer.h - this file is part of SOGo * - * Copyright (C) 2009-2018 Inverse inc. + * Copyright (C) 2009-2021 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 @@ -38,7 +38,8 @@ - (NSString *) validationMessage; - (NSArray *) smimeCertificates; - (NSDictionary *) certificateForSubject: (NSString *) subject - andIssuer: (NSString *) issuer; + andIssuer: (NSString *) issuer + withEmails: (NSArray *) emails; @end diff --git a/UI/MailPartViewers/UIxMailPartSignedViewer.m b/UI/MailPartViewers/UIxMailPartSignedViewer.m index 6347040bee..0818c426bf 100644 --- a/UI/MailPartViewers/UIxMailPartSignedViewer.m +++ b/UI/MailPartViewers/UIxMailPartSignedViewer.m @@ -159,7 +159,8 @@ - (void) _processMessage BIO_free(buf); [certificates addObject: [self certificateForSubject: subject - andIssuer: issuer]]; + andIssuer: issuer + withEmails: emails]]; } } @@ -240,10 +241,12 @@ - (BOOL) validSignature - (NSDictionary *) certificateForSubject: (NSString *) subject andIssuer: (NSString *) issuer + withEmails: (NSArray *) emails { return [NSDictionary dictionaryWithObjectsAndKeys: - [subject componentsFromMultilineDN], @"subject", - [issuer componentsFromMultilineDN], @"issuer", + [subject componentsFromMultilineDN], @"subject", + [issuer componentsFromMultilineDN], @"issuer", + emails, @"emails", nil]; } diff --git a/UI/Templates/MailerUI/UIxMailViewTemplate.wox b/UI/Templates/MailerUI/UIxMailViewTemplate.wox index 41281015d1..dfe824ab94 100644 --- a/UI/Templates/MailerUI/UIxMailViewTemplate.wox +++ b/UI/Templates/MailerUI/UIxMailViewTemplate.wox @@ -275,6 +275,13 @@
+
+
+
+