[open-ils-commits] [GIT] Evergreen ILS branch rel_2_9 updated. f26ac9d10c283c9bb5bf86ac0c7ef2cc2e383f77

Evergreen Git git at git.evergreen-ils.org
Fri Apr 29 16:26:55 EDT 2016


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, rel_2_9 has been updated
       via  f26ac9d10c283c9bb5bf86ac0c7ef2cc2e383f77 (commit)
       via  78484aa419267a01f29a1a362894f188f03f40ad (commit)
      from  bfd68d5415a68db63bd5254032fdf363d096e2b9 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit f26ac9d10c283c9bb5bf86ac0c7ef2cc2e383f77
Author: Dan Scott <dscott at laurentian.ca>
Date:   Wed Jan 7 18:22:22 2015 -0500

    LP#1031335 No-op the escape_email_header helper
    
    As suggested by Mike Rylander, keep the escape_email_header helper
    around to avoid breaking templates that already adopted it, but make it
    a no-op as the SendEmail reactor now encodes the email headers of
    interest by default.
    
    Signed-off-by: Dan Scott <dscott at laurentian.ca>
    Signed-off-by: Dan Wells <dbw2 at calvin.edu>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger/Reactor.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger/Reactor.pm
index dd23448..7b96edb 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger/Reactor.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger/Reactor.pm
@@ -71,9 +71,11 @@ $_TT_helpers = {
     },
 
     # encode email headers in UTF-8, per RFC2231
+    # now a no-op as we automatically encode the headers in the SendEmail
+    # reactor, but we need to leave this here to avoid breaking templates
+    # that might have once used it
     escape_email_header => sub {
         my $str = shift;
-        $str = encode("MIME-Header", $str);
         return $str;
     },
 

commit 78484aa419267a01f29a1a362894f188f03f40ad
Author: Pasi Kallinen <pasi.kallinen at pttk.fi>
Date:   Wed Jul 24 09:28:13 2013 +0300

    Fix LP#1031335 by escaping some email headers automatically
    
    Signed-off-by: Pasi Kallinen <pasi.kallinen at pttk.fi>
    Signed-off-by: Dan Scott <dscott at laurentian.ca>
    Signed-off-by: Dan Wells <dbw2 at calvin.edu>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger/Reactor/SendEmail.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger/Reactor/SendEmail.pm
index 5cf08c3..9dd76ee 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger/Reactor/SendEmail.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger/Reactor/SendEmail.pm
@@ -29,6 +29,9 @@ Email is encoded in UTF-8 and the corresponding MIME-Version, Content-Type,
 and Content-Transfer-Encoding headers are set to help mail user agents
 decode the content.
 
+The From, To, Subject, Bcc, Cc, Reply-To and Sender -fields are
+automatically MIME-encoded.
+
 No default template is assumed, and all information other than the
 default_sender that the system provides is expected to be gathered by the
 Event Definition through either Environment or Parameter definitions.
@@ -54,6 +57,12 @@ sub handler {
     my $err;
 
     my $email = Email::Simple->new($text);
+
+    for my $hfield (qw/From To Subject Bcc Cc Reply-To Sender/) {
+	my @headers = $email->header($hfield);
+	$email->header_set($hfield => map { encode("MIME-Header", $_) } @headers) if ($headers[0]);
+    }
+
     $email->header_set('MIME-Version' => '1.0');
     $email->header_set('Content-Type' => "text/plain; charset=UTF-8");
     $email->header_set('Content-Transfer-Encoding' => '8bit');

-----------------------------------------------------------------------

Summary of changes:
 .../lib/OpenILS/Application/Trigger/Reactor.pm     |    4 +++-
 .../Application/Trigger/Reactor/SendEmail.pm       |    9 +++++++++
 2 files changed, 12 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list