Changeset 6673 for trunk


Ignore:
Timestamp:
06/28/12 15:18:46 (12 years ago)
Author:
cristiano
Message:

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

Location:
trunk/expressoMail1_2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/expressoMail1_2/inc/class.imap_functions.inc.php

    r6580 r6673  
    11391139            //$return['signature']      = $return_get_body['signature']; 
    11401140                } 
    1141                 $pattern = '/^[ \t]*Disposition-Notification-To:[ ]*<?[[:alnum:]\._-]+@[[:alnum:]_-]+[\.[:alnum:]]+>?/sm'; 
     1141 
     1142                $pattern = '/^[ \t]*Disposition-Notification-To:.*/mi'; 
    11421143                if (preg_match($pattern, $header_, $fields)) 
    1143                 { 
    1144                         if(preg_match('/[[:alnum:]\._\-]+@[[:alnum:]_\-\.]+/',$fields[0], $matches)){  
    1145                                 $return['DispositionNotificationTo'] = "<".$matches[0].">";  
    1146                         }  
    1147                 } 
     1144                        $return['DispositionNotificationTo'] = base64_encode(trim(str_ireplace('Disposition-Notification-To:', '', $fields[0])));  
    11481145 
    11491146                $return['Recent']       = $header->Recent; 
     
    28132810            $header = $this->get_header($msg_numb); 
    28142811            $header_ = imap_fetchheader($this->mbox, $msg_numb, FT_UID); 
    2815             $pattern = '/^[ \t]*Disposition-Notification-To:[ ]*<?[[:alnum:]\._-]+@[[:alnum:]_-]+[\.[:alnum:]]+>?/sm'; 
    2816             if (preg_match($pattern, $header_, $fields)) { 
    2817                 if (preg_match('/[[:alnum:]\._\-]+@[[:alnum:]_\-\.]+/', $fields[0], $matches)) { 
    2818                     $return['DispositionNotificationTo'] = "<" . $matches[0] . ">"; 
    2819                 } 
    2820             } 
     2812            $pattern = '/^[ \t]*Disposition-Notification-To:.*/mi'; 
     2813                        if (preg_match($pattern, $header_, $fields)) 
     2814                                $return['DispositionNotificationTo'] = base64_encode(trim(str_ireplace('Disposition-Notification-To:', '', $fields[0])));  
    28212815 
    28222816            $message_id = $header->message_id; 
     
    38373831        } 
    38383832 
    3839         function send_notification($params){ 
    3840                 include("../header.inc.php"); 
    3841                 require_once("class.phpmailer.php"); 
    3842                 $mail = new PHPMailer(); 
    3843  
    3844                 $toaddress = $params['notificationto']; 
    3845  
    3846                 $subject = lang("Read receipt: %1",$params['subject']); 
     3833        function send_notification($params) 
     3834        { 
     3835                $mailService = ServiceLocator::getService('mail');  
    38473836                $body = lang("Your message: %1",$params['subject']) . '<br>'; 
    38483837                $body .= lang("Received in: %1",date("d/m/Y H:i",$params['date'])) . '<br>'; 
    38493838                $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")); 
    3850                 $mail->SMTPDebug = false; 
    3851                 $mail->IsSMTP(); 
    3852                 $mail->Host = $_SESSION['phpgw_info']['expressomail']['email_server']['smtpServer']; 
    3853                 $mail->Port = $_SESSION['phpgw_info']['expressomail']['email_server']['smtpPort']; 
    3854                 $mail->From = $_SESSION['phpgw_info']['expressomail']['user']['email']; 
    3855                 $mail->FromName = $_SESSION['phpgw_info']['expressomail']['user']['fullname']; 
    3856                 $mail->AddAddress($toaddress); 
    3857                 $mail->Subject = $this->htmlspecialchars_decode($subject); 
    3858  
    3859                 $mail->IsHTML(true); 
    3860                 $mail->Body = $body; 
    3861  
    3862                 if(!$mail->Send()){ 
    3863                         return $mail->ErrorInfo; 
    3864                 } 
    3865                 else 
    3866                         return true; 
     3839                return $mailService->sendMail(base64_decode($params['notificationto']),  
     3840                                                           $_SESSION['phpgw_info']['expressomail']['user']['email'],  
     3841                                                           $this->htmlspecialchars_decode(lang("Read receipt: %1",$params['subject'])),  
     3842                                                           $body);  
     3843 
    38673844        } 
    38683845 
  • trunk/expressoMail1_2/js/main.js

    r6628 r6673  
    526526                         } 
    527527                        for (var i = 0; i < domains.length; i++) 
    528                                 if (msg_info.DispositionNotificationTo.match(domains[i]+">")) 
     528                                if (Base64.decode(msg_info.DispositionNotificationTo).match("@"+domains[i])) 
    529529                                { 
    530530                                        var confNotification = true; 
     
    532532                                } 
    533533                                if (confNotification == undefined) 
    534                                         var confNotification = confirm(get_lang("The sender:\n%1\nwaits your notification of reading. Do you want to confirm this?",msg_info.DispositionNotificationTo), ""); 
     534                                        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)), ""); 
    535535 
    536536                        if (confNotification) 
Note: See TracChangeset for help on using the changeset viewer.