Commit 06055198 authored by david.verdin's avatar david.verdin
Browse files

[svn] Retrieving List.pm of rev 6194 which was working correctly.


git-svn-id: https://subversion.renater.fr/sympa/trunk@6234 05aa8bb8-cd2b-0410-b1d7-8918dfa770ce
parent 057efe4e
...@@ -3324,35 +3324,14 @@ sub send_msg { ...@@ -3324,35 +3324,14 @@ sub send_msg {
} }
#save the message before modifying it #save the message before modifying it
my $saved_msg = $message->{'msg'}->dup; my $saved_msg = $message->{'msg'}->dup;
my $smtp_count = { my $nbr_smtp;
'nbr_smtp' => 0, my $nbr_verp;
'nbr_verp' => 0,
};
my $tags_to_use = {
'tag_first_noverp' => 1,
'tag_last_noverp' => 1,
'tag_first_verp' => 1,
'tag_last_verp' => 1,
};
# prepare verp parameter # prepare verp parameter
my $verp_rate = $self->{'admin'}{'verp_rate'}; my $verp_rate = $self->{'admin'}{'verp_rate'};
my $xsequence = $self->{'stats'}->[0] ; my $xsequence = $self->{'stats'}->[0] ;
# Define messages can be tagged as first or last according to the verp rate.
if($verp_rate eq '100%'){
$tags_to_use->{'tag_first_noverp'} = 0;
$tags_to_use->{'tag_last_noverp'} = 0;
}
elsif($verp_rate eq '0%'){
$tags_to_use->{'tag_first_verp'} = 0;
$tags_to_use->{'tag_last_verp'} = 0;
}
else{
$tags_to_use->{'tag_first_verp'} = 0;
$tags_to_use->{'tag_last_noverp'} = 0;
}
my $dkim_parameters ; my $dkim_parameters ;
# prepare dkim parameters # prepare dkim parameters
if ($apply_dkim_signature eq 'on') { if ($apply_dkim_signature eq 'on') {
...@@ -3559,45 +3538,36 @@ sub send_msg { ...@@ -3559,45 +3538,36 @@ sub send_msg {
$url_msg = $new_msg; $url_msg = $new_msg;
} }
my $new_message = new Message($url_msg); my $new_message = new Message($url_msg);
return undef unless(&send_message_to_option(
{
'message' => $new_message,
'verp_rate' => $verp_rate,
'xsequence' => $xsequence,
'tabrcpt' => \@tabrcpt_url,
'tabrcpt_verp' => \@tabrcpt_url_verp,
'tags_to_use' => $tags_to_use,
'smtp_count' => $smtp_count,
}
)
);
}
return $smtp_count{'nbr_smtp'};
}
# Factorizing the calls necessary to send a message to a said reception mode users group. my @verp_tabrcpt_url = &extract_verp_rcpt($verp_rate, $xsequence,\@tabrcpt_url, \@tabrcpt_url_verp);
# Return undef if it fails or 1 if it works.
sub send_message_to_option{ my $result = &mail::mail_message('message'=>$new_message,
my $param = shift; 'rcpt'=>\@tabrcpt_url,
my @verp_tabrcpt = &extract_verp_rcpt($param->{'verp_rate'}, $param->{'xsequence'},$param->{'tabrcpt'},$param->{'tabrcpt_verp'}) ; 'list'=>$self ,
'verp' => 'off',
my $result = &mail::mail_message($param->{'message'}, $self , {'enable' => 'off'}, $param->{'tabrcpt'}); 'dkim_parameters'=>$dkim_parameters);
unless (defined $result) { unless (defined $result) {
&do_log('err',"List::send_msg, could not send message to distribute from $from (verp desabled)"); &do_log('err',"List::send_msg, could not send message to distribute from $from (verp desabled)");
return undef; return undef;
} }
$param->{'smtp_count'}->{'nbr_smtp'} += $result; $nbr_smtp += $result;
$result = &mail::mail_message($param->{'message'}, $self , {'enable' => 'on'}, @verp_tabrcpt); $result = &mail::mail_message('message'=>$new_message,
unless (defined $result) { 'rcpt'=>\@verp_tabrcpt_url,
&do_log('err',"List::send_msg, could not send message to distribute from $from (verp enabled)"); 'list'=>$self ,
return undef; 'verp' => 'on',
'dkim_parameters'=>$dkim_parameters);
unless (defined $result) {
&do_log('err',"List::send_msg, could not send message to distribute from $from (verp enabled)");
return undef;
}
$nbr_smtp += $result;
$nbr_verp += $result;
} }
$param->{'smtp_count'}->{'nbr_smtp'} += $result;
$param->{'smtp_count'}->{'nbr_verp'} += $result; return $nbr_smtp;
return 1;
} }
######################### SERVICE MESSAGES ########################################## ######################### SERVICE MESSAGES ##########################################
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment