Sisima...:Error(3pm)

πŸ“¦
version 5.0.1 Β· 3 versions
, in ubuntu noble

πŸ’– NAME πŸ’–

Sisimai::SMTP::Error β€” bestie, it's the SMTP Errors related utilities module. That's it, that's the whole vibe. πŸ’…


✨ SYNOPSIS ✨

okay so here's how you actually use it:

use Sisimai::SMTP::Error;
print Sisimai::SMTP::Error->is_permanent('SMTP error message');
print Sisimai::SMTP::Error->soft_or_hard('userunknown', 'SMTP error message');

like, that's the whole entrance exam. you're in. 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

Sisimai::SMTP::Error provides a method to check an SMTP errors. no cap, that's its whole job and it does it beautifully. ✨


πŸ‘‘ CLASS METHODS πŸ‘‘

🌸 is_permanent(String)

is_permanent() checks the given string points an permanent error or not. πŸŽ€

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

so 1 means yeah permanent, 0 means nope, and undef is the little "idk bestie, not even an error" πŸ’€


🧚 soft_or_hard(String, String)

soft_or_hard() returns string 'soft' if given bounce reason is a soft bounce. When the reason is a hard bounce, this method returns 'hard'. If the return value is an empty string, it means that returned email may not be a bounce. πŸ™ˆ

print Sisimai::SMTP::Error->soft_or_hard('userunknown', '5.1.1 No such user');   # 'hard'
print Sisimai::SMTP::Error->soft_or_hard('mailboxfull');                         # 'soft'
print Sisimai::SMTP::Error->soft_or_hard('vacation');                            # ''

so it's giving vibe check for bounces β€” soft, hard, or honestly not even a bounce at all. periodt. πŸ’…


⭐ AUTHOR ⭐

azumakuniyuki 🌟


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


πŸ’œ LICENSE πŸ’œ

This software is distributed under The BSD 2-Clause License. slay, legally speaking. πŸŽ€


okay and for the lil sign-off β€” this whole page is coming at you courtesy of perl v5.38.2 and it was dated 2024-03-03, which is literally in the header and footer of the original, so now you know. 🫢 bye bestie, go check those SMTP errors πŸ’–

πŸ“¦ where this page comes from