Index: openacs-4/packages/acs-mail-lite/tcl/utils-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-mail-lite/tcl/utils-procs.tcl,v diff -u -N -r1.4.10.1 -r1.4.10.2 --- openacs-4/packages/acs-mail-lite/tcl/utils-procs.tcl 10 Sep 2015 08:21:31 -0000 1.4.10.1 +++ openacs-4/packages/acs-mail-lite/tcl/utils-procs.tcl 17 Dec 2016 18:07:35 -0000 1.4.10.2 @@ -26,6 +26,10 @@ the mime::word_encode proc to do it or local code (word_encode is buggy in mime < 1.5.2 ) + A purely tcllib based version would be + [mime::word_encode utf-8 quoted-printable $subject] + but that would miss the safety-belt for newline handling + } { set charset [string toupper $charset] @@ -35,6 +39,20 @@ # 69 = 76 - 7 where 7 is for "=?"+"?Q?+"?=" set maxlen [expr {69 - [string length $charset]}] + # + # Make sure, the subject line does not have surrounding white + # space/new lines + # + set subject [string trim $subject] + + if {[regsub -all {[\r\n]} $subject " " s]} { + ad_log warning "subject line contains line breaks (replaced by space): '$subject' -> '$s'" + set subject $s + } + + # + # set up variables for loop + # set result "" set line "" set i 0