Apache::SMTP - A simple SMTP server using Apache and mod_perl made simple with


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

Index


NAME

Top

Apache::SMTP - A simple SMTP server using Apache and mod_perl made simple with Apache::TieBucketBrigade

SYNOPSIS

Top

Listen 127.0.0.1:25 <VirtualHost _default_:25> PerlSetVar MailHost some.smtp.server PerlSetVar MailPort 25 PerlModule Apache::SMTP PerlProcessConnectionHandler Apache::SMTP </VirtualHost>

DESCRIPTION

Top

This implements a very simple SMTP server using Apache and mod_perl 2. The current behavior is to immediately send (using Net::SMTP) any mail it receives to the server set using PerlSetVar MailHost on port PerlSetVar MailPort

Because of the above behavior, this module _may_ act as an ***OPEN RELAY*** which is a bad thing. So please do not configure it as such. Instead, subclass this module and write your own validate_sender() and validate_recipient() methods. Alternatively, do not have your mail server allow relaying from this server's ip, and you should be ok.

Also, this module, despite the methods "add_queue" and "queue_message" does not actually implement a queue in the normal MTA sense of the word. Maybe you would like to implement one?

SUBCLASS

You may want to subclass this module and write your own version of the following

validate_hostname
    sub validate_hostname {
        my ($session, $hostname) = @_;
        return(1, 250, "ok");
    }

validate_sender
    sub validate_sender {
        my ($session, $sender) = @_;
        return(1, 250, "ok");
    }




validate_recipient
    sub validate_recipient {
        my ($session, $recipient) = @_;
        return(1, 250, "ok");
    }

queue_message
    sub queue_message {
        my($session, $data) = @_;
        my $msgid = add_queue({mailhost => 'hostname',
                           mailport => '25',
                           mailip => '127.0.0.1',
                           sender => 'foo@example.com',
                           recipients => \('bar@example.com'),
                           data => $$data});
        return(1, 250, "message queued $msgid");
    }




add_queue
    my $msgid = add_queue({mailhost => 'hostname',
                           mailport => '25',          
                           mailip => '127.0.0.1',
                           sender => 'foo@example.com',
                           recipients => \('bar@example.com'),
                           data => 'somestuff'});      

SEE ALSO

Top

Apache::SMTP::Server Apache::TieBucketBrigade Net::Server::Mail::SMTP Net::SMTP mod_perl 2

AUTHOR

Top

mock, <mock@obscurity.org>

COPYRIGHT AND LICENSE

Top


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