Library pop3

POP3 functions.

Copyright © Same as Nmap--See https://nmap.org/book/man-legal.html

Source: https://svn.nmap.org/nmap/nselib/pop3.lua

Functions

capabilities (host, port)

Asks a POP3 server for capabilities.

login_apop (socket, user, pw, challenge)

Try to login using the APOP command.

login_sasl_crammd5 (socket, user, pw)

Try to login using the AUTH command using SASL/CRAM-MD5 method.

login_sasl_login (socket, user, pw)

Try to login using the AUTH command using SASL/Login method.

login_sasl_plain (socket, user, pw)

Try to login using the the AUTH command using SASL/Plain method.

login_user (socket, user, pw)

Try to log in using the USER/PASS commands.

stat (line)

Check a POP3 response for "+OK".

Functions

capabilities (host, port)

Asks a POP3 server for capabilities.

See RFC 2449.

Parameters

host
Host to be queried.
port
Port to connect to.

Return values:

  1. Table containing capabilities or nil on error.
  2. nil or String error message.
login_apop (socket, user, pw, challenge)

Try to login using the APOP command.

Parameters

socket
Socket connected to POP3 server.
user
User string.
pw
Password string.
challenge
String containing challenge from POP3 server greeting.

Return values:

  1. Status (true or false).
  2. Error code if status is false.
login_sasl_crammd5 (socket, user, pw)

Try to login using the AUTH command using SASL/CRAM-MD5 method.

Parameters

socket
Socket connected to POP3 server.
user
User string.
pw
Password string.

Return values:

  1. Status (true or false).
  2. Error code if status is false.
login_sasl_login (socket, user, pw)

Try to login using the AUTH command using SASL/Login method.

Parameters

socket
 
user
User string.
pw
String containing password to login.

Return values:

  1. Status (true or false).
  2. Error code if status is false.
login_sasl_plain (socket, user, pw)

Try to login using the the AUTH command using SASL/Plain method.

Parameters

socket
Socket connected to POP3 server.
user
User string.
pw
Password string.

Return values:

  1. Status (true or false).
  2. Error code if status is false.
login_user (socket, user, pw)

Try to log in using the USER/PASS commands.

Parameters

socket
Socket connected to POP3 server.
user
User string.
pw
Password string.

Return values:

  1. Status (true or false).
  2. Error code if status is false.
stat (line)

Check a POP3 response for "+OK".

Parameters

line
First line returned from an POP3 request.

Return value:

The string "+OK" if found or nil otherwise.