| poest documentation | Contained in the poest distribution. |
POEST::Plugin::General - General SMTP commands implemented.
This class implements general SMTP commands, in order to get them out of the way.
There are some SMTP commands that are fairly straight forward to implement, they are implemented here.
Returns the response for HELO.
Returns a simple "Ok" response to ELOH.
Returns the response for NOOP.
Returns the response for QUIT.
The hostname that we run as a primary. This is used when sending the banner.
Casey West, <casey@dyndns.org>
Copyright 2003 DynDNS.org
You may distribute this package under the terms of either the GNU General Public License or the Artistic License, as specified in the Perl README file, with the exception that it may not be placed on physical media for distribution without the prior written approval of the author.
THIS PACKAGE IS PROVIDED WITH USEFULNESS IN MIND, BUT WITHOUT GUARANTEE OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. USE IT AT YOUR OWN RISK.
For more information, please visit http://opensource.dyndns.org
perl, POEST::Server, POEST::Plugin.
| poest documentation | Contained in the poest distribution. |
# $Id: General.pm,v 1.3 2003/04/08 00:27:30 cwest Exp $ package POEST::Plugin::General;
use strict; $^W = 1; use vars qw[$VERSION @ISA]; $VERSION = (qw$Revision: 1.3 $)[1]; use POEST::Plugin; @ISA = qw[POEST::Plugin];
sub EVENTS () { [ qw[ HELO ELOH NOOP QUIT send_banner ] ] }
sub CONFIG () { [ qw[ hostname ] ] } sub send_banner { my ($kernel, $self, $heap) = @_[KERNEL, OBJECT, HEAP]; my $client = $heap->{client}; my $banner = "$self->{hostname} ESMTP poest/v0.1"; $client->put( SMTP_SERVICE_READY, $banner ); } sub HELO { my ($kernel, $self, $heap) = @_[KERNEL, OBJECT, HEAP]; my $client = $heap->{client}; $client->put( SMTP_OK, qq[$self->{hostname} Ok] ); } sub ELOH { my ($kernel, $self, $heap) = @_[KERNEL, OBJECT, HEAP]; my $client = $heap->{client}; $client->put( SMTP_OK, qq[$self->{hostname} Ok] ); } sub NOOP { my $client = $_[HEAP]->{client}; $client->put( SMTP_OK, q[Ok] ); } sub QUIT { my ($kernel, $heap) = @_[KERNEL, HEAP]; my $client = $heap->{client}; $client->put( SMTP_QUIT, q[Bye!] ); $heap->{shutdown_now} = 1; } 1; __END__