What::MTA - Find out about running MTA
$what = What->new( Host => my.domain.org, Port => 25, ); $what->mta; $what->mta_version; $what->mta_banner;
What::MTA is a part of
What package. It provides basic information about running MTA: name, version and banner that MTA prints out upon connection to it. It is not meant to be used directly, but via its interface, class
What. MTA's supported are: Exim, Postfix (version only on localhost), Sendmail, Courier (name only), XMail, MaswMail.
The What::MTA class is a subclass of Net::Cmd and IO::Socket::INET.
This is the constructor for a new What object.
OPTIONS are passed in a hash like fashion, using key and value pairs. Possible options are:
Host - is the name, or address, of the remote host to which a connection to a running service is required to. It may be a single scalar, as defined for the
PeerAddroption in IO::Socket::INET.
Hostis optional, default value is
LocalAddr and LocalPort - These parameters are passed directly to IO::Socket to allow binding the socket to a local port.
Timeout - Maximum time, in seconds, to wait for a response from the server (default: 120)
Port - Port to which to connect to (default: 25)
Debug - Enable debugging information
$what = What->new( Host => 'my.mail.domain' Timeout => 30, Debug => 1, ); $what = What->new( Host => '10.10.10.1', Port => 25, );
Returns the name of the MTA running.
Returns the version of the MTA running.
Returns the banner message which the server replied with when the initial connection was made.
localhost ESMTP Exim 4.60 Mon, 20 Feb 2006 22:38:53 +0000
localhost ESMTP Postfix (Debian/GNU)
galeb.somedomain.org ESMTP Sendmail 8.13.5/8.13.5/Debian-3; Mon, 20 Feb 2006 22:41:04 GMT; (No UCE/UBE) logging access from: localhost(OK)-localhost [127.0.0.1]
<1140475332.2874633136@mast> [XMail 1.22 ESMTP Server] service ready; Mon, 20 Feb 2006 22:42:12 -0000
mast MasqMail 0.2.21 ESMTP
Couldn't create What::MTA object with PeerAddr=localhost, PeerPort=26, Proto=tcp, Timeout=120 at lib/What.pm line 68
Class::Std depends on the following modules:
Please report any bugs or feature requests to
email@example.com, or through the web interface at http://rt.cpan.org.
Lot of code taken from Net::Cmd, without which this class probably wouldn't have been written.
Toni Prug <firstname.lastname@example.org>
Copyright (c) 2006. Toni Prug. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program 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 General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA