GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Net::Server::Mail::ESMTP::STARTTLS(3) User Contributed Perl Documentation Net::Server::Mail::ESMTP::STARTTLS(3)

Net::Server::Mail::ESMTP::STARTTLS - A module to support the STARTTLS command in Net::Server::Mail::ESMTP

   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');
   }

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.

Please, see Net::Server::Mail

This module has been written by Xavier Guimard <x.guimard@free.fr> using libs written by:
Mytram <rmytram@gmail.com>
Dan Moore "<dan at moore.cx>"

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>

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

Copyright (C) 2009 - Dan Moore <dan at moore.cx>
Copyright (C) 2013 - Mytram <rmytram@gmail.com>
Copyright (C) 2013 - Xavier Guimard <x.guimard@free.fr>

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.

2018-09-19 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.