diff --git a/Documentation/SOGoInstallationGuide.asciidoc b/Documentation/SOGoInstallationGuide.asciidoc index ad4fcbc89c..981436fda8 100644 --- a/Documentation/SOGoInstallationGuide.asciidoc +++ b/Documentation/SOGoInstallationGuide.asciidoc @@ -839,6 +839,9 @@ specified as an array of dictionaries. |S |SOGoURLEncryptionPassphrase |Passphrase for `SOGoURLEncryptionEnabled`. The string must be 128 bits (16 characters). If this settings change, the cache server must be restarted, and the DAV url will change. Default value is `SOGoSuperSecret0`. +|D |SOGoForceRawHtmlSignature +|Add `
` around signature to avoid CKEditor 5 modifying HTML code and breaking signature (https://bugs.sogo.nu/view.php?id=5920). Default value is `YES` (tag is added). + |======================================================================= @@ -3971,8 +3974,8 @@ current version of SOGo from the previous release. [cols="100a"] |======================================================================= -h|5.10.1 -|Parameters `SOGoGlobalAddressBookFirstEntries` and `SOGoGlobalAddressBookFirstEntriesCount` has been removed. Please use `listRequiresDot` and `globalAddressBookFirstEntriesCount` instead +h|5.11 +|Parameters `SOGoGlobalAddressBookFirstEntries` and `SOGoGlobalAddressBookFirstEntriesCount` has been removed. Please use `listRequiresDot` and `globalAddressBookFirstEntriesCount` instead. Signature are now between a div tag to avoid CKEditor changing the content - set `SOGoForceRawHtmlSignature` to `NO` to leave signature (https://bugs.sogo.nu/view.php?id=5920). h|5.9.0 |Run the shell script `sql-update-5.8.4_to_5.9.0.sh` (if you are using MySQL). This will change the `c_defaults` to `MEDIUMTEXT`. diff --git a/SoObjects/SOGo/SOGoDomainDefaults.h b/SoObjects/SOGo/SOGoDomainDefaults.h index 54d7524eca..f7bddceee7 100644 --- a/SoObjects/SOGo/SOGoDomainDefaults.h +++ b/SoObjects/SOGo/SOGoDomainDefaults.h @@ -102,6 +102,8 @@ - (NSString *) passwordRecoveryFrom; +- (BOOL) forceRawHtmlSignature; + @end #endif /* SOGODOMAINDEFAULTS_H */ diff --git a/SoObjects/SOGo/SOGoDomainDefaults.m b/SoObjects/SOGo/SOGoDomainDefaults.m index 2ec86124e7..c67e83b59d 100644 --- a/SoObjects/SOGo/SOGoDomainDefaults.m +++ b/SoObjects/SOGo/SOGoDomainDefaults.m @@ -465,4 +465,9 @@ - (NSString *) passwordRecoveryFrom return emailFrom; } +- (BOOL) forceRawHtmlSignature +{ + return [self objectForKey: @"SOGoForceRawHtmlSignature"] ? [self boolForKey: @"SOGoForceRawHtmlSignature"] : YES; +} + @end diff --git a/SoObjects/SOGo/SOGoUser.h b/SoObjects/SOGo/SOGoUser.h index ab43832a58..7460837ac0 100644 --- a/SoObjects/SOGo/SOGoUser.h +++ b/SoObjects/SOGo/SOGoUser.h @@ -113,6 +113,7 @@ - (unsigned int) weekNumberForDate: (NSCalendarDate *) date; - (NSArray *) mailAccounts; +- (NSArray *) mailAccountsNoRawHtmlSignature; - (NSArray *) mailAccountsWithDelegatedIdentities: (BOOL) appendDeletegatedIdentities; - (NSDictionary *) accountWithName: (NSString *) accountName; - (NSArray *) allIdentities; diff --git a/SoObjects/SOGo/SOGoUser.m b/SoObjects/SOGo/SOGoUser.m index fc224abaf4..f7047bacc3 100644 --- a/SoObjects/SOGo/SOGoUser.m +++ b/SoObjects/SOGo/SOGoUser.m @@ -1026,10 +1026,15 @@ - (void) _appendSystemMailAccountWithDelegatedIdentities: (BOOL) appendDeletegat - (NSArray *) mailAccounts { - return [self mailAccountsWithDelegatedIdentities: YES]; + return [self mailAccountsWithDelegatedIdentities: YES forceRawHtmlSignature: [[self domainDefaults] forceRawHtmlSignature]]; } -- (NSArray *) mailAccountsWithDelegatedIdentities: (BOOL) appendDeletegatedIdentities +- (NSArray *) mailAccountsNoRawHtmlSignature +{ + return [self mailAccountsWithDelegatedIdentities: YES forceRawHtmlSignature: NO]; +} + +- (NSArray *) mailAccountsWithDelegatedIdentities: (BOOL) appendDeletegatedIdentities forceRawHtmlSignature: (BOOL) forceRawHtmlSignature { NSArray *auxAccounts; @@ -1112,8 +1117,9 @@ - (NSArray *) mailAccountsWithDelegatedIdentities: (BOOL) appendDeletegatedIdent if ([tmpIdentity objectForKey: @"signature"] ) { // Add raw html embed class if ([[tmpIdentity objectForKey: @"signature"] rangeOfString:@"raw-html-embed"].location == NSNotFound - && [[[self userDefaults] mailComposeMessageType] isEqualToString: @"html"]) { - signature = [NSString stringWithFormat:@"
%@
", [tmpIdentity objectForKey: @"signature"]]; + && [[[self userDefaults] mailComposeMessageType] isEqualToString: @"html"] + && forceRawHtmlSignature) { + signature = [NSString stringWithFormat:@"
%@
", [tmpIdentity objectForKey: @"signature"]]; [tmpIdentity setObject:signature forKey:@"signature"]; } } diff --git a/UI/PreferencesUI/UIxJSONPreferences.m b/UI/PreferencesUI/UIxJSONPreferences.m index 9eca0cdf18..a2cfd3f1f6 100644 --- a/UI/PreferencesUI/UIxJSONPreferences.m +++ b/UI/PreferencesUI/UIxJSONPreferences.m @@ -516,7 +516,7 @@ - (NSString *) jsonDefaults } } // We inject our default mail account - account = [[[context activeUser] mailAccounts] objectAtIndex: 0]; + account = [[[context activeUser] mailAccountsNoRawHtmlSignature] objectAtIndex: 0]; if (![account objectForKey: @"receipts"]) { [account setObject: [NSDictionary dictionaryWithObjectsAndKeys: @"ignore", @"receiptAction", diff --git a/UI/WebServerResources/scss/views/MailerUI.scss b/UI/WebServerResources/scss/views/MailerUI.scss index 7253d037ff..a5108f8f82 100644 --- a/UI/WebServerResources/scss/views/MailerUI.scss +++ b/UI/WebServerResources/scss/views/MailerUI.scss @@ -428,4 +428,28 @@ md-dialog md-dialog-actions.sg-mail-editor-attachments { margin-left: unset!important; margin-right: unset!important; } + + .ck-widget.sogo-raw-html-embed:before { + display: none!important; + } + + .sogo-raw-html-embed .raw-html-embed__buttons-wrapper { + display: none !important; + } + + .ck-widget.sogo-raw-html-embed:not(.ck-widget_selected):not(:hover) { + outline: none!important; + } + + .ck-widget.sogo-raw-html-embed { + background-color: unset; + } + + .ck-widget.sogo-raw-html-embed .raw-html-embed__preview-content { + background-color: unset; + } + + .sogo-raw-html-embed .raw-html-embed__preview-placeholder { + display: none !important; + } } \ No newline at end of file