Haineko::SMTPD::Response - SMTP Response class
SMTP Response class contain SMTP status code, D.S.N. value, response messages, and SMTP command.
use Haineko::SMTPD::Response; my $e = Haineko::SMTPD::Response->r( 'ehlo', 'invalid-domain' ); print $e->dsn; # 5.0.0 print $e->code; # 500 warn Dumper $e->message; $VAR1 = [ 'Invalid domain name' ]; my $v = { 'command' => 'RCPT', message => [ '550 5.1.1 User unknown' ] }; my $f = Haineko::SMTPD::Response->p( %$v ); print $e->dsn; # 5.1.1 print $e->code; # 550 warn Dumper $e->message; $VAR1 = [ '550 5.1.1 User unknown' ];
new( %arguments )
new() is a constructor of Haineko::SMTPD::Response
new()
r( SMTP Command, Error type )
r() creates an Haineko::SMTPD::Response object from specified SMTP command and error type.
r()
p( %arguments )
p() creates an Haineko::SMTPD::Response object from SMTP response message.
p()
my $v = { 'command' => 'MAIL', message => [ '552 5.2.2 Mailbox full' ] }; my $f = Haineko::SMTPD::Response->p( %$v ); print $e->dsn; # 5.2.2 print $e->code; # 552 warn Dumper $e->message; $VAR1 = [ '552 5.2.2 Mailbox full' ];
mesg
mesg() add messages to the instance->message
mesg()
my $f = Haineko::SMTPD::Response->new(); my $v = [ 'new message1', 'new message2' ]; $f->m( $v );
damn
damn() returns instance data as a hash reference
damn()
my $v = { 'command' => 'DATA', message => [ '551 5.7.1 Refused' ] }; my $f = Haineko::SMTPD::Response->p( %$v ); print Data::Dumper::Dumper $e->damn; $VAR1 = { 'dsn' => '5.7.1', 'error' => 1, 'host' => '127.0.0.1', 'code' => '551', 'message' => [ '551 5.7.1 Refused' ], 'command' => 'DATA' }
https://github.com/azumakuniyuki/Haineko
azumakuniyuki <perl.org [at] azumakuniyuki.org>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Haineko, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Haineko
CPAN shell
perl -MCPAN -e shell install Haineko
For more information on module installation, please visit the detailed CPAN module installation guide.