Changeset 877


Ignore:
Timestamp:
05/20/09 14:57:26 (15 years ago)
Author:
wmerlotto
Message:

Ticket #511 - Adicionados atributos que podem ser repassados para script externo que executa chamada ao anti-spam

File:
1 edited

Legend:

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

    r872 r877  
    28042804 
    28052805                foreach($msgs_number as $msg_number) { 
    2806                         $header = imap_fetchheader($mbox_stream, imap_msgno($mbox_stream, $msg_number)); 
    2807                         $body = imap_body($mbox_stream, imap_msgno($mbox_stream, $msg_number)); 
     2806                        $imap_msg_number = imap_msgno($mbox_stream, $msg_number); 
     2807                        $header = imap_fetchheader($mbox_stream, $imap_msg_number); 
     2808                        $body = imap_body($mbox_stream, $imap_msg_number); 
    28082809                        $msg = $header . $body; 
    28092810                        $email = $_SESSION['phpgw_info']['expressomail']['user']['email']; 
     
    28152816                        $v = explode("\r\n", $header); 
    28162817                        foreach ($v as $linha){ 
    2817                                 if (eregi("^X-DSPAM-Signature", $linha)) { 
    2818                                          
     2818                                if (eregi("^Message-ID", $linha)) { 
     2819                                        $args = explode(" ", $linha); 
     2820                                        $msg_id = "'$args[1]'"; 
     2821                                } elseif (eregi("^X-DSPAM-Signature", $linha)) { 
    28192822                                        $args = explode(" ",$linha); 
    28202823                                        $signature = $args[1]; 
     
    28222825                        } 
    28232826 
    2824                         // feed dspam 
     2827                        // Seleciona qual comando a ser executado 
    28252828                        switch($is_spam){ 
    28262829                                case 'true':  $cmd = $_SESSION['phpgw_info']['server']['expressomail']['expressoMail_command_for_spam']; break; 
    28272830                                case 'false': $cmd = $_SESSION['phpgw_info']['server']['expressomail']['expressoMail_command_for_ham']; break; 
    28282831                        } 
    2829                         $tags = array('##EMAIL##', '##USERNAME##', '##DOMAIN##', '##SIGNATURE##'); 
    2830                         $cmd = str_replace($tags,array($email,$username,$domain,$signature),$cmd); 
     2832 
     2833                        $tags = array('##EMAIL##', '##USERNAME##', '##DOMAIN##', '##SIGNATURE##', '##MSGID##'); 
     2834                        $cmd = str_replace($tags, array($email, $username, $domain, $signature, $msg_id), $cmd); 
    28312835                        system($cmd); 
    28322836                } 
Note: See TracChangeset for help on using the changeset viewer.