From 1c20c1ead3094ca109a5334fdf33726a0e638365 Mon Sep 17 00:00:00 2001 From: Hivert Quentin Date: Thu, 12 Sep 2024 10:49:15 +0200 Subject: [PATCH] feat(sieve): add from on notificatons --- SoObjects/SOGo/SOGoSieveManager.m | 6 ++---- .../js/Preferences/PreferencesController.js | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/SoObjects/SOGo/SOGoSieveManager.m b/SoObjects/SOGo/SOGoSieveManager.m index beaf108b2..2b2962cc0 100644 --- a/SoObjects/SOGo/SOGoSieveManager.m +++ b/SoObjects/SOGo/SOGoSieveManager.m @@ -1243,12 +1243,10 @@ static NSString *sieveScriptName = @"sogo"; if (v && [v length] > 0) { notify = @"if header :matches \"subject\" \"*\" {\r\n set \"subject\" \"${1}\";\r\n}\r\n"; + notify = [notify stringByAppendingString: @"if header :matches \"From\" \"*<*>\" {\r\n set \"from\" \"${1} ${2}\";\r\n}\r\n"]; notify = [notify stringByAppendingFormat: @"set :encodeurl \"body_param\" \"%@\";\r\n", message]; - notify = [notify stringByAppendingFormat: @"notify :message \"%@: ${subject}\" \"mailto:%@?body=${body_param}\";\r\n", notificationTranslated, v]; + notify = [notify stringByAppendingFormat: @"notify :message \"%@: '${subject}' from: ${from}\" \"mailto:%@?body=${body_param}\";\r\n", notificationTranslated, v]; - // if (alwaysSend) - // [script insertString: notify atIndex: 0]; - // else [script appendString: notify]; } } diff --git a/UI/WebServerResources/js/Preferences/PreferencesController.js b/UI/WebServerResources/js/Preferences/PreferencesController.js index 890c1f5c4..330d65b58 100644 --- a/UI/WebServerResources/js/Preferences/PreferencesController.js +++ b/UI/WebServerResources/js/Preferences/PreferencesController.js @@ -22,7 +22,7 @@ this.emailSeparatorKeys = Preferences.defaults.emailSeparatorKeys; if(this.preferences.defaults.Notification) { if (!this.preferences.defaults.Notification.notificationMessage) - this.preferences.defaults.Notification.notificationMessage = l('Notification Message', $window.defaultEmailAddresses); + this.preferences.defaults.Notification.notificationMessage = l('Notification Message', $window.defaultEmailAddresses[0]); this.preferences.defaults.Notification.notificationTranslated = l('Notification'); } if (Preferences.defaults.SOGoMailAutoMarkAsReadMode == 'delay')