Changeset 4045 for extensions


Ignore:
Timestamp:
Oct 15, 2009, 4:36:45 PM (14 years ago)
Author:
cljosse
Message:

[mail_supervisor] Modification gestion reprise spam

Location:
extensions/Mail_supervisor
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • extensions/Mail_supervisor

    • Property svn:ignore set to
      _notes
  • extensions/Mail_supervisor/admin/mail_superv_admin.php

    r4041 r4045  
    272272 }
    273273//================================================================================
     274        if  ( $mails_données['reste'] < 0 ) {
     275            $mails_données['quarantaine'] =false ;
     276            $mails_données['date_quarantaine']= time()  ;       
     277                $mails_données['nb_spams'] = 0 ;
     278            $modif == true ;
     279        }
     280         
     281         
    274282        $rest_mail =    $mails_données['rest_mail'] ;
    275283        if ($rest_mail <=0 || $mails_données['nb_mails'] ==0 ){
  • extensions/Mail_supervisor/include

    • Property svn:ignore set to
      _notes
  • extensions/Mail_supervisor/include/fonctions.php

    r4041 r4045  
    181181function corrige_header($Carbonne,$headers)
    182182        {
    183         global $mails_options,$conf_mail,$mailto;
    184 
    185                 $splitter="|".$Carbonne.":(.*)\n|U";
    186                 preg_match_all($splitter,$headers, $out,PREG_PATTERN_ORDER);
    187                 $val=array();
    188                 $match=array("<",">");
    189                 $string=array("","") ;
    190                 foreach($out as $messages)
    191                 {
    192                 $val[]=  $messages[0] ;
    193                 }
    194  
    195 
    196         $val[1]=  str_replace( $match,$string,$val[0] ) ;
    197         $src=$val[0];
    198        
    199         $splitter="|\"(.*)\"|U";
    200         preg_match_all($splitter,$val[1], $out,PREG_PATTERN_ORDER);
    201         $string=array();
    202         $string = array_fill( 0, count($out), '');
    203         $dest = str_replace($out[0], $string, $val[1]) ;
    204  if ($mailto <>"" ) {   
    205          $dest=str_replace($mailto.',', '', $dest) ;
    206          $dest=str_replace($mailto, '', $dest) ;
    207        
    208 }
    209 
    210 
    211         $headers = str_replace( $src,$dest, $headers) ;
     183        global $mails_options,$conf_mail,$mailto,$args;
     184        $headers = preg_replace('/.*'.$Carbonne.'(.*).\n/i', $Carbonne.' : '.get_strict_email_list(implode(' , ', $args[$Carbonne]))."\n", $headers);
     185
    212186        return $headers;
    213187
  • extensions/Mail_supervisor/include/function_test_send.php

    r4044 r4045  
    7272        $args['Bcc']=$groups;
    7373        $args['from'] = $conf_mail['formated_email_webmaster'];
    74 
    75  
    76  
    7774        //==================================================================
    7875         $message_texte=sprintf(
     
    8380                $args['from']
    8481        );     
    85         $message_texte .=$message;     
    8682        //==================================================================
    87         $message_html=$message_texte;
    88 //      $message_html .=        '<img src="'.PHPWG_ROOT_PATH.'admin/template/goto/theme/roma/images/piwigo_logo_sombre_214x100.png" />';
    89          
     83        $message_html = $message_texte;
     84
    9085       
    9186 //==========================================================================
  • extensions/Mail_supervisor/language/fr_FR/plugin.lang.php

    r4044 r4045  
    8989$lang['message_texte %s %s %s %s'] ='
    9090 %s
    91          Bonjour  %s ,
     91              Bonjour   "%s"  ,
     92                 
    9293         %s
    9394       
    94           A bientot
    95           %s
     95         
     96            A bientot
     97         
     98              %s
    9699          ';
    97100
  • extensions/Mail_supervisor/main.inc.php

    r4044 r4045  
    9292                 
    9393  $nb_destinataires=0;
     94                if ($mails_options[0] == 'on') {
     95                        if ($mailto == "" )     $mailto = $conf_mail['email_webmaster'];
     96                }   
     97 if ($mailto<>"" )            $nb_destinataires +=1;
     98 if (!empty($args['Cc']))     $nb_destinataires += count($args['Cc']);
     99 if (!empty($args['Bcc']))    $nb_destinataires += count($args['Bcc']);
     100   //================= réécriture de l'entête ===============================
     101if ( $nb_destinataires  == 1 )
     102        {
     103                if ($mailto == "" )
     104                  {
     105                 
     106                          if (!empty($args['Cc']))  $mailto  = get_strict_email_list(implode(',', $args['Cc'])) ;
     107                          if (!empty($args['Bcc'])) $mailto  = get_strict_email_list(implode(',', $args['Bcc'])) ;
     108                         
     109                                $headers = preg_replace('/.*Bcc(.*).\n/i', '', $headers);
     110                                $headers = preg_replace('/.*Cc(.*).\n/i', '', $headers);
     111                  }
     112        }else{
     113
     114   
     115                if (!empty($args['Cc']))
     116                        {
     117                        if ($mails_options[1] == 'on') {  $headers= corrige_header('Cc',$headers);}
     118                        }
     119                if (!empty($args['Bcc']))
     120                        {   
     121                                if ($mails_options[1] == 'on') {  $headers      = corrige_header('Bcc',$headers);}
     122                        }
     123
    94124 
    95  if ($mailto<>"" )  $nb_destinataires +=1;
    96    //================= réécriture de l'entête ===============================
    97 
    98 if ($mails_options[0] == 'on') {
    99         if ($mailto=="")        $mailto=$conf_mail['email_webmaster'];
    100 }
    101                 if (!empty($args['Cc']))
    102                 {$nb_destinataires += count($args['Cc']);
    103                  if ($mails_options[1] == 'on') {  $headers= corrige_header('Cc:',$headers);}
    104                 }
    105                 if (!empty($args['Bcc']))
    106                 {  $nb_destinataires += count($args['Bcc']);
    107                    if ($mails_options[1] == 'on') {  $headers   = corrige_header('Bcc',$headers);}
    108                 }
    109 
     125     }
    110126
    111127if ($mails_options[2]=='on')   {
     
    130146                $ret = false;
    131147                 if ($nb_destinataires > 0) {
    132                         $ret = mail($mailto, $subject, $content, $headers);
     148                  $ret = mail($mailto, $subject, $content, $headers);
    133149 
    134150                        }else{
     
    148164                        if ($alerte_spam ) {
    149165                        $type="Spams";
    150                                 $d1=$mails_données['nb_spams'];
     166                               
    151167                                $d1=$mails_données['nb_spams'] . '  \\  ' . $mails_données['nb_spams_maxi'];
     168                                $d2=$mails_données['nb_spams'];
    152169                                $d3= $mails_données['rest_spam'];
    153170                                $d4=time()+$d3 ;
     
    228245                                if ( $trop_de_spam ) {
    229246                                                $mails_données['nb_spams_maxi']=$mails_données['nb_spams'];
    230                                                 $quarantaine_periode="+".str_replace( $period_search, $period_match, $mails_données['quarantaine_periode']);
    231                                                 $next_day =  strtotime($quarantaine_periode);  // détection de 'Trop de spam
     247
    232248                                                $mails_données['date_quarantaine']= time()  ;   
    233249                                                $mails_données['quarantaine']= true    ;       
Note: See TracChangeset for help on using the changeset viewer.