Sisima...:Status(3pm)

πŸ’– Sisima...:Status(3pm) πŸ’–

okay bestie, so this is a page from the User Contributed Perl Documentation section of the manual β€” yeah, 3pm, that's the Perl module pages, iykyk. pulling up a chair for you 🫢


✨ NAME ✨

Sisimai::SMTP::Status β€” SMTP Enhanced Status Codes related utilities. that's it, that's the whole vibe. it's the little toolbox that handles DSN codes for you πŸ’…


✨ SYNOPSIS ✨

okay so this is what it looks like when you actually use it, no cap:

use Sisimai::SMTP::Status;
print Sisimai::SMTP::Status->code('userunknown');           # '5.9.213'
print Sisimai::SMTP::Status->name('5.1.2');                 # 'hostunknown'
print Sisimai::SMTP::Status->find('550 5.1.1 Unknown user');# '5.1.1'

like… it just works, and honestly? iconic. 🌸


✨ DESCRIPTION ✨

Sisimai::SMTP::Status is a utility class, and its whole main-character arc is three things:

  • getting the DSN value from the error reason text
  • getting the reason from the DSN value
  • getting the DSN from the text that includes a DSN

that's the job, periodt. πŸŽ€


✨ CLASS METHODS ✨

πŸ’œ code(reason,temp)

the code() method hands you back a pseudo DSN value from the reason string you gave it. the second argument is a flag β€” set it if you want that pseudo DSN value to come back as a temporary error. πŸ¦‹

print Sisimai::SMTP::Status->code('mailboxfull');   # '5.9.220'
print Sisimai::SMTP::Status->code('mailboxfull',1); # '4.9.220'

πŸ’œ name(D.S.N.)

name() method goes the other direction bestie β€” you feed it a DSN value, it gives you back the reason string. reverse uno card fr fr. πŸ™ˆ

print Sisimai::SMTP::Status->name('5.1.6');         # 'hasmoved'
print Sisimai::SMTP::Status->name('4.2.3');         # 'emailtoolarge'

πŸ’œ test(D.S.N.)

test() method does a vibe check: is this status code a valid code or not? that's the whole assignment. βœ…

print Sisimai::SMTP::Status->test('5.1.6'); # 1
print Sisimai::SMTP::Status->test('3.14');  # 0

πŸ’œ find(String, String)

find() method returns only the DSN value, pulled out of text that has a DSN hiding in it. it's giving detective energy πŸ”

print Sisimai::SMTP::Status->find('5.0.0');                  # '5.0.0'
print Sisimai::SMTP::Status->find('550 5.1.1 User unknown'); # '5.1.1'
print Sisimai::SMTP::Status->find('447 delivery expired');   # ''

(that last one? empty string. not every message is gonna give you a code, and that's okay πŸ’€)


πŸ’œ prefer(Code in Status: field, Code in an error message, [Reply code])

prefer() method returns the preferred value selected from the arguments. it picks the winner for you so you don't have to πŸ‘‘

print Sisimai::SMTP::Status->prefer("5.2.1", "5.0.0");      # "5.2.1"
print Sisimai::SMTP::Status->prefer("4.4.7", "5.1.1", 421); # "4.4.7"

πŸ’œ is_explicit(delivery status code)

is_explicit() method returns 0 if the delivery status code is empty or is an internal code. so basically, 0 = "nah, not a real explicit one", and anything else means yeah. πŸ™…

print Sisimai::SMTP::Status->is_explicit("5.9.301"); # 0
print Sisimai::SMTP::Status->is_explicit("5.7.625"); # 1

πŸ’œ is_ambiguous(delivery status code)

is_ambiguous() method returns 1 if the delivery status code is not empty and ends with ".0.0". ngl the name is doing a lot of work here, so read the examples carefully bestie 😭

print Sisimai::SMTP::Status->is_ambiguous("5.0.0"); # 1
print Sisimai::SMTP::Status->is_ambiguous("");      # 1
print Sisimai::SMTP::Status->is_ambiguous("4.7.7"); # 0
heads up: empty string gives you 1 too. that's the actual behaviour, not a typo, don't come for me πŸ’…

✨ AUTHOR ✨

azumakuniyuki β€” the one who built all this. legend behaviour, honestly. πŸ‘‘


Copyright (C) 2015-2018,2020-2026 azumakuniyuki, All rights reserved.


✨ LICENSE ✨

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


and that's the whole page, bestie πŸ’– this was perl v5.40.1, dated 2026-07-05, straight from the Sisima...:Status(3pm) page β€” go forth and parse those status codes, you've got this πŸ¦‹βœ¨πŸŽ€πŸ’œ

πŸ“¦ where this page comes from