*** /tmp/pop3d.tcl	2007-06-26 15:38:48.677953040 -0500
--- /tmp/pop3d.tcl.save	2007-06-26 15:38:48.677953040 -0500
***************
*** 9,16 ****
  # 
  # RCS: @(#) $Id: pop3d.tcl,v 1.22 2006/01/10 23:05:19 andreas_kupries Exp $
  
- # Modified by GLH to repair line termination problem with multi-part messages
- 
  package require md5  ; # tcllib | APOP
  package require mime ; # tcllib | storage callback
  package require log  ; # tcllib | tracing
--- 9,14 ----
***************
*** 65,71 ****
  	    "up"		\
  	    ]
  
!     variable version ; set version 1.1.1
      variable server  "tcllib/pop3d-$version"
  
      variable cmdMap ; array set cmdMap {
--- 63,69 ----
  	    "up"		\
  	    ]
  
!     variable version ; set version 1.1.0
      variable server  "tcllib/pop3d-$version"
  
      variable cmdMap ; array set cmdMap {
***************
*** 450,457 ****
      set cstate(size)       0
  
      ::log::log notice "pop3d $name $sock state auth, waiting for logon"
! # GLH changed next line to fix extra CR from mime buildmessage
!     fconfigure $sock -buffering line -translation lf -blocking 0
  
      if {[catch {::pop3d::GreetPeer $name $sock} errmsg]} {
  	close $sock
--- 448,455 ----
      set cstate(size)       0
  
      ::log::log notice "pop3d $name $sock state auth, waiting for logon"
! 
!     fconfigure $sock -buffering line -translation crlf -blocking 0
  
      if {[catch {::pop3d::GreetPeer $name $sock} errmsg]} {
  	close $sock
***************
*** 572,578 ****
  
  proc ::pop3d::Respond2Client {name sock ok wtext} {
      ::log::log info "pop3d $name $sock > $ok $wtext"
!     puts $sock                          "$ok $wtext\r"
      return
  }
  
--- 570,576 ----
  
  proc ::pop3d::Respond2Client {name sock ok wtext} {
      ::log::log info "pop3d $name $sock > $ok $wtext"
!     puts $sock                          "$ok $wtext"
      return
  }
  
***************
*** 596,605 ****
  	    [string equal $state "both"] ||
  	    [string equal $state $cstate(state)]
  	} {
! 	    puts $sock $capability\r
  	}
      }
!     puts $sock .\r
      return
  }
  
--- 594,603 ----
  	    [string equal $state "both"] ||
  	    [string equal $state $cstate(state)]
  	} {
! 	    puts $sock $capability
  	}
      }
!     puts $sock .
      return
  }
  
***************
*** 977,983 ****
  		    [uplevel #0 [linsert $storCmd end \
  		    size $cstate(storage) $i]]
  	}
! 	puts $sock ".\r"
  
      } else {
  	# listing for specified message
--- 975,981 ----
  		    [uplevel #0 [linsert $storCmd end \
  		    size $cstate(storage) $i]]
  	}
! 	puts $sock "."
  
      } else {
  	# listing for specified message
***************
*** 1106,1112 ****
  				       [mime::buildmessage $token]] \n]
  	log::log debug "($msg)"
  	puts $sock $msg
! 	puts $sock .\r
  
      } else {
  	# As long as FR #531541 is not implemented we have to build
--- 1104,1110 ----
  				       [mime::buildmessage $token]] \n]
  	log::log debug "($msg)"
  	puts $sock $msg
! 	puts $sock .
  
      } else {
  	# As long as FR #531541 is not implemented we have to build
***************
*** 1128,1134 ****
  	# i now refers to the line separating header and body
  
  	regsub -- "\n\\.\n$" [string map [list "\n." "\n.."] [join [lrange $msg 0 $limit] \n]] {} data
! 	puts $sock ${data}\n.\r
      }
      ::log::log debug "pop3d $name $sock transfer complete"
      # response already sent.
--- 1126,1132 ----
  	# i now refers to the line separating header and body
  
  	regsub -- "\n\\.\n$" [string map [list "\n." "\n.."] [join [lrange $msg 0 $limit] \n]] {} data
! 	puts $sock ${data}\n.
      }
      ::log::log debug "pop3d $name $sock transfer complete"
      # response already sent.
