From aabfc3889e4def7e9c416bdf23cd5d06835dd2da Mon Sep 17 00:00:00 2001 From: Guillaume Rousse <guillaume.rousse@renater.fr> Date: Tue, 7 Nov 2017 16:04:15 +0100 Subject: [PATCH] kill errors email notification --- lib/IdPAccountManager/WebRequest.pm | 31 ------------------- templates/Makefile.am | 1 - .../mail/notification_generic_error.tt2.eml | 20 ------------ 3 files changed, 52 deletions(-) delete mode 100644 templates/mail/notification_generic_error.tt2.eml diff --git a/lib/IdPAccountManager/WebRequest.pm b/lib/IdPAccountManager/WebRequest.pm index 10c2dff..04e02a9 100755 --- a/lib/IdPAccountManager/WebRequest.pm +++ b/lib/IdPAccountManager/WebRequest.pm @@ -175,37 +175,6 @@ sub respond { $self->{logger}->errorf("Web parser error : %s", $tt2->error()); } - ## Ignore some type of errors - my @errors_admin; - foreach my $id_error (@{ $self->{out}->{errors} }) { - unless ($id_error =~ /^(error_x)$/) { - push @errors_admin, $id_error; - } - } - - ## Mail notification of admins about the error - if (@errors_admin) { - eval { - IdPAccountManager::Tools::mail_notice( - template => 'mail/notification_generic_error.tt2.eml', - templates_dir => $self->{configuration}->{templates_dir}, - data => { - env => { - REMOTE_HOST => $ENV{REMOTE_HOST}, - REMOTE_ADDR => $ENV{REMOTE_ADDR}, - }, - conf => { - app_name => $self->{configuration}->{app_name}, - app_url => $self->{configuration}->{app_url}, - }, - from => $self->{configuration}->{notice_from}, - to => $self->{configuration}->{admin_email}, - errors => $self->{out}->{errors} - } - ); - }; - $self->{logger}->errorf("Error TT2 : %s", $EVAL_ERROR) if $EVAL_ERROR; - } } ## Return the list of known SPs first diff --git a/templates/Makefile.am b/templates/Makefile.am index b157184..f24227f 100644 --- a/templates/Makefile.am +++ b/templates/Makefile.am @@ -11,7 +11,6 @@ nobase_templates_DATA = \ accountProfiles/teacher1.tt2 \ accountProfiles/teacher2.tt2 \ accountProfiles/valid-accounts.php.tt2 \ - mail/notification_generic_error.tt2.eml \ mail/send_authentication_token.tt2.eml \ web/account_wizard.tt2.html \ web/content.tt2.html \ diff --git a/templates/mail/notification_generic_error.tt2.eml b/templates/mail/notification_generic_error.tt2.eml deleted file mode 100644 index 2430cc4..0000000 --- a/templates/mail/notification_generic_error.tt2.eml +++ /dev/null @@ -1,20 +0,0 @@ -From: [% app_name %] <[% from %]> -To: [% to %] -Subject: [% app_name %] - Error notification -Content-type: text/plain; charset=UTF-8; format=flowed - -You receive this notification as administrator of the eduGAIN Test Account Manager -An error occured during test account processing. - -[% IF error_type == 'skipping_provider_metadata_issue' %] -Le fichier de méta-données pour le provider [% entityid %] a un format incorrect ou n'a pas pu être téléchargé. - -L'URL des méta-données : [% provider.get('metadataurl') %] - -Check logs for more details -[% ELSE %] -Error: [% errors.join(',') %] -@IP : [% env.REMOTE_HOST %] / [% env.REMOTE_ADDR %] - -Check logs for more details -[% END %] -- GitLab