diff --git a/SoObjects/SOGo/SOGoSieveManager.m b/SoObjects/SOGo/SOGoSieveManager.m index 9e41f9b63..687cdc1e1 100644 --- a/SoObjects/SOGo/SOGoSieveManager.m +++ b/SoObjects/SOGo/SOGoSieveManager.m @@ -1220,7 +1220,7 @@ static NSString *sieveScriptName = @"sogo"; { // BOOL alwaysSend; NSString *notify; - NSString *message; + NSString *message, *notificationTranslated; id addresses; int i; @@ -1228,19 +1228,23 @@ static NSString *sieveScriptName = @"sogo"; b = YES; [req addObjectUniquely: @"enotify"]; + [req addObjectUniquely: @"variables"]; addresses = [values objectForKey: @"notificationAddress"]; if ([addresses isKindOfClass: [NSString class]]) addresses = [addresses componentsSeparatedByString: @","]; message = [values objectForKey: @"notificationMessage"]; + notificationTranslated = [values objectForKey: @"notificationTranslated"]; for (i = 0; i < [addresses count]; i++) { v = [addresses objectAtIndex: i]; if (v && [v length] > 0) { - notify = [NSString stringWithFormat: @"notify :message \"%@\"\r\n \"mailto:%@\";\r\n", message, v]; + notify = @"if header :matches \"subject\" \"*\" {\r\n set \"subject\" \"${1}\";\r\n}\r\n"; + notify = [notify stringByAppendingFormat: @"set :encodeurl \"body_param\" \"%@\";\r\n", message]; + notify = [notify stringByAppendingFormat: @"notify :message \"%@: ${subject}\" \"mailto:%@\";\r\n", notificationTranslated, v]; // if (alwaysSend) // [script insertString: notify atIndex: 0]; diff --git a/UI/PreferencesUI/English.lproj/Localizable.strings b/UI/PreferencesUI/English.lproj/Localizable.strings index 542c39896..6db3ecc84 100644 --- a/UI/PreferencesUI/English.lproj/Localizable.strings +++ b/UI/PreferencesUI/English.lproj/Localizable.strings @@ -24,6 +24,7 @@ "Vacation" = "Vacation"; "Forward" = "Forward"; "Password" = "Password"; +"Notification" = "Notification"; "Categories" = "Categories"; "Appointments invitations" = "Appointments invitations"; "Name" = "Name"; diff --git a/UI/PreferencesUI/French.lproj/Localizable.strings b/UI/PreferencesUI/French.lproj/Localizable.strings index dc4db8c84..f65eed049 100644 --- a/UI/PreferencesUI/French.lproj/Localizable.strings +++ b/UI/PreferencesUI/French.lproj/Localizable.strings @@ -23,6 +23,7 @@ "IMAP Accounts" = "Comptes IMAP"; "Vacation" = "Absence prolongée"; "Forward" = "Transfert"; +"Notification" = "Notification"; "Password" = "Mot de passe"; "Categories" = "Catégories"; "Appointments invitations" = "Invitations"; diff --git a/UI/WebServerResources/js/Preferences/PreferencesController.js b/UI/WebServerResources/js/Preferences/PreferencesController.js index badaa22e8..b4639aafb 100644 --- a/UI/WebServerResources/js/Preferences/PreferencesController.js +++ b/UI/WebServerResources/js/Preferences/PreferencesController.js @@ -22,6 +22,7 @@ this.emailSeparatorKeys = Preferences.defaults.emailSeparatorKeys; if (!Preferences.defaults.Notification.notificationMessage) this.preferences.defaults.Notification.notificationMessage = l('Notification Message', $window.defaultEmailAddresses); + this.preferences.defaults.Notification.notificationTranslated = l('Notification'); if (Preferences.defaults.SOGoMailAutoMarkAsReadMode == 'delay') this.mailAutoMarkAsReadDelay = Math.max(1, this.preferences.defaults.SOGoMailAutoMarkAsReadDelay); else