Sisimai::SMTP::Failure(3pm)

NAME
Sisimai::SMTP::Failure - SMTP Errors related utilities

SYNOPSIS
    use Sisimai::SMTP::Failure;
    print Sisimai::SMTP::Failure->is_temporary('421 SMTP error message');
    print Sisimai::SMTP::Failure->is_permanent('550 SMTP error message');
    print Sisimai::SMTP::Failure->is_softbounce('mailboxfull', 4.2.2 mailbox full');
    print Sisimai::SMTP::Failure->is_hardbounce('userunknown', 5.1.1 user not found');

DESCRIPTION
"Sisimai::SMTP::Failure" provide methods to check an SMTP errors.

CLASS METHODS

  "is_permanent(String)"
is_permanent() method checks the given string points an permanent error or not.

    print Sisimai::SMTP::Failure->is_permanent('5.1.1 User unknown'); # 1
    print Sisimai::SMTP::Failure->is_permanent('4.2.2 Mailbox Full'); # 0
    print Sisimai::SMTP::Failure->is_permanent('2.1.5 Message Sent'); # 0

  "is_temporary(String)"
is_temporary() method checks the given string points an temporary error or not.

    print Sisimai::SMTP::Failure->is_permanent('5.1.1 User unknown'); # 0
    print Sisimai::SMTP::Failure->is_permanent('4.2.2 Mailbox Full'); # 1
    print Sisimai::SMTP::Failure->is_permanent('2.1.5 Message Sent'); # 0

  "is_hardbounce(String, String)"
is_hardbounce() method checks the given reason is a hard bounce or not

    print Sisimai::SMTP::Failure->is_hardbounce('5.1.1 User unknown'); # 1
    print Sisimai::SMTP::Failure->is_hardbounce('4.2.2 Mailbox Full'); # 0
    print Sisimai::SMTP::Failure->is_hardbounce('5.7.27 DKIM failed'); # 0

is_softbounce() method checks the given reason is a soft bounce or not

    print Sisimai::SMTP::Failure->is_softbounce('5.1.1 User unknown'); # 0
    print Sisimai::SMTP::Failure->is_softbounce('4.2.2 Mailbox Full'); # 1
    print Sisimai::SMTP::Failure->is_softbounce('5.7.27 DKIM failed'); # 1

AUTHOR
azumakuniyuki

COPYRIGHT
Copyright (C) 2016-2018,2020-2022,2024 azumakuniyuki, All rights reserved.

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