Sisimai::RFC5322 - Email address related utilities
use Sisimai::RFC5322; print Sisimai::RFC5322->is_emailaddress('neko@example.jp'); # 1 print Sisimai::RFC5322->is_domainpart('example.jp'); # 1 print Sisimai::RFC5322->is_mailerdaemon('neko@example.jp'); # 0
Sisimai::RFC5322 provide methods for checking email address.
is_emailaddress( email address )
is_emailaddress() checks the argument is valid email address or not.
is_emailaddress()
print Sisimai::RFC5322->is_emailaddress( 'neko@example.jp' ); # 1 print Sisimai::RFC5322->is_emailaddress( 'neko%example.jp' ); # 0 my $addr_with_name = [ 'Stray cat <neko@example.jp', '=?UTF-8?B?55m954yr?= <shironeko@example.co.jp>', ]; for my $e ( @$addr_with_name ) { print Sisimai::RFC5322->is_emailaddress( $e ); # 1 }
is_domainpart( Domain )
is_domainpart() checks the argument is valid domain part of a email address or not.
is_domainpart()
print Sisimai::RFC5322->is_domainpart( 'neko@example.jp' ); # 0 print Sisimai::RFC5322->is_domainpart( 'neko.example.jp' ); # 1
is_mailerdaemon() checks the argument is mailer-daemon or not.
is_mailerdaemon()
print Sisimai::RFC5322->is_mailerdaemon( 'neko@example.jp' ); # 0 print Sisimai::RFC5322->is_mailerdaemon( 'mailer-daemon@example.jp' ); # 1
received( String )
received() returns array reference which include host names in the Received header.
received()
my $v = 'from mx.example.org (c1.example.net [192.0.2.1]) by mx.example.jp'; my $r = Sisimai::RFC5322->received( $v ); warn Dumper $r; $VAR1 = [ 'mx.example.org', 'mx.example.jp' ];
azumakuniyuki
Copyright (C) 2014-2016 azumakuniyuki, All rights reserved.
This software is distributed under The BSD 2-Clause License.
To install Sisimai, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Sisimai
CPAN shell
perl -MCPAN -e shell install Sisimai
For more information on module installation, please visit the detailed CPAN module installation guide.