Sisima...ailure(3pm)

πŸ“¦
version 5.7.0 Β· 3 versions
, in ubuntu stonking

πŸ’– NAME πŸ’–

Sisimai::SMTP::Failure β€” SMTP errors related utilities, aka your lil bestie for vibe-checking SMTP errors πŸ¦‹

(It lives in the User Contributed Perl Documentation section, for the record, section 3pm.)


✨ SYNOPSIS ✨

okay so here's the whole vibe, bestie β€” load it up, then ask it questions:

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');

that's it, that's the whole personality πŸ’…


🌸 DESCRIPTION 🌸

Sisimai::SMTP::Failure provide methods to check an SMTP errors. no cap, that's literally the entire job description β€” it hands you the little methods so you can peek at an SMTP error and be like "hmm. is that a you problem or a them problem?" πŸŽ€


πŸ‘‘ 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

so 5.1.1 User unknown gets a 1 (slay, that's permanent fr), and the other two get a fat 0 β€” 4.2.2 Mailbox Full is a temporary girlypop and 2.1.5 Message Sent is just a success message being cute, so neither of them counts πŸ’–

πŸ¦‹ 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
not me noticing the example calls is_permanent in the is_temporary section πŸ‘€ β€” yes bestie, that's exactly how it's written in the docs, and we are keeping it character for character, no editing, periodt. The numbers tell the story anyway: 4.2.2 Mailbox Full is your 1 here, the other two are 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

so 5.1.1 User unknown is a 1 β€” hard bounce energy, main character of bad news 😭 β€” while 4.2.2 Mailbox Full and 5.7.27 DKIM failed both come back 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

and here 5.1.1 User unknown is the 0, while 4.2.2 Mailbox Full and 5.7.27 DKIM failed both hit 1 πŸ™ˆ soft bounce besties, we stay hydrated πŸ“


πŸ’œ AUTHOR πŸ’œ

azumakuniyuki β€” the icon who wrote all this 🫢


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


⭐ LICENSE ⭐

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


and that's a wrap, bestie 🌟 β€” this page was served up fresh on 2026-07-05, running under perl v5.40.1, and it's filed away in Sisima...ailure(3pm). go forth and check those SMTP errors, iykyk πŸ’…βœ¨

πŸ“¦ where this page comes from