sylvain cresto > Net-Server-Mail-ESMTP-AUTH-0.1 > Net::Server::Mail::ESMTP::AUTH

Download:
Net-Server-Mail-ESMTP-AUTH-0.1.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  1
View Bugs
Report a bug
Module Version: 0.1   Source  

Net::Server::Mail::ESMTP::AUTH - An extension to provide support for SMTP Authentification with Net::Server::Mail::ESMTP module

SYNOPSIS ^

  use Net::Server::Mail::ESMTP;
  my @local_domains = qw(example.com example.org);
  my $server = new IO::Socket::INET Listen => 1, LocalPort => 25;

  my $conn;
  while($conn = $server->accept)
  {
    my $esmtp = new Net::Server::Mail::ESMTP socket => $conn;
  
    # activate AUTH extension
    $esmtp->register('Net::Server::Mail::ESMTP::AUTH');

    # adding AUTH handler
    $esmtp->set_callback(AUTH => \&validate_auth);
    $esmtp->process;
  }

  sub validate_auth
  {
    my ($session, $username, $password) = @_;

    if ($username eq 'ROBERT' and $password eq 'TOTO04') {
      # AUTH SUCCESFULL
      return 1;
    } else {
      # AUTH FAILED
      return 0;
    }
  }

FEATURES * AUTH LOGIN method support * AUTH PLAIN method support ^

DESCRIPTION ^

"Net::Server::Mail::ESMTP::AUTH" is an extension to provide ESMTP Authentification support to Net::Server::Mail::ESMTP module. Actually only AUTH LOGIN and AUTH PLAIN methods are supported.

AUTH callback is called with login and password who was given by user's mail client, AUTH callback should return 1 when authentification mechanism was succesfull otherwise 0.

SEE ALSO ^

Please, see Net::Server::Mail::SMTP and Net::Server::Mail::ESMTP for more documentations.

AUTHOR ^

Sylvain Cresto <tost@softhome.net>

BUGS ^

Please send bug-reports to tost@softhome.net.

LICENCE ^

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

COPYRIGHT ^

Copyright (C) 2004 - Sylvain Cresto