NAME
Apache::SMTP::Server - Subclass of Net::Server::Mail::SMTP with some additional methods for getting remote ip and hostname and some config bits from Apache's httpd.conf
SYNOPSIS
use Apache::SMTP::Server;
sub handler {
my $c = shift;
my $ath = Apache::TieBucketBrigade->new_tie($c);
my $smtp = Apache::SMTP::Server->new(
handle_in => $ath,
handle_out => $ath,
);
$smtp->my_config($c);
$smtp->set_callback(HELO => \&validate_hostname);
$smtp->set_callback(RCPT => \&validate_recipient);
$smtp->set_callback(DATA => \&queue_message);
$smtp->set_callback(MAIL => \&validate_sender);
$smtp->process;
Apache::OK;
}
DESCRIPTION
This module is used by Apache::SMTP to add some usefull functions to Net::Server::Mail::SMTP. You probably don't need to subclass it yourself, but you may want to if you need to add more configuration bits. See Apache::SMTP for example of use.
METHODS
- new ( handle_in => IO::Handle, handle_out => IO::Handle )
-
Takes an IO::Handle object for read and write, returns an Net::Server::Mail::SMTP object.
- my_config ( Apache::Connection object )
-
Takes an Apache::Connection object and sets up some config variables.
- get_local_ip
-
returns the ip bound in httpd.conf
- get_hostname
-
returns hostname as given to HELO
- get_remote_ip
-
returns ip of remote host
- get_mailhost
-
returns hostname or ip used for outbound smtp connections from PerlSetVar MailHost my.host.name in httpd.conf
- get_mailport
-
returns port to connect to for outbound smtp connections from PerlSetVar MailPort 25 in httpd.conf
SEE ALSO
Apache::SMTP Net::Server::Mail Net::Server::Mail::SMTP Apache::TieBucketBrigade Net::SMTP
AUTHOR
mock, <mock@obscurity.org>
COPYRIGHT AND LICENSE
Copyright (C) 2004 by Will Whittaker and Ken Simpson
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.2 or, at your option, any later version of Perl 5 you may have available.
1 POD Error
The following errors were encountered while parsing the POD:
- Around line 160:
You forgot a '=back' before '=head1'