Changeset 6682 for branches/2.4


Ignore:
Timestamp:
06/29/12 11:45:31 (12 years ago)
Author:
eduardow
Message:

Ticket #2917 - Confirmação de leitura não está funcionando no Outlook.

Location:
branches/2.4/expressoMail1_2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2.4/expressoMail1_2/inc/class.imap_functions.inc.php

    r6636 r6682  
    11401140            //$return['signature']      = $return_get_body['signature']; 
    11411141                } 
    1142                 $pattern = '/^[ \t]*Disposition-Notification-To:[ ]*<?[[:alnum:]\._-]+@[[:alnum:]_-]+[\.[:alnum:]]+>?/sm'; 
     1142                 
     1143                $pattern = '/^[ \t]*Disposition-Notification-To:.*/mi'; 
    11431144                if (preg_match($pattern, $header_, $fields)) 
    1144                 { 
    1145                         if(preg_match('/[[:alnum:]\._\-]+@[[:alnum:]_\-\.]+/',$fields[0], $matches)){  
    1146                                 $return['DispositionNotificationTo'] = "<".$matches[0].">";  
    1147                         }  
    1148                 } 
     1145                $return['DispositionNotificationTo'] = base64_encode(trim(str_ireplace('Disposition-Notification-To:', '', $fields[0]))); 
    11491146 
    11501147                $return['Recent']       = $header->Recent; 
     
    28142811            $header = $this->get_header($msg_numb); 
    28152812            $header_ = imap_fetchheader($this->mbox, $msg_numb, FT_UID); 
    2816             $pattern = '/^[ \t]*Disposition-Notification-To:[ ]*<?[[:alnum:]\._-]+@[[:alnum:]_-]+[\.[:alnum:]]+>?/sm'; 
    2817             if (preg_match($pattern, $header_, $fields)) { 
    2818                 if (preg_match('/[[:alnum:]\._\-]+@[[:alnum:]_\-\.]+/', $fields[0], $matches)) { 
    2819                     $return['DispositionNotificationTo'] = "<" . $matches[0] . ">"; 
    2820                 } 
    2821             } 
     2813            $pattern = '/^[ \t]*Disposition-Notification-To:.*/mi';  
     2814                        if (preg_match($pattern, $header_, $fields))  
     2815                                $return['DispositionNotificationTo'] = base64_encode(trim(str_ireplace('Disposition-Notification-To:', '', $fields[0]))); 
    28222816 
    28232817            $message_id = $header->message_id; 
     
    38453839        } 
    38463840 
    3847         function send_notification($params){ 
    3848                 include("../header.inc.php"); 
    3849                 require_once("class.phpmailer.php"); 
    3850                 $mail = new PHPMailer(); 
    3851  
    3852                 $toaddress = $params['notificationto']; 
    3853  
    3854                 $subject = lang("Read receipt: %1",$params['subject']); 
     3841        function send_notification($params)  
     3842        {  
     3843                $mailService = ServiceLocator::getService('mail'); 
    38553844                $body = lang("Your message: %1",$params['subject']) . '<br>'; 
    38563845                $body .= lang("Received in: %1",date("d/m/Y H:i",$params['date'])) . '<br>'; 
    38573846                $body .= lang("Has been read by: %1 &lt; %2 &gt; at %3", $_SESSION['phpgw_info']['expressomail']['user']['fullname'], $_SESSION['phpgw_info']['expressomail']['user']['email'], date("d/m/Y H:i")); 
    3858                 $mail->SMTPDebug = false; 
    3859                 $mail->IsSMTP(); 
    3860                 $mail->Host = $_SESSION['phpgw_info']['expressomail']['email_server']['smtpServer']; 
    3861                 $mail->Port = $_SESSION['phpgw_info']['expressomail']['email_server']['smtpPort']; 
    3862                 $mail->From = $_SESSION['phpgw_info']['expressomail']['user']['email']; 
    3863                 $mail->FromName = $_SESSION['phpgw_info']['expressomail']['user']['fullname']; 
    3864                 $mail->AddAddress($toaddress); 
    3865                 $mail->Subject = $this->htmlspecialchars_decode($subject); 
    3866  
    3867                 $mail->IsHTML(true); 
    3868                 $mail->Body = $body; 
    3869  
    3870                 if(!$mail->Send()){ 
    3871                         return $mail->ErrorInfo; 
    3872                 } 
    3873                 else 
    3874                         return true; 
     3847                return $mailService->sendMail(base64_decode($params['notificationto']),   
     3848                                                           $_SESSION['phpgw_info']['expressomail']['user']['email'],   
     3849                                                           $this->htmlspecialchars_decode(lang("Read receipt: %1",$params['subject'])),   
     3850                                                           $body); 
     3851 
    38753852        } 
    38763853 
  • branches/2.4/expressoMail1_2/js/main.js

    r6643 r6682  
    475475                         } 
    476476                        for (var i = 0; i < domains.length; i++) 
    477                                 if (msg_info.DispositionNotificationTo.match(domains[i]+">")) 
     477                                if (Base64.decode(msg_info.DispositionNotificationTo).match("@"+domains[i])) 
    478478                                { 
    479479                                        var confNotification = true; 
     
    481481                                } 
    482482                                if (confNotification == undefined) 
    483                                         var confNotification = confirm(get_lang("The sender:\n%1\nwaits your notification of reading. Do you want to confirm this?",msg_info.DispositionNotificationTo), ""); 
     483                                        var confNotification = confirm(get_lang("The sender:\n%1\nwaits your notification of reading. Do you want to confirm this?",Base64.decode(msg_info.DispositionNotificationTo)), ""); 
    484484 
    485485                        if (confNotification) 
Note: See TracChangeset for help on using the changeset viewer.