aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Zeitz <florob@babelmonkeys.de>2012-08-06 23:57:41 +0200
committerFlorian Zeitz <florob@babelmonkeys.de>2012-08-07 00:01:48 +0200
commit32e7a107e2126eef794bf5be897cf7e89d12f83a (patch)
tree1e93ffdb53405b8fca4cb518f27763f78105079f
parent03ba06f70c9ad5cdc9b49d816490fc28d6dbbdc5 (diff)
downloadluasocket-32e7a107e2126eef794bf5be897cf7e89d12f83a.tar.gz
luasocket-32e7a107e2126eef794bf5be897cf7e89d12f83a.tar.bz2
luasocket-32e7a107e2126eef794bf5be897cf7e89d12f83a.zip
Send SMTP AUTH LOGIN response using tp:send(). Fixes #18
tp:command() uppercases the command. Without a command we would end up with a space in front of the data. Therefore use send() directly here.
-rw-r--r--src/smtp.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/smtp.lua b/src/smtp.lua
index 26808f5..896b536 100644
--- a/src/smtp.lua
+++ b/src/smtp.lua
@@ -75,9 +75,9 @@ end
75function metat.__index:login(user, password) 75function metat.__index:login(user, password)
76 self.try(self.tp:command("AUTH", "LOGIN")) 76 self.try(self.tp:command("AUTH", "LOGIN"))
77 self.try(self.tp:check("3..")) 77 self.try(self.tp:check("3.."))
78 self.try(self.tp:command(mime.b64(user))) 78 self.try(self.tp:send(mime.b64(user) .. "\r\n"))
79 self.try(self.tp:check("3..")) 79 self.try(self.tp:check("3.."))
80 self.try(self.tp:command(mime.b64(password))) 80 self.try(self.tp:send(mime.b64(password) .. "\r\n"))
81 return self.try(self.tp:check("2..")) 81 return self.try(self.tp:check("2.."))
82end 82end
83 83