NobGit
public nobgit read

NobMail

Based on mailcow: dockerized

Languages

Repository composition by tracked source files.

PHP
PHP 49% JavaScript 35% HTML 9% CSS 4% Shell 2% Python 1% Lua 0% Perl 0% Ruby 0% SCSS 0%
Create file Wiki Documentation
Clone
https://nobgit.com/orgs/nobgit/nobmail.git
ssh://[email protected]:2222/orgs/nobgit/nobmail.git

Commit

[Web] Fix PHPMailer, minor style change for quarantine rcpts

48b74d77
andryyy <[email protected]> 6 years ago
data/web/inc/ajax/qitem_details.php   | 4 ++--
 data/web/inc/ajax/transport_check.php | 3 +++
 data/web/inc/functions.inc.php        | 3 +++
 data/web/js/site/qhandler.js          | 2 +-
 data/web/js/site/quarantine.js        | 2 +-
 5 files changed, 10 insertions(+), 4 deletions(-)

Diff

diff --git a/data/web/inc/ajax/qitem_details.php b/data/web/inc/ajax/qitem_details.php
index 4a61232c..0ea89047 100644
--- a/data/web/inc/ajax/qitem_details.php
+++ b/data/web/inc/ajax/qitem_details.php
@@ -53,7 +53,7 @@ if (!empty($_GET['hash']) && ctype_alnum($_GET['hash'])) {
       addAddresses($recipientsList, $mail_parser, 'to');
       addAddresses($recipientsList, $mail_parser, 'cc');
       addAddresses($recipientsList, $mail_parser, 'bcc');
-      $recipientsList[] = array('address' => $mailc['rcpt'], 'type' => 'SMTP');
+      $recipientsList[] = array('address' => $mailc['rcpt'], 'type' => 'smtp');
       $data['recipients'] = $recipientsList;
     }
     // Get from
@@ -108,7 +108,7 @@ elseif (!empty($_GET['id']) && ctype_alnum($_GET['id'])) {
       addAddresses($recipientsList, $mail_parser, 'to');
       addAddresses($recipientsList, $mail_parser, 'cc');
       addAddresses($recipientsList, $mail_parser, 'bcc');
-      $recipientsList[] = array('address' => $mailc['rcpt'], 'type' => 'SMTP');
+      $recipientsList[] = array('address' => $mailc['rcpt'], 'type' => 'smtp');
       $data['recipients'] = $recipientsList;
     }
     // Get from
diff --git a/data/web/inc/ajax/transport_check.php b/data/web/inc/ajax/transport_check.php
index 3526e81b..b249e555 100644
--- a/data/web/inc/ajax/transport_check.php
+++ b/data/web/inc/ajax/transport_check.php
@@ -1,6 +1,9 @@
 <?php
 require_once $_SERVER['DOCUMENT_ROOT'] . '/inc/prerequisites.inc.php';
 require_once $_SERVER['DOCUMENT_ROOT'] . '/inc/vars.inc.php';
+use PHPMailer\PHPMailer\PHPMailer;
+use PHPMailer\PHPMailer\SMTP;
+use PHPMailer\PHPMailer\Exception;
 
 error_reporting(0);
 if (isset($_SESSION['mailcow_cc_role']) && $_SESSION['mailcow_cc_role'] == "admin") {
diff --git a/data/web/inc/functions.inc.php b/data/web/inc/functions.inc.php
index 6848a0dd..dabe6d6a 100644
--- a/data/web/inc/functions.inc.php
+++ b/data/web/inc/functions.inc.php
@@ -1,4 +1,7 @@
 <?php
+use PHPMailer\PHPMailer\PHPMailer;
+use PHPMailer\PHPMailer\SMTP;
+use PHPMailer\PHPMailer\Exception;
 function is_valid_regex($exp) {
   return @preg_match($exp, '') !== false;
 }
diff --git a/data/web/js/site/qhandler.js b/data/web/js/site/qhandler.js
index 5253e6db..c6851fdd 100644
--- a/data/web/js/site/qhandler.js
+++ b/data/web/js/site/qhandler.js
@@ -43,7 +43,7 @@ jQuery(function($){
       if (typeof data.recipients !== 'undefined') {
         $.each(data.recipients, function(index, value) {
           var elem = $('<span class="mail-address-item"></span>');
-          elem.text(value.address + (value.type != 'to' ? (' (' + value.type.toUpperCase() + ')') : ''));
+          elem.text(value.address + ' (' + value.type.toUpperCase() + ')');
           $('#qid_detail_recipients').append(elem);
         });
       }
diff --git a/data/web/js/site/quarantine.js b/data/web/js/site/quarantine.js
index af871dec..a4606645 100644
--- a/data/web/js/site/quarantine.js
+++ b/data/web/js/site/quarantine.js
@@ -174,7 +174,7 @@ jQuery(function($){
         if (typeof data.recipients !== 'undefined') {
           $.each(data.recipients, function(index, value) {
             var elem = $('<span class="mail-address-item"></span>');
-            elem.text(value.address + (value.type != 'to' ? (' (' + value.type.toUpperCase() + ')') : ''));
+            elem.text(value.address + ' (' + value.type.toUpperCase() + ')');
             $('#qid_detail_recipients').append(elem);
           });
         }