Net::Server::Mail::ESMTP::STARTTLS(3pm)

Net::Server::Mail::ESMTP::STARTTLS3pm

A module to support the starttls command in net::server::mail::esmtp

Usage

   use strict;
   use Net::Server::Mail::ESMTP;
   my @local_domains = qw(example.com example.org);
   my $server = IO::Socket::INET->new( Listen => 1, LocalPort => 25 );
   my $conn;
   while($conn = $server->accept)
   {
       my $esmtp = Net::Server::Mail::ESMTP->new(
            socket => $conn,
            SSL_config => {
                SSL_cert_file => 'your_cert.pem',
                SSL_key_file => 'your_key.key',
                # Any other options taken by IO::Socket::SSL
            }
       );
       
       # activate some extensions
       $esmtp->register('Net::Server::Mail::ESMTP::STARTTLS');
       
       # adding optional STARTTLS handler
       $esmtp->set_callback(STARTTLS => \&tls_started);
       $esmtp->process();
       $conn->close();
   }
   
   sub tls_started {
       my ($session) = @_;
       # Now, allow authentication
       $session->register('Net::Server::Mail::ESMTP::AUTH');
   }

Overview

This module conducts a TLS handshake with the client upon receiving the STARTTLS command. It uses IO::Socket::SSL, requiring 1.831+, to perform the handshake and secure traffic.

An additional option, SSL_config, is passed to Net::Server::Mail::ESMTP's constructor. It contains options for IO::Socket::SSL's constructor. Please refer to IO::Socket::SSL's perldoc for details.

Releases

6 releases since Debian 8 (Jessie); the text changed 4 times.

  1. 8
  2. 9
  3. 10
  4. 11
  5. 12–13

Author

This module has been written by Xavier Guimard <[email protected]> using libs written by:

Dan Moore "<dan at moore.cx>"

Availability

Available on CPAN.

anonymous Git repository:

git clone git://github.com/rs/net-server-mail.git

Git repository on the web:

<https://github.com/rs/net-server-mail>

Bugs

Please use CPAN system to report a bug (http://rt.cpan.org/).

From libnet-server-mail-perl 0.28-2 in Debian 13 (Trixie). Parsed by carta from the page's man source.