diff --git a/data/conf/rspamd/lua/rspamd.local.lua b/data/conf/rspamd/lua/rspamd.local.lua
index 4e6dc27fd..75dbe8514 100644
--- a/data/conf/rspamd/lua/rspamd.local.lua
+++ b/data/conf/rspamd/lua/rspamd.local.lua
@@ -31,7 +31,7 @@ rspamd_config:register_symbol({
local wants_subject_tag = task:get_symbol("RCPT_WANTS_SUBJECT_TAG")
- if wants_subject_tag then
+ if wants_subject_tag == 1 then
rspamd_logger.infox("user wants subject modified for tagged mail")
local sbj = task:get_header('Subject')
new_sbj = '=?UTF-8?B?' .. tostring(util.encode_base64('[' .. tag .. '] ' .. sbj)) .. '?='
@@ -39,7 +39,7 @@ rspamd_config:register_symbol({
remove_headers = {['Subject'] = 1},
add_headers = {['Subject'] = new_sbj}
})
- else
+ elseif wants_subject_tag == 2 then
rspamd_logger.infox("Add X-Moo-Tag header")
task:set_milter_reply({
add_headers = {['X-Moo-Tag'] = 'YES'}
diff --git a/data/web/inc/functions.mailbox.inc.php b/data/web/inc/functions.mailbox.inc.php
index 654f8972d..db63f5fb7 100644
--- a/data/web/inc/functions.mailbox.inc.php
+++ b/data/web/inc/functions.mailbox.inc.php
@@ -1287,6 +1287,18 @@ function mailbox($_action, $_type, $_data = null, $attr = null) {
return false;
}
}
+ else if (isset($_data['tagged_mail_handler']) && $_data['tagged_mail_handler'] == "subfolder") {
+ try {
+ $redis->hSet('RCPT_WANTS_SUBJECT_TAG', $username, 2);
+ }
+ catch (RedisException $e) {
+ $_SESSION['return'] = array(
+ 'type' => 'danger',
+ 'msg' => 'Redis: '.$e
+ );
+ return false;
+ }
+ }
else {
try {
$redis->hDel('RCPT_WANTS_SUBJECT_TAG', $username);
@@ -2599,12 +2611,16 @@ function mailbox($_action, $_type, $_data = null, $attr = null) {
$_data = $_SESSION['mailcow_cc_username'];
}
try {
- if ($redis->hGet('RCPT_WANTS_SUBJECT_TAG', $_data)) {
+ $wants_subject_tag = $redis->hGet('RCPT_WANTS_SUBJECT_TAG', $_data);
+ if ($wants_subject_tag == 1) {
return "subject";
}
- else {
+ elseif ($wants_subject_tag == 2) {
return "subfolder";
}
+ else {
+ return "none";
+ }
}
catch (RedisException $e) {
$_SESSION['return'] = array(
@@ -3685,4 +3701,4 @@ function mailbox($_action, $_type, $_data = null, $attr = null) {
}
break;
}
-}
\ No newline at end of file
+}
diff --git a/data/web/lang/lang.de.php b/data/web/lang/lang.de.php
index 2dd5cd9e0..f176647ed 100644
--- a/data/web/lang/lang.de.php
+++ b/data/web/lang/lang.de.php
@@ -174,6 +174,7 @@ $lang['user']['misc_delete_profile'] = 'Sonstige Kontoeinstellungen';
$lang['user']['tag_handling'] = 'Umgang mit getaggten E-Mails steuern';
$lang['user']['tag_in_subfolder'] = 'In Unterordner';
$lang['user']['tag_in_subject'] = 'In Betreff';
+$lang['user']['tag_in_none'] = 'Nichts tun';
$lang['user']['tag_help_explain'] = 'Als Unterordner: Es wird ein Ordner mit dem Namen des Tags unterhalb der Inbox erstellt ("INBOX/Facebook").
In Betreff: Der Name des Tags wird dem Betreff angefügt, etwa "[Facebook] Meine Neuigkeiten".';
$lang['user']['tag_help_example'] = 'Beispiel für eine getaggte E-Mail-Adresse: ich+Facebook@example.org';
@@ -559,4 +560,4 @@ $lang['admin']['reset_default'] = "Auf Standard zurücksetzen";
$lang['admin']['merged_vars_hint'] = 'Ausgegraute Zeilen wurden aus der Datei vars.inc.(local.)php
gelesen und können nicht mittels UI verändert werden.';
$lang['mailbox']['waiting'] = "Wartend";
$lang['mailbox']['status'] = "Status";
-$lang['mailbox']['running'] = "In Ausführung";
\ No newline at end of file
+$lang['mailbox']['running'] = "In Ausführung";
diff --git a/data/web/lang/lang.en.php b/data/web/lang/lang.en.php
index f99458e90..5e2959dc0 100644
--- a/data/web/lang/lang.en.php
+++ b/data/web/lang/lang.en.php
@@ -173,6 +173,7 @@ $lang['user']['misc_delete_profile'] = 'Other profile settings';
$lang['user']['tag_handling'] = 'Set handling for tagged mail';
$lang['user']['tag_in_subfolder'] = 'In subfolder';
$lang['user']['tag_in_subject'] = 'In subject';
+$lang['user']['tag_in_none'] = 'Do nothing';
$lang['user']['tag_help_explain'] = 'In subfolder: a new subfolder named after the tag will be created below INBOX ("INBOX/Facebook").
In subject: the tags name will be prepended to the mails subject, example: "[Facebook] My News".';
$lang['user']['tag_help_example'] = 'Example for a tagged email address: me+Facebook@example.org';
diff --git a/data/web/lang/lang.es.php b/data/web/lang/lang.es.php
index cb268a691..3cc93bdbb 100644
--- a/data/web/lang/lang.es.php
+++ b/data/web/lang/lang.es.php
@@ -144,6 +144,7 @@ $lang['user']['misc_delete_profile'] = 'Otras configuraciones de usuario';
$lang['user']['tag_handling'] = 'Establecer manejo para el correo etiquetado';
$lang['user']['tag_in_subfolder'] = 'En subcarpeta';
$lang['user']['tag_in_subject'] = 'En asunto';
+$lang['user']['tag_in_none'] = 'Hacer nada';
$lang['user']['tag_help_explain'] = 'En subcarpeta: una nueva subcarpeta llamada como la etiqueta será creada debajo de INBOX ("INBOX/Facebook").
En asunto: los nombres de las etiquetas serán añadidos al asunto de los correos, ejemplo: "[Facebook] Mis Noticias".';
$lang['user']['tag_help_example'] = 'Ejemplo de una dirección email etiquetada: mi+Facebook@ejemplo.org';
diff --git a/data/web/lang/lang.fr.php b/data/web/lang/lang.fr.php
index e89d6e55e..afa04f3b4 100644
--- a/data/web/lang/lang.fr.php
+++ b/data/web/lang/lang.fr.php
@@ -167,6 +167,7 @@ $lang['user']['misc_delete_profile'] = "Autre paramètres de profil";
$lang['user']['tag_handling'] = "Définir la gestion des courriel étiquetés";
$lang['user']['tag_in_subfolder'] = "Dans un sous-dossier";
$lang['user']['tag_in_subject'] = "Dans l'objet";
+$lang['user']['tag_in_none'] = "Ne fais rien";
$lang['user']['tag_help_explain'] = "Dans un sous-dossier : a nouveau sous-dossier portant le nom de l'étiquette sera crée sous INBOX (\"INBOX/Facebook\").
Dans l'objet : le nom de l'étiquette sera accolé à l'objet du courriel. Par exemple : \"[Facebook] Mes Nouvelles\".";
$lang['user']['tag_help_example'] = "Exemple pour une adresse de courriel étiquetée : moi+Facebook@exemple.org";
$lang['user']['eas_reset'] = "Réinitialiser le cache de l'appareil ActiveSync";
diff --git a/data/web/lang/lang.it.php b/data/web/lang/lang.it.php
index 5a91e1eda..d9b03e8a7 100644
--- a/data/web/lang/lang.it.php
+++ b/data/web/lang/lang.it.php
@@ -167,6 +167,7 @@ $lang['user']['misc_delete_profile'] = 'Impostazioni di altri profili';
$lang['user']['tag_handling'] = 'Imposta le gestione della mail evidenziate';
$lang['user']['tag_in_subfolder'] = 'Nella sotto cartella';
$lang['user']['tag_in_subject'] = 'Nell\'oggetto';
+$lang['user']['tag_in_none'] = "Fare niente";
$lang['user']['tag_help_explain'] = 'In sotto cartelle: Una nuova cartella dal nome del tag verrà creata sotto INBOX ("INBOX/Facebook").
Nell\'oggetto: Il nome del tag verrà aggiunto all\'inizio dell\'oggetto mail, esempio: "[Facebook] Meine Neuigkeiten".';
$lang['user']['tag_help_example'] = 'Esempio di mail con tag: ich+Facebook@example.org';
diff --git a/data/web/lang/lang.nl.php b/data/web/lang/lang.nl.php
index 88a936e14..415d271fd 100644
--- a/data/web/lang/lang.nl.php
+++ b/data/web/lang/lang.nl.php
@@ -140,6 +140,7 @@ $lang['user']['misc_delete_profile'] = 'Andere profielinstellingen';
$lang['user']['tag_handling'] = 'Omgaan met e-mail tags';
$lang['user']['tag_in_subfolder'] = 'In onderliggende map';
$lang['user']['tag_in_subject'] = 'In onderwerp';
+$lang['user']['tag_in_none'] = 'Niets doen';
$lang['user']['tag_help_explain'] = 'In onderliggende map: maakt onder INBOX een nieuwe map aan met de naam van de tag (bijv.: "INBOX/Facebook").
In onderwerp: de tag wordt vóór het oorspronkelijke e-mail onderwerp geplaatst (bijv.: "[Facebook] Mijn nieuws").';
$lang['user']['tag_help_example'] = 'Voorbeeld van een e-mailadres met tag: ik+Facebook@voorbeeld.org';
diff --git a/data/web/lang/lang.pl.php b/data/web/lang/lang.pl.php
index 423e0843e..497fe42bc 100644
--- a/data/web/lang/lang.pl.php
+++ b/data/web/lang/lang.pl.php
@@ -169,6 +169,7 @@ $lang['user']['misc_delete_profile'] = 'Ustawienia innego profilu';
$lang['user']['tag_handling'] = 'Ustaw obsługę znaczników pocztowych';
$lang['user']['tag_in_subfolder'] = 'W podfolderze';
$lang['user']['tag_in_subject'] = 'W temacie';
+$lang['user']['tag_in_none'] = 'Nic nie robić';
$lang['user']['tag_help_explain'] = 'W podfolderze: tworzy nowy podfolder z nazwą taką jak etykieta, który zostanie umieszczony pod Skrzynką odbiorczą ("Skrzynka odbiorcza/Facebook").
W temacie: nazwy etykiet zostaną dodane na początku tematów wiadomości, np.: "[Facebook] Moje wiadomości".';
$lang['user']['tag_help_example'] = 'Przykład adresu email z etykietą: ja+Facebook@example.org';
diff --git a/data/web/lang/lang.ru.php b/data/web/lang/lang.ru.php
index 3eaec801d..647fcb8bf 100644
--- a/data/web/lang/lang.ru.php
+++ b/data/web/lang/lang.ru.php
@@ -167,6 +167,7 @@ $lang['user']['misc_delete_profile'] = 'Другие настройки проф
$lang['user']['tag_handling'] = 'Set handling for tagged mail';
$lang['user']['tag_in_subfolder'] = 'В подпапку';
$lang['user']['tag_in_subject'] = 'В теме';
+$lang['user']['tag_in_none'] = 'Ничего не делать';
$lang['user']['tag_help_explain'] = 'In subfolder: a new subfolder named after the tag will be created below INBOX ("INBOX/Facebook").
In subject: the tags name will be prepended to the mails subject, example: "[Facebook] Meine Neuigkeiten".';
$lang['user']['tag_help_example'] = 'Example for a tagged email address: ich+Facebook@example.org';
diff --git a/data/web/user.php b/data/web/user.php
index 5c5d6720c..93d84a2a6 100644
--- a/data/web/user.php
+++ b/data/web/user.php
@@ -171,6 +171,13 @@ elseif (isset($_SESSION['mailcow_cc_role']) && $_SESSION['mailcow_cc_role'] == '
data-api-url='edit/delimiter_action'
data-api-attr='{"tagged_mail_handler":"subject"}'>=$lang['user']['tag_in_subject'];?>
+
+
=$lang['user']['tag_help_explain'];?>
=$lang['user']['tag_help_example'];?>