浏览代码

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

andryyy 5 年之前
父节点
当前提交
48b74d77a0

+ 2 - 2
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

+ 3 - 0
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") {

+ 3 - 0
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;
 }

+ 1 - 1
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);
         });
       }

+ 1 - 1
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);
           });
         }