diff options
| author | Florian Zeitz <florob@babelmonkeys.de> | 2012-08-06 23:57:41 +0200 |
|---|---|---|
| committer | Florian Zeitz <florob@babelmonkeys.de> | 2012-08-07 00:01:48 +0200 |
| commit | 32e7a107e2126eef794bf5be897cf7e89d12f83a (patch) | |
| tree | 1e93ffdb53405b8fca4cb518f27763f78105079f | |
| parent | 03ba06f70c9ad5cdc9b49d816490fc28d6dbbdc5 (diff) | |
| download | luasocket-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.lua | 4 |
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 | |||
| 75 | function metat.__index:login(user, password) | 75 | function 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..")) |
| 82 | end | 82 | end |
| 83 | 83 | ||
