fix send method not noticing when partial sends happen
diff --git a/Lib/imaplib.py b/Lib/imaplib.py
index 005cf16..204148b 100644
--- a/Lib/imaplib.py
+++ b/Lib/imaplib.py
@@ -222,7 +222,13 @@
 
     def send(self, data):
         """Send data to remote."""
-        self.sock.send(data)
+	bytes = len(data)
+	while bytes > 0:
+		sent = self.sock.send(data)
+		if sent == bytes:
+			break	# avoid copy
+		data = data[sent:]
+		bytes = bytes - sent
 
 
     def shutdown(self):