NAME

Data::Validate::Mailbox - Verify that the given mailbox exists

VERSION

Version 0.11

SYNOPSIS

Verify that the given mailbox exists.

If you find any issues in using the module, please don't hesitate to email me: Jefp@gmx.de

use Data::Validate::Mailbox;

my $mbx = Data::Validate::Mailbox->new;

# or,
my $mbx = Data::Validate::Mailbox->new(debug => 1,
                                       localhost => 'your-domain.org',
                                       localuser => 'user@your-domain.org',
                                      );

my $res = $mbx->validate('user123@gmx.de'); # or
my $res = $mbx->validate('user123@gmail.com'); # or
my $res = $mbx->validate('user123@hotmail.com'); # or 
...

# 1 means existing, 0 means non-existing
print $res;

Please note,

1. This module just uses Net::SMTP to try to deliver messages to peer MTA. If the remote mailbox doesn't exist, peer MTA will return a message such as "mailbox unavailable".

2. Some email providers don't behave like above, such as Yahoo/AOL, so this module won't work for them.

SUBROUTINES/METHODS

new

New the object.

Please note, for many email providers, you have to provide the correct local hostname/username for sending email to them. The hostname must match the following conditions.

1. It is your valid domain/host name.

2. The hostname has an IP address, and a correct PTR for this IP (PTR match back to hostname).

3. The domain has valid MX records and/or SPF records.

4. The IP has good reputation (not listed in any DNSBL).

If you can't send messages to those providers (either the program dies or it gets 0 always), please setup your right localhost and localuser options in new() method.

validate

Validate if the given mailbox exists. Return 1 for existing, 0 for non-existing.

AUTHOR

Yonghua Peng, <pyh at cpan.org>

BUGS

Please report any bugs or feature requests to bug-data-validate-mailbox at rt.cpan.org, or through the web interface at https://rt.cpan.org/NoAuth/ReportBug.html?Queue=Data-Validate-Mailbox. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

perldoc Data::Validate::Mailbox

You can also look for information at:

ACKNOWLEDGEMENTS

LICENSE AND COPYRIGHT

This software is Copyright (c) 2023 by Yonghua Peng.

This is free software, licensed under:

The Artistic License 2.0 (GPL Compatible)