From 88ec3433a1bae8c0e55990bf8fa7b638cc8d4766 Mon Sep 17 00:00:00 2001 From: Guillaume Rousse <guillaume.rousse@renater.fr> Date: Fri, 2 Mar 2018 12:15:14 +0100 Subject: [PATCH] use same configuration directives as the registry --- conf/manager.conf.in | 12 ++++++------ lib/AccountManager/App.pm | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/conf/manager.conf.in b/conf/manager.conf.in index 58cd470..3add16e 100644 --- a/conf/manager.conf.in +++ b/conf/manager.conf.in @@ -5,15 +5,9 @@ tokens_validity_period = 2 # Templates directory templates_dir = @templatesdir@ -# From field use by the account manager -notice_from = edugain-access-check.fqdn - # federation metadata local copy path federation_metadata_file = @sysconfdir@/edugain-md.xml -# Path to sendmail executable -sendmail_path = /usr/sbin/sendmail - [app] version = open Beta 1 url = https://my.fqdn/accountmanager @@ -23,6 +17,12 @@ support_email = support@my.fqdn file = /opt/testidp/IdPAccountManager/log/manager.log level = info +[notifier) +# path to sendmail executable +sendmail_path = /usr/sbin/sendmail +# from field use by the account manager +from = edugain-access-check.fqdn + [database] type = mysql host = localhost diff --git a/lib/AccountManager/App.pm b/lib/AccountManager/App.pm index 7d6e146..26d5fec 100644 --- a/lib/AccountManager/App.pm +++ b/lib/AccountManager/App.pm @@ -414,10 +414,10 @@ sub req_complete_challenge { ); } - my $sender = $self->{configuration}->{_}->{notice_from}; - my $recipient = $self->{in}->{email}; - my $sendmail = $self->{configuration}->{_}->{sendmail_path} || + my $sender = $self->{configuration}->{notifier}->{from}; + my $sendmail = $self->{configuration}->{notifier}->{sendmail_path} || '/usr/sbin/sendmail'; + my $recipient = $self->{in}->{email}; open(my $handle, '|-', "$sendmail -f $sender $recipient") or do { $self->{logger}->errorf("Unable to run sendmail executable: %s", $ERRNO); -- GitLab