--- pop3.tcl	Fri Jun 22 12:29:18 2001
+++ pop3.ecs	Mon Oct 22 10:57:18 2001
@@ -173,13 +173,23 @@
 	set sizeStr [::pop3::send $chan "RETR $index"]
 
 	scan $sizeStr {%d %s} size dummy
-	
-	set msgBuffer [read $chan $size]
+
+	set msgBuffer ""
+	while {[gets $chan line] >= 0} {
+	    if {[string equal $line ".\r"]} {
+		break
+	    }	
+	    regsub -- {^\.} $line {} line
+	    append msgBuffer $line "\n"
+	}
+
+#	set msgBuffer [read $chan $size]
+#	puts "msgBuffer($size :: [string length $msgBuffer]): msgBuffer"
 
 	# get the terminating "."
 	# sometimes the gets returns nothing, 
 	# need to get the real terminating "."
-	while {[gets $chan] != ".\r"} {}
+#	while {[gets $chan] != ".\r"} {}
 
 	lappend result $msgBuffer
     }
