aboutsummaryrefslogtreecommitdiff
path: root/src/smtp.lua
diff options
context:
space:
mode:
authorDiego Nehab <diego@tecgraf.puc-rio.br>2004-02-04 14:29:11 +0000
committerDiego Nehab <diego@tecgraf.puc-rio.br>2004-02-04 14:29:11 +0000
commit0b2542d1a61fc5425ff65ab3dbf7ba7de174763f (patch)
tree8a6188e11db0c9ef6891c31e8a1bebca050b23b2 /src/smtp.lua
parentf67864f86c7d703325e86b14d0ba33992c52891b (diff)
downloadluasocket-0b2542d1a61fc5425ff65ab3dbf7ba7de174763f.tar.gz
luasocket-0b2542d1a61fc5425ff65ab3dbf7ba7de174763f.tar.bz2
luasocket-0b2542d1a61fc5425ff65ab3dbf7ba7de174763f.zip
Worked on the manual.
Implemented stuffing (needs test) Added cddb and qp examples.
Diffstat (limited to 'src/smtp.lua')
-rw-r--r--src/smtp.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/smtp.lua b/src/smtp.lua
index 25d7f74..8b65e44 100644
--- a/src/smtp.lua
+++ b/src/smtp.lua
@@ -4,7 +4,7 @@ if not LUASOCKET_LIBNAME then error('module requires LuaSocket') end
4local socket = _G[LUASOCKET_LIBNAME] 4local socket = _G[LUASOCKET_LIBNAME]
5if not socket then error('module requires LuaSocket') end 5if not socket then error('module requires LuaSocket') end
6-- create smtp namespace inside LuaSocket namespace 6-- create smtp namespace inside LuaSocket namespace
7local smtp = {} 7local smtp = socket.smtp or {}
8socket.smtp = smtp 8socket.smtp = smtp
9-- make all module globals fall into smtp namespace 9-- make all module globals fall into smtp namespace
10setmetatable(smtp, { __index = _G }) 10setmetatable(smtp, { __index = _G })
@@ -18,6 +18,10 @@ DOMAIN = os.getenv("SERVER_NAME") or "localhost"
18-- default server used to send e-mails 18-- default server used to send e-mails
19SERVER = "localhost" 19SERVER = "localhost"
20 20
21function stuff()
22 return socket.cicle(dot, 2)
23end
24
21-- tries to get a pattern from the server and closes socket on error 25-- tries to get a pattern from the server and closes socket on error
22local function try_receiving(connection, pattern) 26local function try_receiving(connection, pattern)
23 local data, message = connection:receive(pattern) 27 local data, message = connection:receive(pattern)