NetSDS::App::SMTPD(3pm) | User Contributed Perl Documentation | NetSDS::App::SMTPD(3pm) |
NetSDS::App::SMTPD
use NetSDS::App::SMTPD
Needs for work with socket. This module is a parent for NetSDS::App::SMTPD and NetSDS::App::SMTPD::Client and a child of a NetSDS::APP
ITEMS
Provides the smtp protocol bu using Net::Server::Mail::SMTP. Had attributes: smtp - an object of Net::Server::Mail::SMTP, ip - ip of the remote host, headers - ref hash with headers of a message, msg - a body of a message.
ITEMS
This module init a smtp-server.
ITEMS
#!/usr/bin/env perl use strict; use warnings; Receiver->run( infinite => 1, debug => 1, verbose => 1, conf_file => '../conf/mts-receiver.conf', ); 1; package Receiver; use base 'NetSDS::App::SMTPD'; sub process { my $self = shift; my $client = $self->SUPER::process; #do something with msg; my $from = $client->get_header('from'); my $msg = $client->get_msg; ..... return $self; };
or you could reinit process like this:
sub process { my $self = shift; my $client = $self->accept; return unless $client; $client->process; #do something ...... $client->close; return $self; };
Yana Kornienko <yana@netstyle.com.ua>
2021-12-26 | perl v5.32.1 |