Tk Library Source Code

Artifact [f88338e219]
Login

Artifact f88338e2195a4b5057190826c75c0f15fa4fafa0:

Attachment "mime.patch.v2" to ticket [1254934fff] added by andreas_kupries 2006-10-03 04:36:24.
Index: modules/mime/mime.tcl
===================================================================
RCS file: /cvsroot/tcllib/tcllib/modules/mime/mime.tcl,v
retrieving revision 1.52
diff -w -u -r1.52 mime.tcl
--- modules/mime/mime.tcl	19 Sep 2006 23:36:17 -0000	1.52
+++ modules/mime/mime.tcl	2 Oct 2006 21:33:49 -0000
@@ -1827,6 +1827,8 @@
                 }
 
                 default {
+		    # Note RFC 2046: See buildmessageaux for details.
+
                     foreach part $state(parts) {
                         puts $channel "\n--$boundary"
                         mime::copymessage $part $channel
@@ -1855,9 +1857,9 @@
             puts $channel ""
 
             if {[string compare $converter ""]} {
-                puts $channel [$converter -mode encode -- $state(string)]
+                puts -nonewline $channel [$converter -mode encode -- $state(string)]
             } else {
-		puts $channel $state(string)
+		puts -nonewline $channel $state(string)
 	    }
         }
 	default {
@@ -2036,9 +2038,9 @@
 		    set size [expr {$size - [string length $X]}]
 		}
 		if {[string compare $converter ""]} {
-		    append result "[$converter -mode encode -- $X]\r\n"
+		    append result [$converter -mode encode -- $X]
 		} else {
-		    append result "$X\r\n"
+		    append result $X
 		}
 	    }
 
@@ -2065,6 +2067,21 @@
                 }
 
                 default {
+		    # Note RFC 2046:
+		    #
+		    # The boundary delimiter MUST occur at the
+		    # beginning of a line, i.e., following a CRLF, and
+		    # the initial CRLF is considered to be attached to
+		    # the boundary delimiter line rather than part of
+		    # the preceding part.
+		    #
+		    # - The above means that the CRLF before $boundary
+		    #   is needed per the RFC, and the parts must not
+		    #   have a closing CRLF of their own. See Tcllib bug
+		    #   1213527, and patch 1254934 for the problems when
+		    #   both file/string brnaches added CRLF after the
+		    #   body parts.
+
                     foreach part $state(parts) {
                         append result "\r\n--$boundary\r\n"
                         append result [buildmessage $part]
@@ -2080,13 +2097,12 @@
         }
 
         string {
-
             append result "\r\n"
 
 	    if {[string compare $converter ""]} {
-		append result "[$converter -mode encode -- $state(string)]\r\n"
+		append result [$converter -mode encode -- $state(string)]
 	    } else {
-		append result "$state(string)\r\n"
+		append result $state(string)
 	    }
         }
 	default {
Index: modules/mime/pkgIndex.tcl
===================================================================
RCS file: /cvsroot/tcllib/tcllib/modules/mime/pkgIndex.tcl,v
retrieving revision 1.16
diff -w -u -r1.16 pkgIndex.tcl
--- modules/mime/pkgIndex.tcl	19 Sep 2006 23:36:17 -0000	1.16
+++ modules/mime/pkgIndex.tcl	2 Oct 2006 21:33:49 -0000
@@ -1,3 +1,3 @@
 if {![package vsatisfies [package provide Tcl] 8.3]} {return}
-package ifneeded mime 1.5   [list source [file join $dir mime.tcl]]
+package ifneeded mime 1.5.1 [list source [file join $dir mime.tcl]]
 package ifneeded smtp 1.4.2 [list source [file join $dir smtp.tcl]]