From d06dcc6770121b401c4d6e0b60b634d4c7355ebc Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Wed, 7 Jun 2017 12:09:33 +0200 Subject: [PATCH] Copy to ham folder if only ham folder is set and spamTitan is not configured --- mail/inc/class.mail_ui.inc.php | 2 +- mail/js/app.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mail/inc/class.mail_ui.inc.php b/mail/inc/class.mail_ui.inc.php index acd8db55e9..8f95d81a0f 100644 --- a/mail/inc/class.mail_ui.inc.php +++ b/mail/inc/class.mail_ui.inc.php @@ -921,7 +921,7 @@ class mail_ui ), 'move'); break; case 'ham': - if ($ham) + if (isset($this->mail_bo->icServer->acc_folder_ham) && !isset($this->mail_bo->icServer->acc_spam_api)) { $this->ajax_copyMessages($ham, array( 'all' => false, diff --git a/mail/js/app.js b/mail/js/app.js index 95059ad92d..62e7768d28 100644 --- a/mail/js/app.js +++ b/mail/js/app.js @@ -5498,7 +5498,7 @@ app.classes.mail = AppJS.extend( } var data = egw.dataGetUIDdata(id); var fromaddress = data.data.fromaddress.match(/<([^\'\" <>]+)>$/); - var email = fromaddress[1]?fromaddress[1]:fromaddress; + var email = (fromaddress && fromaddress[1])?fromaddress[1]:data.data.fromaddress; var domain = '@'+email.split('@')[1]; this.egw.json('mail.mail_ui.ajax_spamAction', [ _action.id, @@ -5516,7 +5516,7 @@ app.classes.mail = AppJS.extend( var id = _sender[0].id; var data = egw.dataGetUIDdata(id); var fromaddress = data.data.fromaddress.match(/<([^\'\" <>]+)>$/); - var email = fromaddress[1]?fromaddress[1]:fromaddress; + var email = (fromaddress && fromaddress[1]) ?fromaddress[1]:data.data.fromaddress; var domain = email.split('@')[1]; switch (_action.id) {