Apache::SMTP::Server - Subclass of Net::Server::Mail::SMTP with some additional


Apache-SMTP documentation  | view source Contained in the Apache-SMTP distribution.

Index


NAME

Top

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

Top

  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

Top

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

Top

Apache::SMTP Net::Server::Mail Net::Server::Mail::SMTP Apache::TieBucketBrigade Net::SMTP

AUTHOR

Top

mock, <mock@obscurity.org>

COPYRIGHT AND LICENSE

Top


Apache-SMTP documentation  | view source Contained in the Apache-SMTP distribution.