NAME

Sisimai::RFC3463 - D.S.N. related utilities

SYNOPSIS

use Sisimai::RFC3463;
print Sisimai::RFC3463->status('userunknown');             # '5.1.1'
print Sisimai::RFC3463->reason('5.1.2');                   # 'hostunknown'
print Sisimai::RFC3463->getdsn('550 5.1.1 Unknown user');  # '5.1.1'

DESCRIPTION

Sisimai::RFC3463 is utilities for getting D.S.N. value from error reason text, getting the reason from D.S.N. value, and getting D.S.N. from the text including D.S.N.

CLASS METHODS

status( reason )

status() returns D.S.N. value from the specified reason string.

print Sisimai::RFC3463->status('mailboxfull');             # '5.2.2'
print Sisimai::RFC3463->status('mailboxfull','t');         # '4.2.2'

reason( D.S.N. )

reason() returns a reason string from the specified D.S.N. value.

print Sisimai::RFC3463->reason('5.1.6');                   # 'hasmoved'
print Sisimai::RFC3463->reason('4.2.3');                   # 'exceedlimit'

getdsn( String )

getdsn() returns a D.S.N. value only from the text including D.S.N.

print Sisimai::RFC3463->getdsn('5.0.0');                   # '5.0.0'
print Sisimai::RFC3463->getdsn('550 5.1.1 User unknown');  # '5.1.1'

is_softbounce( String )

is_softbounce() returns 1 if the string includes 4xx SMTP status code.

print Sisimai::RFC3463->is_softbounce('422 Temporary rejected');    # 1
print Sisimai::RFC3463->is_softbounce('550 User unknown');          # 0
print Sisimai::RFC3463->is_softbounce('200 OK');                    # -1 

AUTHOR

azumakuniyuki

COPYRIGHT

Copyright (C) 2014-2015 azumakuniyuki <perl.org@azumakuniyuki.org>, All Rights Reserved.

LICENSE

This software is distributed under The BSD 2-Clause License.