1
0
mirror of https://github.com/mailcow/mailcow-dockerized.git synced 2025-07-15 01:34:16 +02:00

Merge pull request #915 from tiirex9/master

Adds 'do nothing' as default for sub-addressing
This commit is contained in:
André Peters
2018-01-18 10:27:14 +01:00
committed by GitHub
12 changed files with 44 additions and 4 deletions

View File

@ -1308,6 +1308,20 @@ function mailbox($_action, $_type, $_data = null, $attr = null) {
if (isset($_data['tagged_mail_handler']) && $_data['tagged_mail_handler'] == "subject") {
try {
$redis->hSet('RCPT_WANTS_SUBJECT_TAG', $username, 1);
$redis->hDel('RCPT_WANTS_SUBFOLDER_TAG', $username);
}
catch (RedisException $e) {
$_SESSION['return'] = array(
'type' => 'danger',
'msg' => 'Redis: '.$e
);
return false;
}
}
else if (isset($_data['tagged_mail_handler']) && $_data['tagged_mail_handler'] == "subfolder") {
try {
$redis->hSet('RCPT_WANTS_SUBFOLDER_TAG', $username, 1);
$redis->hDel('RCPT_WANTS_SUBJECT_TAG', $username);
}
catch (RedisException $e) {
$_SESSION['return'] = array(
@ -1320,6 +1334,7 @@ function mailbox($_action, $_type, $_data = null, $attr = null) {
else {
try {
$redis->hDel('RCPT_WANTS_SUBJECT_TAG', $username);
$redis->hDel('RCPT_WANTS_SUBFOLDER_TAG', $username);
}
catch (RedisException $e) {
$_SESSION['return'] = array(
@ -2632,9 +2647,12 @@ function mailbox($_action, $_type, $_data = null, $attr = null) {
if ($redis->hGet('RCPT_WANTS_SUBJECT_TAG', $_data)) {
return "subject";
}
else {
elseif ($redis->hGet('RCPT_WANTS_SUBFOLDER_TAG', $_data)) {
return "subfolder";
}
else {
return "none";
}
}
catch (RedisException $e) {
$_SESSION['return'] = array(
@ -3729,4 +3747,4 @@ function mailbox($_action, $_type, $_data = null, $attr = null) {
}
break;
}
}
}