Changeset 278


Ignore:
Timestamp:
04/30/08 18:46:18 (16 years ago)
Author:
wmerlotto
Message:

Correcao na forma como a assinatura (X-DSPAM-Signature) do DSPAM e identificada. Grato ao Eder Ruiz Maria.

File:
1 edited

Legend:

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

    r271 r278  
    22842284                        $msg = $header . $body; 
    22852285                        $email = $_SESSION['phpgw_info']['expressomail']['user']['email']; 
    2286                         //$tmp_file = $tmp_dir . "msg." . $email . '.'. $msg_number . time(); 
    2287                         // maybe we can get it faster with regex, don't know how :'( 
    2288                         $signature = trim(substr($header, strpos($header, 'X-DSPAM-Signature:') + 18)); 
     2286                        $username = $this->username; 
    22892287                        strtok($email, '@'); 
    22902288                        $domain = strtok('@'); 
    22912289 
     2290                        //Encontrar a assinatura do dspam no cabecalho 
     2291                        $v = explode("\r\n", $header); 
     2292                        foreach ($v as $linha){ 
     2293                                if (eregi("^X-DSPAM-Signature", $linha)) { 
     2294                                         
     2295                                        $args = explode(" ",$linha); 
     2296                                        $signature = $args[1]; 
     2297                                } 
     2298                        } 
     2299 
    22922300                        // feed dspam 
    2293                         if ($is_spam) 
    2294                                 $cmd = str_replace( 
    2295                                                         array('##EMAIL##', '##USERNAME##', '##DOMAIN##', '##SIGNATURE##'),  
    2296                                                         array($email, $this->username, $domain, $signature), $_SESSION['phpgw_info']['server']['expressomail']['expressoMail_command_for_spam'] 
    2297                                                 ); 
    2298                         else 
    2299                                 $cmd = str_replace( 
    2300                                                         array('##EMAIL##', '##USERNAME##', '##DOMAIN##', '##SIGNATURE##'), 
    2301                                                 array($email, $this->username, $domain, $signature), $_SESSION['phpgw_info']['server']['expressomail']['expressoMail_command_for_ham'] 
    2302                                         ); 
    2303                          
     2301                        switch($is_spam){ 
     2302                                case 'true':  $cmd = $_SESSION['phpgw_info']['server']['expressomail']['expressoMail_command_for_spam']; break; 
     2303                                case 'false': $cmd = $_SESSION['phpgw_info']['server']['expressomail']['expressoMail_command_for_ham']; break; 
     2304                        } 
     2305                        $tags = array('##EMAIL##', '##USERNAME##', '##DOMAIN##', '##SIGNATURE##'); 
     2306                        $cmd = str_replace($tags,array($email,$username,$domain,$signature),$cmd); 
    23042307                        system($cmd); 
    2305                          
    23062308                } 
    23072309                imap_close($mbox_stream); 
Note: See TracChangeset for help on using the changeset viewer.