diff --git a/nselib/smtp.lua b/nselib/smtp.lua index 34c4740fa..169a455be 100644 --- a/nselib/smtp.lua +++ b/nselib/smtp.lua @@ -584,6 +584,17 @@ quit = function(socket) socket:close() end +-- Attempts to authenticate with the SMTP server. The supported authentication +-- mechanisms are: LOGIN, PLAIN, CRAM-MD5, DIGEST-MD5 and NTLM. +-- +-- @param socket connected to server. +-- @param username SMTP username. +-- @param password SMTP password. +-- @param mech Authentication mechanism. +-- @return true on success, or false on failures. +-- @return response returned by the SMTP server on success, or an +-- error message on failures. + login = function(socket, username, password, mech) assert(mech == "LOGIN" or mech == "PLAIN" or mech == "CRAM-MD5" or mech == "DIGEST-MD5" or mech == "NTLM",