Sisimai::RFC1894(3pm)
π Sisimai::RFC1894(3pm) β the DSN field bestie π
User Contributed Perl Documentation β¨ Sisimai::RFC1894(3pm)
okay so real quick, this is a man page for a Perl module, and it's literally the cutest little RFC-wrangler you've ever met. buckle up π
πΈ NAME πΈ
Sisimai::RFC1894 β DSN field defined in RFC3464 (obsoletes RFC1894) π¦
β¨ SYNOPSIS β¨
use Sisimai::RFC1894;
print Sisimai::RFC1894->match('From: Nyaan <kijitora@libsisimai.org>'); # 0
print Sisimai::RFC1894->match('Reporting-MTA: DNS; mx.libsisimai.org'); # 1
print Sisimai::RFC1894->match('Final-Recipient: RFC822; cat@nyaan.jp'); # 2
my $v = Sisimai::RFC1894->field('Reporting-MTA: DNS; mx.nyaan.jp');
my $r = Sisimai::RFC1894->field('Status: 5.1.1 (user unknown)');
print Data::Dumper::Dumper $v; # ['reporting-mta', 'dns', 'mx.nyaan.org', 'host', ''];
print Data::Dumper::Dumper $r; # ['status', '', '5.1.1', 'stat', 'user unknown'];
three whole lines of setup and you're already parsing DSN fields, we love a low-effort icon π
π DESCRIPTION π
Sisimai::RFC1894 is out here providing methods for checking or getting DSN fields, and honestly? it ate. π₯
π CLASS METHODS π
"match(String)" π―
match() method checks the argument includes the field defined in RFC3464 or not β and it answers in numbers, no cap.
print Sisimai::RFC1894->match('From: Nyaan <kijitora@libsisimai.org>'); # 0
print Sisimai::RFC1894->match('Reporting-MTA: DNS; mx.libsisimai.org'); # 1
print Sisimai::RFC1894->match('Final-Recipient: RFC822; cat@nyaan.jp'); # 2
so like, 0 means nope, that's just a normal header, 1 means yeah that's a DSN field, 2 means it's a DSN field that also matched a recipient-ish pattern. the vibes are immaculate πΈ
"label(String)" π·οΈ
label() method returns a lower cased field name such as "diagnostic-code" from the given email header or the delivery status field. it's giving "I just want the name, please and thank you" π
print Sisimai::RFC1894->label('Remote-MTA: DNS; mx.nyaan.jp'); # remote-mta
print Sisimai::RFC1894->field('Status: 5.1.1'); # status
print Sisimai::RFC1894->field('Subject: Nyaan'); # subject
print Sisimai::RFC1894->field(''); # undef
π«Ά okay bestie yes, the last three lines literally sayfield, notlabelβ we're keeping it exactly how the page wrote it, character for character, because that's the rule and I don't make the rules (I just enforce them aggressively). π the last one gives youundefwhen you hand it an empty string, which is valid and iconic.
"field(String)" π§
field() method returns the splited values as an array reference from the given string including DSN fields defined in RFC3464. yes, "splited" β that's the original wording, we preserve β¨
my $v = Sisimai::RFC1894->field('Remote-MTA: DNS; mx.nyaan.jp');
my $r = Sisimai::RFC1894->field('Status: 5.1.1');
print Data::Dumper::Dumper $v; # ['remote-mta', 'dns', 'mx.nyaan.org', 'host'];
print Data::Dumper::Dumper $r; # ['status', '', '5.1.1', 'stat'];
the returned array is the whole squad: label, the type thing, the value, a short code, and sometimes a comment chilling at the end π
π¦ AUTHOR π¦
azumakuniyuki β absolute legend, main character energy π
π COPYRIGHT π
Copyright (C) 2018-2026 azumakuniyuki, All rights reserved.
π LICENSE π
This software is distributed under The BSD 2-Clause License. slay, permissive, we love her π
and that's the whole page bestie, no notes π
this beauty is perl v5.40.1, dated 2026-07-05, and yeah β Sisimai::RFC1894(3pm) fr fr. mwah, go parse some DSN fields π«Άβ¨
π¦ where this page comes from
- ubuntu stonking: libsisimai-perl 5.7.0-1 Β· BSD-2-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms