Haineko::SMTPD::Session - HTTP to SMTP Session class
Haineko::SMTPD::Session manages a connection from HTTP and SMTP session on Haineko server.
use Haineko::SMTPD::Session; my $v = { 'useragent' => 'Mozilla', 'remoteaddr' => '127.0.0.1', 'remoteport' => 62401, }; my $e = Haineko::SMTPD::Session->new( %$v ); $e->addresser( 'kijitora@example.jp' ); $e->recipient( [ 'neko@example.org' ] ); print $e->queueid; # r64CvGQ21769QslMmPPuD2jC print $e->started; # Thu Jul 4 18:00:00 2013 (Time::Piece object) print $e->addresser->user; # kijitora (Haineko::SMTPD::Address object) print $e->recipient->[0]->host; # example.org (Haineko::SMTPD::Address object)
new( %arguments )
new() is a constructor of Haineko::SMTPD::Session
new()
my $e = Haineko::SMTPD::Session->new( 'useragent' => $self->req->headers->user_agent, 'remoteaddr' => $self->req->headers->header('REMOTE_HOST'), 'remoteport' => $self->req->headers->header('REMOTE_PORT'), 'addresser' => 'kijitora@example.jp', 'recipient' => [ 'neko@example.org', 'cat@example.com' ], );
load( Hash reference )
load() is also a constructor of Haineko::SMTPD::Session.
load()
my $v = { 'queueid' => 'r64CvGQ21769QslMmPPuD2jC', 'addresser' => 'kijitora@example.jp', }; my $e = Haineko::SMTPD::Session->load( %$v ); print $e->queueid; # r64CvGQ21769QslMmPPuD2jC print $e->addresser->address; # kijitora@example.jp
make_queueid
make_queueid() generate a queue id string.
make_queueid()
print Haineko::SMTPD::Session->make_queueid; # r64IHFV22109f8KATxdNDSj7 print Haineko::SMTPD::Session->make_queueid; # r64IHJP22111Q9PCwpWX1Pd0 print Haineko::SMTPD::Session->make_queueid; # r64IHV622112od227ioJMxhh
r( SMTP command, Error type [,Message] )
r() sets Haineko::SMTPD::Response object from a SMTP Command and an error type.
r()
my $e = Haineko::SMTPD::Session->new( ... ); print $e->response->dsn; # undef $e->r( 'RCPT', 'rejected' ); print $e->response->dsn; # 5.7.1 print $e->response->code; # 553
damn
damn() returns instance data as a hash reference
damn()
warn Data::Dumper::Dumper $e; $VAR1 = { 'referer' => undef, 'queueid' => 'r64IQ9X22396oA0bjQZIU7rn', 'addresser' => 'kijitora@example.jp', 'response' => { 'dsn' => undef, 'error' => undef, 'message' => undef, 'command' => undef, 'code' => undef }, 'remoteaddr' => '127.0.0.1', 'useragent' => 'CLI', 'timestamp' => { 'unixtime' => 1372929969, 'datetime' => "Wed Jul 17 12:00:27 2013" }, 'stage' => 4, 'remoteport' => 1024 };
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.