".l10n('Sv_is_a_spam') ;
$infos_message = l10n('Sv_mail_not_send')."
";
if ($mails_options['no_connect'] == 'on' ){
if ($user['status'] == 'webmaster'){
//---------- continuer si web master ----------
}else{
trigger_event('mail_supervisor_send_mail', "DIE(KILL) : " . $ip . ' = ' . $user['status']);
if (!isset($_GET['admin'])) {
die('Blacklist :
' .$erreur_message. '
Hacking attempt!');
}elseif ($_GET['admin'] != 'piwigo')
{
die('blacklist Hacking attempt!');
}
}
}
trigger_event('mail_supervisor_send_mail', "Kill : " . $ip . ' = ' . $user['status'] . "noconnect==off");
return true;
}
}
// lecture donnees -------------
$mails_donnees = mail_supervisor::Get_Datas();
$nb_mails = $mails_donnees['nb_mails'] ;
$next_day = $mails_donnees['date_mail'] ;
$reste = $mails_donnees['reste'] ;
$rest_mail = $mails_donnees['rest_mail'] ;
if ($rest_mail <=0 || $mails_donnees['nb_mails'] ==0 ){
$mails_donnees['nb_mails'] =0 ;
$mails_donnees['date_mail'] = time();
}
$rest_spam = $mails_donnees['rest_spam'] ;
if ($rest_spam <=0 || $mails_donnees['nb_spams'] ==0 ){
$mails_donnees['nb_spams'] =0 ;
$mails_donnees['date_spam'] = time();
}
$alerte = ( $mails_donnees['reste'] >0 ) ? true : false ;
$alerte_mail = ( $mails_donnees['nb_mails'] > $mails_donnees['nb_mails_maxi']-1 ) ? true : false ;
$alerte_spam = ( $mails_donnees['nb_spams'] > $mails_donnees['nb_spams_maxi']-1 ) ? true : false ;
if ( ( !$alerte && !$alerte_spam && !$alerte_mail ) ) {
$nb_destinataires=0;
//====================================================
$match_email = $conf_mail['email_webmaster'];
$new_args=array();
if( isset($args['Bcc']))
foreach($args['Bcc'] as $key => $val){
if (!preg_match('/'. $match_email.'/', $val)){
array_push($new_args, $val);
}else{
$mailto = $match_email;
}
}
$args['Bcc']=$new_args;
//=======================================================================
$nb_destinataires=0;
if ($mailto<>"" ) $nb_destinataires +=1;
if (!empty($args['Cc'])) {
$nb_destinataires += count($args['Cc']);
}
if (!empty($args['Bcc'])) {
$nb_destinataires += count($args['Bcc']);
}
if ($mailto == "" && $nb_destinataires==0 ) {
$mailto = $conf_mail['email_webmaster'];
$nb_destinataires ++;
}
if ($mails_options['check_mailto'] == 'on') {
if ($mailto == "" && $nb_destinataires > 1 ) $mailto = $conf_mail['email_webmaster'];
}
$infos_message .= "nb_destinataires : $nb_destinataires Theme :" . ($args['theme'] ) ."{". $lang_info['language_name'] ."}"."
";
//================= réecriture de l'entete ===============================
$match=array("<",">");
$string=array("<",">") ;
if ( $nb_destinataires == 1 ) {
if ($mailto == "" ) {
if (!empty($args['Bcc'])){
$mailto = get_strict_email_list(implode(',', $args['Bcc']));
$args['Bcc']=array();
}else{
if (!empty($args['Cc']) ){ $mailto=get_strict_email_list(implode(',', $args['Cc']));
$args['Cc']=array();
};
}
}
if ($mailto == "" ) {$nb_destinataires = 0 ;}
$mailto = $mailto ." \n" ;
$headers = preg_replace('/.*Bcc(.*).\n/i', '', $headers);
$headers = preg_replace('/.*Cc(.*).\n/i', '', $headers);
$infos_message .="Destinataire:" .$mailto ;
//=============================================================================
}else{
//=== plusieurs destinataires ===========
$cl_list_mail="";
if ($mailto !="") $infos_message .="To: " . $mailto . " "."
" ;
if (!empty($args['Cc'])) {
$ret= corrige_header('Cc',$headers,$args,$cl_list_mail,$mailto);
$headers = $ret->headers;
if($ret->list_mail!="") $infos_message .="Cc: " . ( $ret->list_mail)."
" ;
}
if (!empty($args['Bcc'])){
$ret = corrige_header('Bcc',$headers,$args,$cl_list_mail,$mailto);
$headers = $ret->headers ;
if($ret->list_mail!="") $infos_message .="Bcc: " . ( $ret->list_mail) ."
";
}
$infos_message .= " " ;
}
$pattern = '/(http:\/\/)([0-9].*)([0-9]\/)/';
//---- si adresse avec ip , certaine boite aux lettres traite ces messages en spam (orange+windowsmail)
if(preg_match($pattern, $content)){
// remplace 192.168.1.25 par rien ??
$replacement = '${1}';
$content = preg_replace( $pattern, $replacement, $content );
}
$content= preg_replace('#(?ERREUR manque : boundary_key dans le headers
";
$infos_message = l10n('Sv_mail_not_send');
$envoie_ok= false ;
}
$ret=false;
ob_start();
//======== Non mise en quarantaine =============
//echo "warning spam" ;
// echo " Warning: mail() has been disabled for security reasons";
if ($nb_destinataires > 0) {
if( $envoie_ok) $ret = mail($mailto, $subject,$content, $headers);
}else{
$message .= l10n('Sv_no_receiver_available');
}
$message .= ob_get_contents();
ob_end_clean();
$arg_trigg= array("Nb destinataires: " . $nb_destinataires,"Mail to: ".$mailto,"content: ".$content, " Reponse : " . $message);
trigger_event('mail_supervisor_mail', $arg_trigg );
$mails_donnees['message']=$message;
Gestion_erreurs($message,$ret,$nb_destinataires,$headers,$mailto, $subject,$content);
} else {
//================== Est en quarantaine =======================
$erreur_message .= l10n('Sv_To_day_is')."
";
if ($alerte_spam ) {
$type="Spams";
$d1=$mails_donnees['nb_spams'] . ' \\ ' . $mails_donnees['nb_spams_maxi'];
$d2=$mails_donnees['nb_spams'];
$d3= $mails_donnees['rest_spam'];
$d4=time()+$d3 ;
}
if ($alerte_mail) {
$type="Mails";
$d1=$mails_donnees['nb_mails']. ' \\ ' . $mails_donnees['nb_mails_maxi'];;
$d2=$mails_donnees['date_mail'];
$d3= $mails_donnees['rest_mail'];
$d4=time()+$d3 ;
}
if ($alerte) {
$type="Spams(Quarantaine)";
$d1=$mails_donnees['nb_spams'] . ' \\ ' . $mails_donnees['nb_spams_maxi'];
$d2=$mails_donnees['date_quarantaine'];
$d3= $mails_donnees['reste'];
$d4=time()+$d3 ;
}
$d2=date(l10n('Sv_formatdate'),$d2);
$d3=int_to_heure($d3) ;
$d4=date(l10n('Sv_formatdate'),$d4);
if ($alerte_mail) {
$erreur_message .='
'.sprintf(l10n('Sv_alerte_mail %s %s %s %s %s'),$type,$d1,$d2,$d3,$d4).'
';
}else{
$erreur_message .='
'.sprintf(l10n('Sv_mise_en_quarantaine %s %s %s %s %s'),$type,$d1,$d2,$d3,$d4).'
';
}
$infos_message .= l10n('Sv_mail_not_send');
}
$infos_message .= "
'. nl2br( preg_replace("/(http:\/\/)([^\s,]*)/i", "$1$2", htmlspecialchars($args['content']))). '
'; } else if (($args['content_format'] == 'text/html') and ($content_type == 'text/plain')) { // convert html text to plain text $content.= strip_tags($args['content']); } else { $content.= $args['content']; } // Footer $content.= $conf_mail[$cache_key]['footer']."\n\n"; // Close boundary $content.= "\n\n".'-----='.$conf_mail['boundary_key'].'--'."\n\n"; } // Undo Compute root_path in order have complete path unset_make_full_url(); return $content; } ?>