From dd598259ed8a5b1ffd3851446910df2c9c37e9a3 Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Wed, 31 May 2017 18:10:32 +0200 Subject: [PATCH] WIP SpamTitan integration: - Get email body and send it to spamTitan action handler --- mail/inc/class.mail_ui.inc.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/mail/inc/class.mail_ui.inc.php b/mail/inc/class.mail_ui.inc.php index 259e23b885..18b958c2f5 100644 --- a/mail/inc/class.mail_ui.inc.php +++ b/mail/inc/class.mail_ui.inc.php @@ -889,12 +889,17 @@ class mail_ui $response = Api\Json\Response::get(); if ($GLOBALS['egw_info']['apps']['stylite']) { - $data = array_merge($_params, array( - 'userpwd' => $this->mail_bo->icServer['params']['acc_imap_password'], - 'user' => $this->mail_bo->icServer['params']['acc_imap_username'], - 'api_url' => $this->mail_bo->icServer['params']['acc_spam_api'] + $id_parts = self::splitRowID($_params['data']['row_id']); + if ($id_parts['profileID'] && $id_parts['profileID'] != $this->mail_bo->profileID) + { + $this->changeProfile($id_parts['profileID']); + } + $_params['mailbody'] = $this->get_load_email_data($_params['data']['uid'], null, $id_parts['folder']); + $msg[] = stylite_mail_spamtitan::execSpamTitanAction($_action, $_params, array( + 'userpwd' => $this->mail_bo->icServer->acc_imap_password, + 'user' => $this->mail_bo->icServer->acc_imap_username, + 'api_url' => $this->mail_bo->icServer->acc_spam_api )); - $msg[] = stylite_mail_spamtitan::execSpamTitanAction($_action, $_params, $data); } switch ($_action) {