Commit 3c89d30e authored by sikeda's avatar sikeda
Browse files

[dev] Refactoring: New package Sympa::Alarm to manage spool on memorty for listmaster notification.

- Sympa::Alarm::flush() to flush or purge the spool was separated from send_notify_to_listmaster().
- send_notify_to_listmaster() now takes context (site ('*'), robot, List) as the first argument.
- As a side work, mail_tt2/automatic_bounce_management.tt2 was separated from listmaster_notification.tt2 and listowner_notification.tt2.


git-svn-id: https://subversion.renater.fr/sympa/branches/sympa-6.2-branch@11336 05aa8bb8-cd2b-0410-b1d7-8918dfa770ce
parent 73f8d7af
Subject: [% FILTER qencode %][%|loc(list.name)%]List %1 automatic bounce management[%END%][%END%]
[% IF action == 'notify_bouncers' -%]
[%|loc(total,list.name)%]Because we received MANY non-delivery reports, the %1 subscribers listed below have been
notified that they might be removed from list %2:[%END%]
[% ELSIF action == 'remove_bouncers' -%]
[%|loc(total,list.name)%]Because we received MANY non-delivery reports, the %1 subscribers listed below have been
removed from list %2:[%END%]
[% ELSIF action == 'none' -%]
[%|loc(total,list.name)%]Because we received MANY non-delivery reports, the %1 subscribers listed below have been
selected by Sympa as severe bouncing addresses:[%END%]
[%END%]
[% FOREACH user IN user_list -%]
[% user %]
[% END %]
[%|loc%]Managing bouncing subscribers:[%END%] [% conf.wwsympa_url %]/reviewbouncing/[% list.name %]
...@@ -78,12 +78,15 @@ Subject: [% FILTER qencode %][%|loc%]DataBase connection restored[%END%][%END%] ...@@ -78,12 +78,15 @@ Subject: [% FILTER qencode %][%|loc%]DataBase connection restored[%END%][%END%]
[%|loc(db_name)%]Connection to database %1 restored.[%END%] [%|loc(db_name)%]Connection to database %1 restored.[%END%]
[% ELSIF type == 'bulk_error' -%] [% ELSIF type == 'bulk_error' -%]
Subject: [% FILTER qencode %][%|loc%]Bulk mailer error[%END%][%END%] 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%] [%|loc(message_id)%]Sympa failed to store a message <%1> in the bulk mailer. You should check log files !![%END%]
[% ELSIF type == 'bulk_failed' -%]
Subject: [% FILTER qencode %][%|loc%]Bulk mailer error[%END%][%END%]
[%|loc(message_id)%]Sympa failed to process a message <%1> in the bulk spool. You should check log files!![%END%]
[% ELSIF type == 'loop_command' -%] [% ELSIF type == 'loop_command' -%]
Subject: [% FILTER qencode %][%|loc%]Loop detected[%END%][%END%] Subject: [% FILTER qencode %][%|loc%]Loop detected[%END%][%END%]
...@@ -153,22 +156,6 @@ Subject: [% FILTER qencode %][%|loc%]incorrect format of edit_list.conf[%END%][% ...@@ -153,22 +156,6 @@ Subject: [% FILTER qencode %][%|loc%]incorrect format of edit_list.conf[%END%][%
[%|loc(param0)%]Until then we recommend your remove %1; [%|loc(param0)%]Until then we recommend your remove %1;
default configuration will be used.[%END%] default configuration will be used.[%END%]
[% ELSIF type == 'subscribers_limit_exceeded' -%]
Subject: [% FILTER qencode %][%|loc(listname)%]Limit of users count reached for list %1[%END%][%END%]
[%|loc(listname,max_number_of_subscribers)%]Sympa could not include subscribers to list %1 because the maximum number of users was reached for this list. This limit is defined to %2.[%END%]
[% ELSIF type == 'sync_include_failed' -%]
Subject: [% FILTER qencode %][%|loc(listname)%]subscribers update failed for list %1[%END%][%END%]
[%|loc%]Sympa could not include subscribers from the following external data sources:[%END%]
[% FOREACH e IN errors %]
[%|loc(e.name,e.type)%]Include of datasource %1 (type %2) failed.[% END %]
[% END %]
[%|loc%]Check Sympa log files for more precise information[%END%]
[% ELSIF type == 'sync_include_admin_failed' -%] [% ELSIF type == 'sync_include_admin_failed' -%]
Subject: [% FILTER qencode %][%|loc(param0)%]admins update failed for list %1[%END%][%END%] Subject: [% FILTER qencode %][%|loc(param0)%]admins update failed for list %1[%END%][%END%]
...@@ -264,33 +251,12 @@ Subject: [% FILTER qencode %][%|loc(param0)%]list %1 in status error_config[%END ...@@ -264,33 +251,12 @@ Subject: [% FILTER qencode %][%|loc(param0)%]list %1 in status error_config[%END
[%|loc%]The list status has been set to error_config.[%END%] [%|loc%]The list status has been set to error_config.[%END%]
[%|loc%]Check Sympa log files for more precise information.[%END%] [%|loc%]Check Sympa log files for more precise information.[%END%]
[% ELSIF type == 'automatic_bounce_management' -%]
Subject: [% FILTER qencode %][%|loc(list.name)%]List %1 automatic bounce management[%END%][%END%]
[% IF action == 'notify_bouncers' -%]
[%|loc(total,list.name)%]Because we received MANY non-delivery reports, the %1 subscribers listed below have been
notified that they might be removed from list %2:[%END%]
[% ELSIF action == 'remove_bouncers' -%]
[%|loc(total,list.name)%]Because we received MANY non-delivery reports, the %1 subscribers listed below have been
removed from list %2:[%END%]
[% ELSIF action == 'none' -%]
[%|loc(total,list.name)%]Because we received MANY non-delivery reports, the %1 subscribers listed below have been
selected by Sympa as severe bouncing addresses:[%END%]
[%END%]
[% FOREACH user IN user_list -%]
[% user %]
[% END %]
[%|loc%]Managing bouncing subscribers:[%END%] [% conf.wwsympa_url %]/reviewbouncing/[% list.name %]
[%# INTERNAL SERVER ERROR : MAIL -%] [%# INTERNAL SERVER ERROR : MAIL -%]
[% ELSIF type == 'mail_intern_error' -%] [% ELSIF type == 'mail_intern_error' -%]
Subject: [% FILTER qencode %][%|loc(list.name)%]Listmaster: internal server error [%END%][%END%] Subject: [% FILTER qencode %][%|loc%]Listmaster: internal server error [%END%][%END%]
[%|loc(who)%] User %1 has encountered an internal server error[%END%] [%|loc(who)%] User %1 has encountered an internal server error[%END%]
([%action%][% IF msg_id %] - MSG_ID[%|loc%]:[%END%] [%msg_id%][%END%][% IF cmd %] - COMMAND[%|loc%]:[%END%] [%cmd%][%END%][% IF list.name %] - LIST[%|loc%]:[%END%] [%list.name%]@[%conf.host%][%END%])[%|loc%]:[%END%] ([%action%][% IF msg_id %] - MSG_ID[%|loc%]:[%END%] [%msg_id%][%END%][% IF cmd %] - COMMAND[%|loc%]:[%END%] [%cmd%][%END%][% IF list.name %] - LIST[%|loc%]:[%END%] [%list.name%]@[%list.host%][%END%])[%|loc%]:[%END%]
[%IF error%][%error%] [%IF error%][%error%]
[%END%] [%END%]
...@@ -300,7 +266,7 @@ Subject: [% FILTER qencode %][%|loc(list.name)%]Listmaster: internal server erro ...@@ -300,7 +266,7 @@ Subject: [% FILTER qencode %][%|loc(list.name)%]Listmaster: internal server erro
[% ELSIF type == 'bounce_intern_error' -%] [% ELSIF type == 'bounce_intern_error' -%]
Subject: [% FILTER qencode %][%|loc(list.name)%]Listmaster: internal server error [%END%][%END%] Subject: [% FILTER qencode %][%|loc(list.name)%]Listmaster: internal server error [%END%][%END%]
[%|loc(error)%]The following error occurred whila managing bounces: %&[%END%] [%|loc(error)%]The following error occurred while managing bounces: %1[%END%]
[%|loc%]See logs for more details.[%END%] [%|loc%]See logs for more details.[%END%]
......
...@@ -38,26 +38,6 @@ Some of the customizations have been removed because they no longer respect the ...@@ -38,26 +38,6 @@ Some of the customizations have been removed because they no longer respect the
[%END%] [%END%]
[% ELSIF type == 'automatic_bounce_management' -%]
Subject: [% FILTER qencode %][%|loc(list.name)%]List %1 automatic bounce management[%END%][%END%]
[% IF action == 'notify_bouncers' -%]
[%|loc(total,list.name)%]Because we received many non-delivery reports, the %1 subscribers listed below have been
notified that they might be removed from list %2:[%END%]
[% ELSIF action == 'remove_bouncers' -%]
[%|loc(total,list.name)%]Because we received many non-delivery reports, the %1 subscribers listed below have been
removed from list %2:[%END%]
[% ELSIF action == 'none' -%]
[%|loc(total,list.name)%]Because we received many non-delivery reports, the %1 subscribers listed below have been
selected by Sympa as severe bouncing addresses:[%END%]
[%END%]
[% FOREACH user = user_list -%]
[% user %]
[%END%]
[%|loc%]Managing bouncing subscribers:[%END%] [% conf.wwsympa_url %]/reviewbouncing/[% list.name %]
[% ELSIF type == 'subrequest' -%] [% ELSIF type == 'subrequest' -%]
Subject: [% FILTER qencode %][%|loc(list.name)%]Subscription request to list %1[%END%][%END%] Subject: [% FILTER qencode %][%|loc(list.name)%]Subscription request to list %1[%END%][%END%]
......
...@@ -60,6 +60,7 @@ use Data::Dumper; # tentative ...@@ -60,6 +60,7 @@ use Data::Dumper; # tentative
BEGIN { eval 'use Crypt::OpenSSL::X509'; } BEGIN { eval 'use Crypt::OpenSSL::X509'; }
   
use Sympa::Admin; use Sympa::Admin;
use Sympa::Alarm;
use Sympa::Archive; use Sympa::Archive;
use Sympa::Auth; use Sympa::Auth;
use Conf; use Conf;
...@@ -1028,7 +1029,7 @@ while ($query = new_loop()) { ...@@ -1028,7 +1029,7 @@ while ($query = new_loop()) {
Sympa::List::init_list_cache(); Sympa::List::init_list_cache();
   
# Process grouped notifications # Process grouped notifications
Sympa::Robot::send_notify_to_listmaster(undef, undef, undef, 1); Sympa::Alarm::flush();
   
## Check effective ID ## Check effective ID
unless ($EUID eq (getpwnam(Sympa::Constants::USER))[2]) { unless ($EUID eq (getpwnam(Sympa::Constants::USER))[2]) {
...@@ -1310,8 +1311,8 @@ while ($query = new_loop()) { ...@@ -1310,8 +1311,8 @@ while ($query = new_loop()) {
# affected to another anonymous session. # affected to another anonymous session.
undef $ENV{'HTTP_COOKIE'}; undef $ENV{'HTTP_COOKIE'};
unless (defined $session) { unless (defined $session) {
Sympa::Robot::send_notify_to_listmaster( tools::send_notify_to_listmaster($robot,
'failed_to_create_web_session', $robot); 'failed_to_create_web_session', {});
wwslog('info', 'Failed to create session'); wwslog('info', 'Failed to create session');
$session = Sympa::Session->new($robot, {}); $session = Sympa::Session->new($robot, {});
} }
...@@ -1979,7 +1980,7 @@ while ($query = new_loop()) { ...@@ -1979,7 +1980,7 @@ while ($query = new_loop()) {
) { ) {
my $error = tt2::get_error(); my $error = tt2::get_error();
$param->{'tt2_error'} = $error; $param->{'tt2_error'} = $error;
Sympa::Robot::send_notify_to_listmaster('web_tt2_error', $robot, tools::send_notify_to_listmaster($robot, 'web_tt2_error',
[$error]); [$error]);
} }
   
...@@ -2013,7 +2014,7 @@ while ($query = new_loop()) { ...@@ -2013,7 +2014,7 @@ while ($query = new_loop()) {
) { ) {
my $error = tt2::get_error(); my $error = tt2::get_error();
$param->{'tt2_error'} = $error; $param->{'tt2_error'} = $error;
Sympa::Robot::send_notify_to_listmaster('web_tt2_error', $robot, tools::send_notify_to_listmaster($robot, 'web_tt2_error',
[$error]); [$error]);
} }
# close FILE; # close FILE;
...@@ -2037,7 +2038,7 @@ while ($query = new_loop()) { ...@@ -2037,7 +2038,7 @@ while ($query = new_loop()) {
} }
   
# Purge grouped notifications # Purge grouped notifications
Sympa::Robot::send_notify_to_listmaster(undef, undef, undef, undef, 1); Sympa::Alarm::flush('purge');
   
############################################################## ##############################################################
#-#\#|#/#-#\#|#/#-#\#|#/#-#\#|#/#-#\#|#/#-#\#|#/#-#\#|#/#-#\#|#/ #-#\#|#/#-#\#|#/#-#\#|#/#-#\#|#/#-#\#|#/#-#\#|#/#-#\#|#/#-#\#|#/
...@@ -3007,7 +3008,7 @@ sub send_html { ...@@ -3007,7 +3008,7 @@ sub send_html {
# "Not Found" response for random help page. # "Not Found" response for random help page.
print "Status: 404 Not Found\n"; print "Status: 404 Not Found\n";
} else { } else {
Sympa::Robot::send_notify_to_listmaster('web_tt2_error', $robot, tools::send_notify_to_listmaster($robot, 'web_tt2_error',
[$error]); [$error]);
} }
   
...@@ -8056,8 +8057,8 @@ sub do_skinsedit { ...@@ -8056,8 +8057,8 @@ sub do_skinsedit {
tt2::parse_tt2($param, 'css.tt2', \*CSS, $tt2_include_path)) { tt2::parse_tt2($param, 'css.tt2', \*CSS, $tt2_include_path)) {
my $error = tt2::get_error(); my $error = tt2::get_error();
$param->{'tt2_error'} = $error; $param->{'tt2_error'} = $error;
Sympa::Robot::send_notify_to_listmaster('web_tt2_error', tools::send_notify_to_listmaster($robot, 'web_tt2_error',
$robot, [$error]); [$error]);
wwslog('info', 'Error while installing %s', $css_file); wwslog('info', 'Error while installing %s', $css_file);
} }
close(CSS); close(CSS);
...@@ -11292,7 +11293,7 @@ Creates a list using a list template ...@@ -11292,7 +11293,7 @@ Creates a list using a list template
   
=item * check_param_in =item * check_param_in
   
=item * Sympa::Robot::send_notify_to_listmaster =item * tools::send_notify_to_listmaster
   
=item * Sympa::Report::reject_report_web =item * Sympa::Report::reject_report_web
   
...@@ -11482,13 +11483,8 @@ sub do_create_list { ...@@ -11482,13 +11483,8 @@ sub do_create_list {
if ($param->{'create_action'} =~ /notify/) { if ($param->{'create_action'} =~ /notify/) {
wwslog('info', 'Notify listmaster'); wwslog('info', 'Notify listmaster');
   
Sympa::Robot::send_notify_to_listmaster( tools::send_notify_to_listmaster($list, 'request_list_creation',
'request_list_creation', {'email' => $param->{'user'}{'email'}});
$robot,
{ 'list' => $list,
'email' => $param->{'user'}{'email'}
}
);
} }
   
web_db_log( web_db_log(
...@@ -21524,11 +21520,10 @@ sub do_change_email { ...@@ -21524,11 +21520,10 @@ sub do_change_email {
my $admin_user = $list->get_list_admin($role, $old_email); my $admin_user = $list->get_list_admin($role, $old_email);
if ($admin_user->{'included'}) { if ($admin_user->{'included'}) {
## Notify listmaster ## Notify listmaster
Sympa::Robot::send_notify_to_listmaster( tools::send_notify_to_listmaster(
$list,
'failed_to_change_included_admin', 'failed_to_change_included_admin',
$robot, { 'current_email' => $old_email,
{ 'list' => $list,
'current_email' => $old_email,
'new_email' => $new_email, 'new_email' => $new_email,
'datasource' => 'datasource' =>
$list->get_datasource_name($admin_user->{'id'}) $list->get_datasource_name($admin_user->{'id'})
...@@ -21569,9 +21564,9 @@ sub do_change_email { ...@@ -21569,9 +21564,9 @@ sub do_change_email {
} }
## Notify listmasters that list owners/moderators email have changed ## Notify listmasters that list owners/moderators email have changed
if (keys %updated_lists) { if (keys %updated_lists) {
Sympa::Robot::send_notify_to_listmaster( tools::send_notify_to_listmaster(
'listowner_email_changed',
$robot, $robot,
'listowner_email_changed',
{ 'list' => $list, { 'list' => $list,
'previous_email' => $old_email, 'previous_email' => $old_email,
'new_email' => $new_email, 'new_email' => $new_email,
...@@ -23996,8 +23991,7 @@ sub do_css { ...@@ -23996,8 +23991,7 @@ sub do_css {
unless (tt2::parse_tt2($param, 'css.tt2', \*STDOUT, $tt2_include_path)) { unless (tt2::parse_tt2($param, 'css.tt2', \*STDOUT, $tt2_include_path)) {
my $error = tt2::get_error(); my $error = tt2::get_error();
$param->{'tt2_error'} = $error; $param->{'tt2_error'} = $error;
Sympa::Robot::send_notify_to_listmaster('web_tt2_error', $robot, tools::send_notify_to_listmaster($robot, 'web_tt2_error', [$error]);
[$error]);
wwslog('info', '/%s: error', $in{'file'}); wwslog('info', '/%s: error', $in{'file'});
} }
   
...@@ -24846,9 +24840,9 @@ sub do_automatic_lists_request { ...@@ -24846,9 +24840,9 @@ sub do_automatic_lists_request {
wwslog('err', wwslog('err',
'Failed to instantiate family %s. This family does not exist', 'Failed to instantiate family %s. This family does not exist',
$in{'family'}); $in{'family'});
Sympa::Robot::send_notify_to_listmaster( tools::send_notify_to_listmaster(
'automatic_list_creation_failed',
$robot, $robot,
'automatic_list_creation_failed',
[ "Failed to instantiate family $in{'family'}. This family does not exist." [ "Failed to instantiate family $in{'family'}. This family does not exist."
] ]
); );
...@@ -24907,9 +24901,9 @@ sub do_automatic_lists { ...@@ -24907,9 +24901,9 @@ sub do_automatic_lists {
Log::do_log('err', Log::do_log('err',
"Failed to create the dynamic list $listname: family $family_name does not exist." "Failed to create the dynamic list $listname: family $family_name does not exist."
); );
Sympa::Robot::send_notify_to_listmaster( tools::send_notify_to_listmaster(
'automatic_list_creation_failed',
$robot, $robot,
'automatic_list_creation_failed',
[ "Failed to create the dynamic list $listname: family $family_name does not exist." [ "Failed to create the dynamic list $listname: family $family_name does not exist."
] ]
); );
...@@ -24926,9 +24920,11 @@ sub do_automatic_lists { ...@@ -24926,9 +24920,11 @@ sub do_automatic_lists {
) { ) {
Log::do_log('err', 'Failed to create the dynamic list %s', Log::do_log('err', 'Failed to create the dynamic list %s',
$listname); $listname);
Sympa::Robot::send_notify_to_listmaster( tools::send_notify_to_listmaster(
$robot,
'automatic_list_creation_failed', 'automatic_list_creation_failed',
$robot, ["Failed to create the dynamic list $listname."]); ["Failed to create the dynamic list $listname."]
);
return undef; return undef;
} }
} }
......
...@@ -759,8 +759,8 @@ sub checkfiles { ...@@ -759,8 +759,8 @@ sub checkfiles {
if (defined $Conf{'cafile'} && $Conf{'cafile'}) { if (defined $Conf{'cafile'} && $Conf{'cafile'}) {
unless (-f $Conf{'cafile'} && -r $Conf{'cafile'}) { unless (-f $Conf{'cafile'} && -r $Conf{'cafile'}) {
Log::do_log('err', 'Cannot access cafile %s', $Conf{'cafile'}); Log::do_log('err', 'Cannot access cafile %s', $Conf{'cafile'});
Sympa::Robot::send_notify_to_listmaster('cannot_access_cafile', tools::send_notify_to_listmaster('*', 'cannot_access_cafile',
$Conf{'domain'}, [$Conf{'cafile'}]); [$Conf{'cafile'}]);
$config_err++; $config_err++;
} }
} }
...@@ -768,8 +768,8 @@ sub checkfiles { ...@@ -768,8 +768,8 @@ sub checkfiles {
if (defined $Conf{'capath'} && $Conf{'capath'}) { if (defined $Conf{'capath'} && $Conf{'capath'}) {
unless (-d $Conf{'capath'} && -x $Conf{'capath'}) { unless (-d $Conf{'capath'} && -x $Conf{'capath'}) {
Log::do_log('err', 'Cannot access capath %s', $Conf{'capath'}); Log::do_log('err', 'Cannot access capath %s', $Conf{'capath'});
Sympa::Robot::send_notify_to_listmaster('cannot_access_capath', tools::send_notify_to_listmaster('*', 'cannot_access_capath',
$Conf{'domain'}, [$Conf{'capath'}]); [$Conf{'capath'}]);
$config_err++; $config_err++;
} }
} }
...@@ -781,9 +781,11 @@ sub checkfiles { ...@@ -781,9 +781,11 @@ sub checkfiles {
'Error in config: queuebounce and bounce_path parameters pointing to the same directory (%s)', 'Error in config: queuebounce and bounce_path parameters pointing to the same directory (%s)',
$Conf{'queuebounce'} $Conf{'queuebounce'}
); );
Sympa::Robot::send_notify_to_listmaster( tools::send_notify_to_listmaster(
'*',
'queuebounce_and_bounce_path_are_the_same', 'queuebounce_and_bounce_path_are_the_same',
$Conf{'domain'}, [$Conf{'queuebounce'}]); [$Conf{'queuebounce'}]
);
$config_err++; $config_err++;
} }
...@@ -795,9 +797,9 @@ sub checkfiles { ...@@ -795,9 +797,9 @@ sub checkfiles {
'Error in config: queue and queueautomatic parameters pointing to the same directory (%s)', 'Error in config: queue and queueautomatic parameters pointing to the same directory (%s)',
$Conf{'queue'} $Conf{'queue'}
); );
Sympa::Robot::send_notify_to_listmaster( tools::send_notify_to_listmaster('*',
'queue_and_queueautomatic_are_the_same', 'queue_and_queueautomatic_are_the_same',
$Conf{'domain'}, [$Conf{'queue'}]); [$Conf{'queue'}]);
$config_err++; $config_err++;
} }
...@@ -864,8 +866,8 @@ sub checkfiles { ...@@ -864,8 +866,8 @@ sub checkfiles {
## Create directory if required ## Create directory if required
unless (-d $dir) { unless (-d $dir) {
unless (tools::mkdir_all($dir, 0755)) { unless (tools::mkdir_all($dir, 0755)) {
Sympa::Robot::send_notify_to_listmaster('cannot_mkdir', tools::send_notify_to_listmaster($robot, 'cannot_mkdir',
$robot, ["Could not create directory $dir: $ERRNO"]); ["Could not create directory $dir: $ERRNO"]);
Log::do_log('err', 'Failed to create directory %s: %m', $dir); Log::do_log('err', 'Failed to create directory %s: %m', $dir);
return undef; return undef;
} }
...@@ -890,8 +892,8 @@ sub checkfiles { ...@@ -890,8 +892,8 @@ sub checkfiles {
rename $dir . '/' . $css, $dir . '/' . $css . '.' . time; rename $dir . '/' . $css, $dir . '/' . $css . '.' . time;
unless (open(CSS, ">$dir/$css")) { unless (open(CSS, ">$dir/$css")) {
Sympa::Robot::send_notify_to_listmaster( tools::send_notify_to_listmaster($robot,
'cannot_open_file', $robot, 'cannot_open_file',
["Could not open file $dir/$css: $ERRNO"]); ["Could not open file $dir/$css: $ERRNO"]);
Log::do_log( Log::do_log(
'err', 'err',
...@@ -908,8 +910,8 @@ sub checkfiles { ...@@ -908,8 +910,8 @@ sub checkfiles {
) { ) {
my $error = tt2::get_error(); my $error = tt2::get_error();
$param->{'tt2_error'} = $error; $param->{'tt2_error'} = $error;
Sympa::Robot::send_notify_to_listmaster('web_tt2_error', tools::send_notify_to_listmaster($robot, 'web_tt2_error',
$robot, [$error]); [$error]);
Log::do_log('err', 'Error while installing %s/%s', Log::do_log('err', 'Error while installing %s/%s',
$dir, $css); $dir, $css);
} }
...@@ -925,9 +927,9 @@ sub checkfiles { ...@@ -925,9 +927,9 @@ sub checkfiles {
} }
if ($css_updated) { if ($css_updated) {
## Notify main listmaster ## Notify main listmaster
Sympa::Robot::send_notify_to_listmaster( tools::send_notify_to_listmaster(
'*',
'css_updated', 'css_updated',
$Conf{'domain'},
[ "Static CSS files have been updated ; check log file for details" [ "Static CSS files have been updated ; check log file for details"
] ]
); );
...@@ -2190,9 +2192,9 @@ sub _load_single_robot_config { ...@@ -2190,9 +2192,9 @@ sub _load_single_robot_config {
$config_file); $config_file);
unless (-r $config_file) { unless (-r $config_file) {
Log::do_log('err', 'No read access on %s', $config_file); Log::do_log('err', 'No read access on %s', $config_file);
Sympa::Robot::send_notify_to_listmaster( tools::send_notify_to_listmaster(
'*',
'cannot_access_robot_conf', 'cannot_access_robot_conf',
$Conf{'domain'},
[ "No read access on $config_file. you should change privileges on this file to activate this virtual host. " [ "No read access on $config_file. you should change privileges on this file to activate this virtual host. "
] ]
); );
......
...@@ -70,8 +70,8 @@ sub fatal_err { ...@@ -70,8 +70,8 @@ sub fatal_err {
if ($EVAL_ERROR && ($warning_date < time - $warning_timeout)) { if ($EVAL_ERROR && ($warning_date < time - $warning_timeout)) {
$warning_date = time + $warning_timeout; $warning_date = time + $warning_timeout;
unless ( unless (
Sympa::Robot::send_notify_to_listmaster( tools::send_notify_to_listmaster(
'logs_failed', $Conf::Conf{'domain'}, [$EVAL_ERROR] '*', 'logs_failed', [$EVAL_ERROR]
) )
) { ) {
print STDERR "No logs available, can't send warning message"; print STDERR "No logs available, can't send warning message";
...@@ -82,8 +82,8 @@ sub fatal_err { ...@@ -82,8 +82,8 @@ sub fatal_err {
my $full_msg = sprintf $m, @_; my $full_msg = sprintf $m, @_;
## Notify listmaster ## Notify listmaster
Sympa::Robot::send_notify_to_listmaster('sympa_died', #FIXME: Add entry to listmaster_notification.tt2
$Conf::Conf{'domain'}, [$full_msg]); tools::send_notify_to_listmaster('*', 'sympa_died', [$full_msg]);
printf STDERR "$m\n", @_; printf STDERR "$m\n", @_;
exit(1); exit(1);
...@@ -204,8 +204,8 @@ sub do_log { ...@@ -204,8 +204,8 @@ sub do_log {
}; };
if ($EVAL_ERROR and $warning_date < time - $warning_timeout) { if ($EVAL_ERROR and $warning_date < time - $warning_timeout) {
$warning_date = time + $warning_timeout; $warning_date = time + $warning_timeout;
Sympa::Robot::send_notify_to_listmaster('logs_failed', #FIXIME: Add entry to listmaster_notification.tt2
$Conf::Conf{'domain'}, [$EVAL_ERROR]); tools::send_notify_to_listmaster('*', 'logs_failed', [$EVAL_ERROR]);
} }
} }
...@@ -237,8 +237,8 @@ sub do_connect { ...@@ -237,8 +237,8 @@ sub do_connect {
if ($EVAL_ERROR && ($warning_date < time - $warning_timeout)) { if ($EVAL_ERROR && ($warning_date < time - $warning_timeout)) {
$warning_date = time + $warning_timeout; $warning_date = time + $warning_timeout;
unless ( unless (
Sympa::Robot::send_notify_to_listmaster( tools::send_notify_to_listmaster(
'logs_failed', $Conf::Conf{'domain'}, [$EVAL_ERROR] '*', 'logs_failed', [$EVAL_ERROR]
) )
) { ) {
print STDERR "No logs available, can't send warning message"; print STDERR "No logs available, can't send warning message";
......
...@@ -25,6 +25,7 @@ nobase_modules_DATA = \ ...@@ -25,6 +25,7 @@ nobase_modules_DATA = \
Sympa/Archive.pm \ Sympa/Archive.pm \
Sympa/Auth.pm \ Sympa/Auth.pm \
Bounce.pm \ Bounce.pm \
Sympa/Alarm.pm \
Sympa/Bulk.pm \ Sympa/Bulk.pm \
Sympa/Commands.pm \ Sympa/Commands.pm \
Conf.pm \ Conf.pm \
......
...@@ -334,11 +334,9 @@ sub probe_db { ...@@ -334,11 +334,9 @@ sub probe_db {
$Sympa::List::