[open-ils-commits] [GIT] Evergreen ILS branch rel_2_10 updated. ed96bc57d4473d6ea13b9d56059a48ea90a4cece

Evergreen Git git at git.evergreen-ils.org
Fri Apr 29 16:26:19 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_10 has been updated
       via  ed96bc57d4473d6ea13b9d56059a48ea90a4cece (commit)
       via  a8d5a7ff6ad440b6a973255f2ad5135946c75916 (commit)
      from  d689968905f02aad265e3abc7a168d879ccef69a (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 ed96bc57d4473d6ea13b9d56059a48ea90a4cece
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 a8d5a7ff6ad440b6a973255f2ad5135946c75916
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