feat(sieve): add from on notificatons

This commit is contained in:
Hivert Quentin
2024-09-12 10:49:15 +02:00
parent a7023bce16
commit 1c20c1ead3
2 changed files with 3 additions and 5 deletions
+2 -4
View File
@@ -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];
}
}
@@ -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')