[open-ils-commits] [GIT] Evergreen ILS branch master updated. 6a8a4f077b5739d4732789386abc2148864512b3

Evergreen Git git at git.evergreen-ils.org
Fri Apr 29 16:24:41 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, master has been updated
       via  6a8a4f077b5739d4732789386abc2148864512b3 (commit)
       via  d88e3624ea4296b1804c742389b0bfcd6694ffee (commit)
      from  e6f79f6abe4ae4943c29cdf1c823f8e3d1f21c37 (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 6a8a4f077b5739d4732789386abc2148864512b3
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 d88e3624ea4296b1804c742389b0bfcd6694ffee
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