# Properly handle -socketcmd as a command prefix
# Remove 8.4'isms (eq operator to compare strings)
#
--- pop3.tcl.orig	2012-01-09 13:52:15.000000000 -0300
+++ pop3.tcl	2012-01-09 14:38:25.000000000 -0300
@@ -287,7 +287,8 @@
     }
     foreach {host user password port} $args break
     if {$port == {}} {
-	if {($cstate(socketcmd) eq "tls::socket") || ($cstate(socketcmd) eq "::tls::socket")} {
+	if {[string equal [lindex $cstate(socketcmd) 0] "tls::socket"]
+	||  [string equal [lindex $cstate(socketcmd) 0] "::tls::socket"]} {
 	    # Standard port for SSL-based pop3 connections.
 	    set port 995
 	} else {
@@ -300,7 +301,7 @@
 
     # Argument processing is finally complete, now open the channel
 
-    set chan [$cstate(socketcmd) $host $port]
+    set chan [eval [linsert $cstate(socketcmd) end $host $port]]
     fconfigure $chan -buffering none
 
     log::log debug "pop3::open | connect on $chan"
