Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
eduGAIN Access Check - Account manager
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
edugain
eduGAIN Access Check - Account manager
Commits
2a599051
Commit
2a599051
authored
6 years ago
by
Guillaume ROUSSE
Browse files
Options
Downloads
Patches
Plain Diff
switch to Email::MIME, as MIME::Lite usage is discouraged
parent
c2a457aa
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
README.md
+2
-1
2 additions, 1 deletion
README.md
conf/manager.conf.in
+0
-2
0 additions, 2 deletions
conf/manager.conf.in
lib/AccountManager/App.pm
+29
-18
29 additions, 18 deletions
lib/AccountManager/App.pm
with
31 additions
and
21 deletions
README.md
+
2
−
1
View file @
2a599051
...
...
@@ -20,7 +20,8 @@ It requires the following CPAN distributions:
*
List-MoreUtils
*
Locale-Maketext-Lexicon
*
Log-Any
*
MIME-Lite
*
Email-MIME
*
Email-Sender
*
Rose-DB-Object
*
Template-Toolkit
*
Text-CSV
...
...
This diff is collapsed.
Click to expand it.
conf/manager.conf.in
+
0
−
2
View file @
2a599051
...
...
@@ -11,8 +11,6 @@ file = /var/log/access-check/manager.log
level = info
[mailer]
# path to sendmail executable
sendmail_path = /usr/sbin/sendmail
# from field use by the account manager
from = edugain-access-check.fqdn
...
...
This diff is collapsed.
Click to expand it.
lib/AccountManager/App.pm
+
29
−
18
View file @
2a599051
...
...
@@ -602,27 +602,38 @@ sub req_complete_challenge {
$tt2
->
process
('
send_authentication_token.tt2.html
',
$data
,
\
$html_content
);
# wrap in message
eval
"
require MIME::Lite
";
eval
"
require Encode
";
my
$message
=
MIME::
Lite
->
new
(
From
=>
sprintf
('
eduGAIN Access Check <%s>
',
$self
->
{
configuration
}
->
{
mailer
}
->
{
from
}),
To
=>
$self
->
{
in
}
->
{
email
},
Subject
=>
Encode::
encode
("
MIME-Header
",
sprintf
('
[eduGAIN Access Check] %s
',
$self
->
{
lh
}
->
maketext
("
Test accounts request
"))),
Type
=>
'
multipart/alternative
',
);
$message
->
attach
(
Type
=>
'
text/plain
',
Data
=>
$text_content
);
$message
->
attach
(
Type
=>
'
text/html
',
Data
=>
$html_content
eval
"
require Email::MIME
";
eval
"
require Email::Sender::Simple
";
my
$email
=
Email::
MIME
->
create
(
header_str
=>
[
'
From
'
=>
sprintf
('
eduGAIN Access Check <%s>
',
$self
->
{
configuration
}
->
{
mailer
}
->
{
from
}),
'
To
'
=>
$self
->
{
in
}
->
{
email
},
'
Subject
'
=>
sprintf
('
[eduGAIN Access Check] %s
',
$self
->
{
lh
}
->
maketext
("
Test accounts request
")),
'
Content-Type
'
=>
'
multipart/alternative
'
],
parts
=>
[
Email::
MIME
->
create
(
attributes
=>
{
content_type
=>
"
text/plain
",
charset
=>
'
utf-8
',
encoding
=>
'
quoted-printable
'
},
body_str
=>
$text_content
),
Email::
MIME
->
create
(
attributes
=>
{
content_type
=>
"
text/html
",
charset
=>
'
utf-8
',
encoding
=>
'
quoted-printable
'
},
body_str
=>
$html_content
),
]
);
# send message
eval
{
$message
->
send_by_send
mail
(
);
Email::Sender::
Simple
->
send
(
$e
mail
);
};
if
(
$EVAL_ERROR
)
{
$self
->
{
logger
}
->
errorf
("
Mail notification error: %s
",
$EVAL_ERROR
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment