Skip to content
Snippets Groups Projects
Commit d28f572c authored by Guillaume ROUSSE's avatar Guillaume ROUSSE
Browse files

MIME-encode emails headers if needed

parent d10a619f
No related branches found
No related tags found
No related merge requests found
......@@ -5,6 +5,7 @@ use warnings;
use CGI;
use DateTime;
use Encode;
use English qw(-no_match_vars);
use Log::Any::Adapter;
use List::MoreUtils qw(uniq);
......@@ -590,7 +591,8 @@ sub req_complete_challenge {
my $tt2 = Template->new({
ENCODING => 'utf8',
PRE_CHOMP => CHOMP_ONE,
INCLUDE_PATH => $self->{configuration}->{setup}->{templates_dir} . "/mail"
INCLUDE_PATH => $self->{configuration}->{setup}->{templates_dir} . "/mail",
FILTERS => { mime => [ sub { return encode("MIME-Header", $_[0]); }, 0 ] },
});
my $template = 'send_authentication_token.tt2.eml';
my $data = {
......
From: eduGAIN Access Check <[% from %]>
To: [% to %]
Subject: eduGAIN Access Check - [% lh.maketext("Test accounts request") %]
Subject: eduGAIN Access Check - [% lh.maketext("Test accounts request") | mime %]
Content-type: text/plain; charset=UTF-8; format=flowed
[% lh.maketext("This is an email challenge automatically sent to you by eduGAIN Access Check.") %]
......
From: eduGAIN Access Check <[% from %]>
To: [% to %]
Subject: eduGAIN Access Check - [% lh.maketext("Test accounts request") %]
Subject: eduGAIN Access Check - [% lh.maketext("Test accounts request") | mime %]
Content-type: text/plain; charset=UTF-8; format=flowed
[% lh.maketext("This is an email challenge automatically sent to you by eduGAIN Access Check.") %]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment