Net::Inspect::L7::SMTP - guesses and handles SMTP traffic
my $conn = ... my $smtp = Net::Inspect::L7::SMTP->new($conn); my $guess = Net::Inspect::L5::GuessProtocol->new; $guess->attach($smtp); ...
This class extracts SMTP traffic from TCP connections. It provides all hooks required for Net::Inspect::L4::TCP and is usually used together with it. It provides the guess_protocol hook so it can be used with Net::Inspect::L5::GuessProtocol.
Net::Inspect::L4::TCP
guess_protocol
Net::Inspect::L5::GuessProtocol
Hooks provided:
This returns an object for the connection.
Processes new data and returns number of bytes processed. Any data not processed must be sent again with the next call.
$data are the data as string. Gaps are currently not support.
$data
The attached flow object needs to implement the following hooks:
Called on start of SMTP connection to initialize object.
Called when the initial greeting is read. $msg is the full greeting.
Called when a command is read. $cmd is the full command line.
Called when a response is read. $msg is the full response.
Called when a chunk is read inside DATA. Dot-escaping will be removed before calling mail_data End of mail data will be signaled with an empty chunk.
mail_data
Called within the AUTH handshake for the data send from client to server. The data (challenges) from server to client are delivered through response.
response
Called on fatal protocol errors.
To install Net::Inspect, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::Inspect
CPAN shell
perl -MCPAN -e shell install Net::Inspect
For more information on module installation, please visit the detailed CPAN module installation guide.