diff options
Diffstat (limited to 'src/smtp.lua')
| -rw-r--r-- | src/smtp.lua | 6 |
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 | |||
| 4 | local socket = _G[LUASOCKET_LIBNAME] | 4 | local socket = _G[LUASOCKET_LIBNAME] |
| 5 | if not socket then error('module requires LuaSocket') end | 5 | if not socket then error('module requires LuaSocket') end |
| 6 | -- create smtp namespace inside LuaSocket namespace | 6 | -- create smtp namespace inside LuaSocket namespace |
| 7 | local smtp = {} | 7 | local smtp = socket.smtp or {} |
| 8 | socket.smtp = smtp | 8 | socket.smtp = smtp |
| 9 | -- make all module globals fall into smtp namespace | 9 | -- make all module globals fall into smtp namespace |
| 10 | setmetatable(smtp, { __index = _G }) | 10 | setmetatable(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 |
| 19 | SERVER = "localhost" | 19 | SERVER = "localhost" |
| 20 | 20 | ||
| 21 | function stuff() | ||
| 22 | return socket.cicle(dot, 2) | ||
| 23 | end | ||
| 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 |
| 22 | local function try_receiving(connection, pattern) | 26 | local function try_receiving(connection, pattern) |
| 23 | local data, message = connection:receive(pattern) | 27 | local data, message = connection:receive(pattern) |
