Commit 3e133456 authored by olivier.salaun's avatar olivier.salaun
Browse files

[bug] catch error if Bulk::store() fails and notify listmaster


git-svn-id: https://subversion.renater.fr/sympa/trunk@5566 05aa8bb8-cd2b-0410-b1d7-8918dfa770ce
parent 28ea527f
......@@ -73,6 +73,12 @@ Subject: [% FILTER qencode %][%|loc%]DataBase connection restored[%END%][%END%]
[%|loc(db_name)%]Connection to database %1 restored.[%END%]
[% ELSIF type == 'bulk_error' -%]
Subject: [% FILTER qencode %][%|loc%]Bulk mailer error[%END%][%END%]
[%|loc(listname)%]Sympa failed to store a message for list %1 in the bulk mailer. You should check log files !![%END%]
[% ELSIF type == 'loop_command' -%]
Subject: [% FILTER qencode %][%|loc%]Loop detected[%END%][%END%]
MIME-Version: 1.0
......
......@@ -634,14 +634,20 @@ sub sending {
my $verpfeature = ($verp eq 'on');
if ($use_bulk){ # in that case use bulk tables to prepare message distribution
&Bulk::store('msg' => $messageasstring,
'rcpts' => $rcpt,
'from' => $from,
'robot' => $robot,
'listname' => $listname,
'priority' => $priority,
'delivery_date' => $delivery_date,
'verp' => $verpfeature);
my $bulk_code = &Bulk::store('msg' => $messageasstring,
'rcpts' => $rcpt,
'from' => $from,
'robot' => $robot,
'listname' => $listname,
'priority' => $priority,
'delivery_date' => $delivery_date,
'verp' => $verpfeature);
unless (defined $bulk_code) {
&do_log('err', 'Failed to store message for list %s', $listname);
unless (&List::send_notify_to_listmaster('bulk_error', $robot, {'listname' => $listname});
return undef;
}
}elsif(defined $send_spool) { # in context wwsympa.fcgi do note send message to reciepients but copy it to standard spool
$sympa_email = &Conf::get_robot_conf($robot, 'sympa');
$sympa_file = "$send_spool/T.$sympa_email.".time.'.'.int(rand(10000));
......
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