Closed Maxxxxxx-x closed 2 years ago
Update: I have managed to narrow it down to being a 504 Unrecognized Authentication Type, Currently using Port 587 with STARTTLS as true
I resolved the issue by adding in a auth_type to mailer
local mailer, err = mail.new({
host = mail.group.com.hk,
port = 587,
starttls = true, --based on your port
username = Username,
password = "password",
auth_type = "login"
})
if err then
ngx.log(ngx.ERR, "mailer error: ", err)
return ngx.exit(ngx.HTTP_INTERNAL_SERVER_ERROR)
end
It seems like using tls will cause a Lua TCP socket read timed out
With tls set to false, receive_response (line 8) also throws a time out in the while loop's socket:receive() line