Mail::A...er::Base(3)

πŸ’– Mail::AuthenticationResults::Header::Base πŸ’–

okay bestie, so this is the base class for modelling parts of the Authentication Results Header β€” and yes, it's from the User Contributed Perl Documentation set, we love a community moment. 🫢


✨ NAME ✨

Mail::AuthenticationResults::Header::Base β€” the base class for modelling parts of the Authentication Results Header. it's giving "parent to literally everyone in this family tree" energy. πŸ‘‘


🌸 VERSION 🌸

version 2.20250709


πŸ¦‹ DESCRIPTION πŸ¦‹

so basically this is a whole little set of classes that represent the various parts and sub parts of Authentication Results Headers. it's a whole ecosystem, fr fr. 🌈

  • Mail::AuthenticationResults::Header represents a complete Authentication Results Header set
  • Mail::AuthenticationResults::Header::AuthServID represents the AuthServID part of the set
  • Mail::AuthenticationResults::Header::Comment represents a comment
  • Mail::AuthenticationResults::Header::Entry represents a main entry
  • Mail::AuthenticationResults::Header::Group represents a group of parts, typically as a search result
  • Mail::AuthenticationResults::Header::SubEntry represents a sub entry part
  • Mail::AuthenticationResults::Header::Version represents a version part

and here's the structural vibe check of how they all nest together, no cap:

Header
    AuthServID
        Version
        Comment
        SubEntry
    Entry
        Comment
    Entry
        Comment
        SubEntry
            Comment
    Entry
        SubEntry
        SubEntry

Group
    Entry
        Comment
    SubEntry
        Comment
    Entry
        SubEntry

like, look at that nesting. the main character structure. πŸ’…


πŸ‘‘ METHODS πŸ‘‘

new()

Return a new instance of this class. fresh out the box, iconic, brand new. ✨

set_key( $key )

Set the key for this instance.

Croaks if $key is invalid. πŸ’€ so don't be messy with it.

key()

Return the current key for this instance.

Croaks if this instance type can not have a key. like sorry babe, not every type gets a key, that's just the rules. 😭

safe_set_value( $value )

Set the value for this instance.

Munges the value to remove invalid characters before setting. it's doing a lil cleanup first, very responsible of it.

This method also removes some value characters when their inclusion would be likely to break simple parsers. so it's protecting the simple parsers out here, we stan a considerate queen. πŸŽ€

set_value( $value )

Set the value for this instance.

Croaks if the value contains invalid characters. no filtering, no munging, it will simply perish. πŸ’€

value()

Returns the current value for this instance.

stringify( $value )

Returns $value with stringify rules applied.

children()

Returns a listref of this instances children.

Croaks if this instance type can not have children. some types are just not parent material, okay?? πŸ™ˆ

orphan()

Removes the parent for this instance.

Croaks if this instance does not have a parent. you can't be orphaned if you never had a parent bestie, that's not how it works. 😭

copy_children_from( $object )

Copy (clone) all of the children from the given object into this object. adoption arc, slay. 🫢

add_parent( $parent )

Sets the parent for this instance to the supplied object.

Croaks if the relationship between $parent and $self is not valid. so if the family dynamic is toxic, it will simply refuse. 🚩

parent()

Returns the parent object for this instance.

remove_child( $child )

Removes $child as a child of this instance.

Croaks if the relationship between $child and $self is not valid. again, if it's not a valid relationship, hard no.

add_child( $child )

Adds $child as a child of this instance.

Croaks if the relationship between $child and $self is not valid. same energy, same rules. ✨

ancestor()

Returns the top Header object and depth of this child. it's climbing all the way up the family tree to find the actual main character. πŸ‘‘

strict_quotes()

Return the current value of strict quotes flag for this header or for its ancestor if not set locally. so if you didn't set it yourself, it's going up the chain to ask mom, love that for you.

If true, we are stricter about which characters result in a quoted string. strict era. πŸ”₯

set_strict_quotes( $value )

Set the value of strict quotes.

If true, we are stricter about which characters result in a quoted string.

Default false.

as_string_prefix( $header )

Add the prefix to as_string for this object when calledas a child of another objects as_string method call.

ngl that's exactly how it's written in the original β€” calledas β€” and we are NOT fixing it, because the rule is we keep every detail character for character. πŸ’€

as_json()

Return this instance as a JSON serialised string.

as_string()

Returns this instance as a string.

build_string( $header )

Build a string using the supplied Mail::AuthenticationResults::FoldableHeader object.

Apply search rules in $search to this instance and return a Mail::AuthenticationResults::Header::Group object containing the matches.

$search is a HASHREF with the following possible key/value pairs:

  • key β€” Match if the instance key matches the supplied value (string or regex)
  • value β€” Match if the instance value matches the supplied value (string or regex)
  • isa β€” Match is the instance class typs matches the supplied value. This is a lowercase version of the class type, (comment,entry,subentry,etc))
  • has β€” An arrayref of searches, match this class if the supplied search queries would return at least 1 result each
also yes, typs is a typo in the original and we're keeping it exactly as-is because the details are sacred. πŸ™

πŸ’œ AUTHOR πŸ’œ

Marc Bradshaw <marc@marcbradshaw.net>


This software is copyright (c) 2021 by Marc Bradshaw.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.


okay so that's the whole page bestie, you ate that reading session fr fr. πŸ“

this lil sign-off is brought to you by perl v5.42.0, dated 2025-07-25 β€” and it was Mail::A...er::Base(3) the whole time, no cap. periodt. πŸ’…βœ¨

πŸ“¦ where this page comes from