NetServer-SMTP
view release on metacpan or search on metacpan
sub initialise {
=pod
=item initialise()
Called by B<new()> to initialise the new object. Initialisation keys
may be specified as a hash, supplied as a parameter to the new
object, or as a filename or file handle containing a frozen
B<NetServer::SMTP> object which is users to overlay the object.
Recognized keys are:
=over 4
=item myhost
My host name (FQDN)
=item allowed
my ($fn) = shift;
if (ref($fn) !~ /file/i) {
$file = new IO::File($fn, "r") or croak "Could not open $fn\n";
}
my ($frozen) = join( "", $file->getlines() );
$file->close();
($self, @junk) = thaw($frozen);
$self->{spooledfile} = $fn;
return $self;
} elsif (scalar(@_) % 2 == 0) {
# it's an initialisation hash -- overlay it on $self
%$self = (@_);
return $self;
} else {
croak "Don't know how to initialise from [", join("][", @_), "]\n";
}
}
sub respond ($$;@) {
# issue a response code and the corresponding message
# NOTE: SMTP response messages are printf() format strings and
( run in 0.569 second using v1.01-cache-2.11-cpan-26ccb49234f )