NetServer-SMTP

 view release on metacpan or  search on metacpan

SMTP.pm  view on Meta::CPAN

244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
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

SMTP.pm  view on Meta::CPAN

295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
        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.223 second using v1.01-cache-2.11-cpan-8d75d55dd25 )