aboutsummaryrefslogtreecommitdiffstats
path: root/lualib/lua_smtp.lua
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rspamd.com>2023-08-07 11:41:28 +0100
committerVsevolod Stakhov <vsevolod@rspamd.com>2023-08-07 11:41:28 +0100
commit662145d0554de5e769b92dab2d41173a98adcee5 (patch)
treeec28311a0bce6181f248ba7b50304293ad764e44 /lualib/lua_smtp.lua
parentbbd88232db43d18f5e0de5a6502848d4074621c5 (diff)
downloadrspamd-662145d0554de5e769b92dab2d41173a98adcee5.tar.gz
rspamd-662145d0554de5e769b92dab2d41173a98adcee5.zip
[Minor] Reformat all Lua code, no functional changes
Diffstat (limited to 'lualib/lua_smtp.lua')
-rw-r--r--lualib/lua_smtp.lua14
1 files changed, 7 insertions, 7 deletions
diff --git a/lualib/lua_smtp.lua b/lualib/lua_smtp.lua
index 33c69159f..3c403497c 100644
--- a/lualib/lua_smtp.lua
+++ b/lualib/lua_smtp.lua
@@ -47,7 +47,7 @@ local function sendmail(opts, message, callback)
wantcode = wantcode or '2'
if merr then
callback(false, string.format('error on stage %s: %s',
- stage, merr))
+ stage, merr))
if conn then
conn:close()
end
@@ -108,9 +108,9 @@ local function sendmail(opts, message, callback)
local function data_done_cb(merr, mdata)
if no_error_read(merr, mdata, '3') then
if type(message) == 'string' or type(message) == 'userdata' then
- conn:add_write(pre_quit_cb, {message, CRLF.. '.' .. CRLF})
+ conn:add_write(pre_quit_cb, { message, CRLF .. '.' .. CRLF })
else
- table.insert(message, CRLF.. '.' .. CRLF)
+ table.insert(message, CRLF .. '.' .. CRLF)
conn:add_write(pre_quit_cb, message)
end
end
@@ -124,7 +124,7 @@ local function sendmail(opts, message, callback)
-- RCPT phase
local next_recipient
local function rcpt_done_cb_gen(i)
- return function (merr, mdata)
+ return function(merr, mdata)
if no_error_read(merr, mdata) then
if i == #opts.recipients then
conn:add_write(data_cb, 'DATA' .. CRLF)
@@ -136,7 +136,7 @@ local function sendmail(opts, message, callback)
end
local function rcpt_cb_gen(i)
- return function (merr, _)
+ return function(merr, _)
if no_error_write(merr, '2') then
conn:add_read(rcpt_done_cb_gen(i), CRLF)
end
@@ -178,12 +178,12 @@ local function sendmail(opts, message, callback)
if no_error_read(err, data) then
stage = 'helo'
conn:add_write(hello_cb, string.format('HELO %s%s',
- opts.helo, CRLF))
+ opts.helo, CRLF))
end
end
if type(opts.recipients) == 'string' then
- opts.recipients = {opts.recipients}
+ opts.recipients = { opts.recipients }
end
local tcp_opts = lua_util.shallowcopy(opts)