Mail::S...oString(3)
π Mail::SPF::MacroString π
okay bestie, so this page is the manual for Mail::SPF::MacroString and it comes to you from the User Contributed Perl Documentation collection β¨ like it literally lives in the perl man pages, that's its whole vibe π«Ά
β¨ VERSION β¨
This is version 3.20260331 β that's the one we're working with, no cap πΈ
π¦ SYNOPSIS π¦
π Providing the expansion context early
use Mail::SPF::MacroString;
my $macrostring = Mail::SPF::MacroString->new(
text => '%{ir}.%{v}._spf.%{d2}',
server => $server,
request => $request
);
my $expanded = $macrostring->expand;
π Providing the expansion context late
use Mail::SPF::MacroString;
my $macrostring = Mail::SPF::MacroString->new(
text => '%{ir}.%{v}._spf.%{d2}'
);
my $expanded1 = $macrostring->expand($server, $request1);
$macrostring->context($server, $request2);
my $expanded2 = $macrostring->expand;
π DESCRIPTION π
so a Mail::SPF::MacroString object is literally just a macro string β like, a string with macro stuff in it β and it can be expanded into a plain boring string in the context of an SPF request π
that's the whole assignment bestie
π Constructor π
here's the constructor you get:
new(%options) β returns Mail::SPF::MacroString
creates a brand new SPF record macro string object β¨ iconic behavior honestly
%options is a list of key/value pairs, and it can be any of these lil guys:
textβ Required, bestie, like you cannot skip this one. it's the unexpanded text of your new macro string πserverβ theMail::SPF::Serverobject that gets used when the macro string is expanded. and no, a server object does not have to be attached statically to the macro string β you can totally specify it dynamically when you call theexpandmethod π¦requestβ theMail::SPF::Requestobject that gets used when the macro string is expanded. same deal: a request object does not need to be attached statically, you can specify it dynamically when you callexpandπΈis_explanationβ a boolean that says whether the macro string is an explanation string obtained via anexpmodifier. if it's true, then thec,r, andtmacros are allowed to show up in the macro string; if it's false, they are NOT allowed, and if they show up anyway aMail::SPF::EInvalidMacroexception gets thrown when the macro string is expanded π Defaults to false, periodt.
π Instance methods π
these are the instance methods you get:
text β returns string
returns the unexpanded text of the macro string, simple as π«Ά
context($server, $request) β throws Mail::SPF::EOptionRequired
attaches the given Mail::SPF::Server and Mail::SPF::Request objects as the context for the macro string π
expand β returns string; throws Mail::SPF::EMacroExpansionCtxRequired, Mail::SPF::EInvalidMacroString, Mail::SPF::Result::PermError
expand($server, $request) β returns string; throws Mail::SPF::EMacroExpansionCtxRequired, Mail::SPF::EInvalidMacroString, Mail::SPF::Result::PermError
expands the text of the macro string using either the context you set up earlier with a call to the context() method, or the context you're passing in right now, and hands you back the resulting string π and if you wanna know exactly how macros get expanded, go read RFC 4408, 8, it's all in there π
is_explanation β returns boolean
returns true if the macro string is an explanation string obtained via an exp modifier β¨ (peep the description of the new constructor's is_explanation option for the tea)
stringify β returns string
returns the expanded text of the macro string if a context is attached to the object. returns the unexpanded text if there isn't one π and honestly? you can just use a Mail::SPF::MacroString object directly as a string for the exact same effect, see OVERLOADING below bestie π
πΈ OVERLOADING πΈ
if you use a Mail::SPF::MacroString object as a string, the stringify method is what converts the object into a string β¨ that's it, that's the whole section π
β SEE ALSO β
Mail::SPFMail::SPF::RecordMail::SPF::ServerMail::SPF::Request<http://tools.ietf.org/html/rfc4408>
and for availability, support, and license info, go check the README file that ships with Mail::SPF π
π AUTHORS π
Julian Mehnle <julian@mehnle.net>, Shevek <cpan@anarres.org> π«Ά
and that's the whole page babes π this was perl v5.42.1, dated 2026-04-23, and it came to you as Mail::S...oString(3) from the User Contributed Perl Documentation β slay, go write some SPF records, i believe in you πβ¨
π¦ where this page comes from
- fedora 44: perl-Mail-SPF 3.20260331-1.fc44 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms