Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

net::smtp::server::client(3pm) [debian man page]

Server::Client(3pm)					User Contributed Perl Documentation				       Server::Client(3pm)

NAME
Net::SMTP::Server::Client - Client session handling for Net::SMTP::Server. SYNOPSIS
use Carp; use Net::SMTP::Server; use Net::SMTP::Server::Client; use Net::SMTP::Server::Relay; $server = new Net::SMTP::Server('localhost', 25) || croak("Unable to handle client connection: $! "); while($conn = $server->accept()) { # We can perform all sorts of checks here for spammers, ACLs, # and other useful stuff to check on a connection. # Handle the client's connection and spawn off a new parser. # This can/should be a fork() or a new thread, # but for simplicity... my $client = new Net::SMTP::Server::Client($conn) || croak("Unable to handle client connection: $! "); # Process the client. This command will block until # the connecting client completes the SMTP transaction. $client->process || next; # In this simple server, we're just relaying everything # to a server. If a real server were implemented, you # could save email to a file, or perform various other # actions on it here. my $relay = new Net::SMTP::Server::Relay($client->{FROM}, $client->{TO}, $client->{MSG}); } DESCRIPTION
The Net::SMTP::Server::Client module implements all the session handling required for a Net::SMTP::Server::Client connection. The above example demonstrates how to use Net::SMTP::Server::Client with Net::SMTP::Server to handle SMTP connections. $client = new Net::SMTP::Server::Client($conn) Net::SMTP::Server::Client accepts one argument that must be a handle to a connection that will be used for communication. Once you have a new client session, simply call: $client->process This processes an SMTP transaction. THIS MAY APPEAR TO HANG -- ESPECIALLY IF THERE IS A LARGE AMOUNT OF DATA BEING SENT. Once this method returns, the server will have processed an entire SMTP transaction, and is ready to continue. Once $client->process returns, various fields have been filled in. Those are: $client->{TO} -- This is an array containing the intended recipients for this message. There may be multiple recipients for any given message. $client->{FROM} -- This is the sender of the given message. $client->{MSG} -- The actual message data. :) AUTHOR AND COPYRIGHT Net::SMTP::Server / SMTP::Server is Copyright(C) 1999, MacGyver (aka Habeeb J. Dihu) <macgyver@tos.net>. ALL RIGHTS RESERVED. You may distribute this package under the terms of either the GNU General Public License or the Artistic License, as specified in the Perl README file. SEE ALSO
Net::SMTP::Server::Server, Net::SMTP::Server::Relay perl v5.10.1 1999-12-28 Server::Client(3pm)

Check Out this Related Man Page

Net::SSLGlue::SMTP(3pm) 				User Contributed Perl Documentation				   Net::SSLGlue::SMTP(3pm)

NAME
Net::SSLGlue::SMTP - make Net::SMTP able to use SSL SYNOPSIS
use Net::SSLGlue::SMTP; my $smtp_ssl = Net::SMTP->new( $host, SSL => 1, SSL_ca_path => ... ); my $smtp_plain = Net::SMTP->new( $host ); $smtp_plain->starttls( SSL_ca_path => ... ); DESCRIPTION
Net::SSLGlue::SMTP extends Net::SMTP so one can either start directly with SSL or switch later to SSL using the STARTTLS command. By default it will take care to verify the certificate according to the rules for SMTP implemented in IO::Socket::SSL. METHODS
new The method "new" of Net::SMTP is now able to start directly with SSL when the argument "<SSL =" 1>> is given. In this case it will not create an IO::Socket::INET object but an IO::Socket::SSL object. One can give the usual "SSL_*" parameter of IO::Socket::SSL to "Net::SMTP::new". starttls If the connection is not yet SSLified it will issue the STARTTLS command and change the object, so that SSL will now be used. The usual "SSL_*" parameter of IO::Socket::SSL will be given. peer_certificate ... Once the SSL connection is established the object is derived from IO::Socket::SSL so that you can use this method to get information about the certificate. See the IO::Socket::SSL documentation. All of these methods can take the "SSL_*" parameter from IO::Socket::SSL to change the behavior of the SSL connection. The following parameters are especially useful: SSL_ca_path, SSL_ca_file Specifies the path or a file where the CAs used for checking the certificates are located. This is typically "etc/ssl/certs" on UNIX systems. SSL_verify_mode If set to 0, verification of the certificate will be disabled. By default it is set to 1 which means that the peer certificate is checked. SSL_verifycn_name Usually the name given as the hostname in the constructor is used to verify the identity of the certificate. If you want to check the certificate against another name you can specify it with this parameter. SEE ALSO
IO::Socket::SSL, Net::SMTP COPYRIGHT
This module is copyright (c) 2008, Steffen Ullrich. All Rights Reserved. This module is free software. It may be used, redistributed and/or modified under the same terms as Perl itself. perl v5.14.2 2012-04-06 Net::SSLGlue::SMTP(3pm)
Man Page