Net::SMTP::Verify - verify SMTP recipient addresses


version 1.04


  use Net::SMTP::Verify;

  my $v = Net::SMTP::Verify->new;
  my $resultset = $v->check(
    100000, # size
    '', # sender
    '', # 1 or more recipients...

  # check overall status

  # check a single result

  # more ways to retrieve results by status...


This class implements checks for verifying SMTP addresses.

It implements the following checks:

check addresses with SMTP MAIL FROM and RCPT TO commands

Check if the MX would accept mail for test addresses.

check of message size

If the mail exchanger (MX) supports the SIZE extension and a size is given the module will pass the message size with the MAIL FROM command.

This will check if the message would exceed message size limits or recipients quotas on the target MX.

check if MX could handle TLS connections

It will check if the STARTTLS extension required to enstablish encrypted TLS connections is supported by the target MX.

check if TLSA record is available

The module could check if a TLSA record has been published for the target MX server.

If such a record has been published the target MX SSL certificate could be verified with DANE.


host (default: undef)

Query this smtp server instead of the MX records.

port (default: 25)

Use a different port.

helo_name (default: hostname() )

Use a helo_name other than the hostname of the system.

timeout (default: 30)

Use this timeout for the SMTP connection.

resolver (default: system resolver)

Use a custom Net::DNS::Resolver object.

The default is:

    dnssec => 1,
    adflag => 1,

The dnssec and adflag is required for the TLSA check.

tlsa (default: 0)

Set to 1 to activate TLSA lookup.

openpgpkey (default: 0)

Set to 1 to activate OPENPGPKEY lookup.

logging_callback (default: sub {})

Set a callback to retrieve log messages.

debug (default: 0)

If set to 1 it will set a logging_callback method to output logs to STDERR.


resolve( $domain )

Tries to resolve a MX to an hostname.

It will choose the first record with the highest priority listed as MX.

When a host is MX for multiple domains it will try to reuse the same host for checks.

check_tlsa( $host, $port )

Check if a TLSA record is available.

check( $size, $sender, $rcpt1, $rcpts...)

Performs check and returns a Net::SMTP::Verify::ResultSet.


Markus Benning <>


This software is Copyright (c) 2015 by Markus Benning <>.

This is free software, licensed under:

  The GNU General Public License, Version 2, June 1991