Mail::M...d::DKIM(3)

okay bestie, welcome to Mail::M...d::DKIM(3) πŸ’– straight out of the User Contributed Perl Documentation, and yes it's a whole vibe. buckle up, we're decoding DKIM headers together πŸŽ€

🌸 NAME 🌸

Mail::Message::Field::DKIM β€” message header field for dkim signatures πŸ’Œ

πŸ¦‹ INHERITANCE πŸ¦‹

look at this family tree, it's giving royal lineage honestly πŸ‘‘

 Mail::Message::Field::DKIM
   is a Mail::Message::Field::Structured
   is a Mail::Message::Field::Full
   is a Mail::Message::Field
   is a Mail::Reporter

✨ SYNOPSIS ✨

here's the little taste test, bestie πŸ“

 my $f = Mail::Message::Field->new('DKIM-Signature' => '...');

 my $g = Mail::Message::Field->new('DKIM-Signature');
 $g->add...

πŸ’… DESCRIPTION πŸ’…

so what does this actually do? it decodes the info chillin' inside a DKIM header. and plot twist β€” you can also build DKIM-Signature headers this way too πŸ› οΈ

but real talk: verification and signing is not yet implemented. so don't come for it, it's doing its best 😭

this implementation is based on RFC6376 β€” iconic, we love a spec-accurate queen πŸ“œ

it also extends "DESCRIPTION" in Mail::Message::Field::Structured. 🫢


🌈 OVERLOADED 🌈

extends "OVERLOADED" in Mail::Message::Field::Structured.

  • overload: "" stringification β€” inherited, see "OVERLOADED" in Mail::Message::Field::Full
  • overload: '""' stringification β€” inherited, see "OVERLOADED" in Mail::Message::Field
  • overload: '0+' numification β€” inherited, see "OVERLOADED" in Mail::Message::Field
  • overload: '<='> numeric comparison β€” inherited, see "OVERLOADED" in Mail::Message::Field
  • overload: bool boolean β€” inherited, see "OVERLOADED" in Mail::Message::Field
  • overload: cmp string comparison β€” inherited, see "OVERLOADED" in Mail::Message::Field

πŸ‘‘ METHODS πŸ‘‘

extends "METHODS" in Mail::Message::Field::Structured. yeah she inherits a LOT. main character energy fr ✨

πŸŽ€ Constructors πŸŽ€

extends "Constructors" in Mail::Message::Field::Structured.

  • $obj->clone() β€” inherited, see "Constructors" in Mail::Message::Field
  • $class->from($field, %options) β€” inherited, see "Constructors" in Mail::Message::Field::Full
  • $class->new($data) β€” inherited, see "METHODS" in Mail::Message::Field::Structured

and here's the option menu, no cap 🍽️

 -Option    --Defined in                      --Default
  attributes  Mail::Message::Field::Structured  <ignored>
  charset     Mail::Message::Field::Full        undef
  datum       Mail::Message::Field::Structured  undef
  encoding    Mail::Message::Field::Full        'q'
  force       Mail::Message::Field::Full        false
  language    Mail::Message::Field::Full        undef

and the values they take:

attributes => \@attributes|\%attributes
charset => $charset
datum => $date
encoding => 'q'|'Q'|'b'|'B'
force => BOOLEAN
language => $language

πŸ¦‹ Attributes πŸ¦‹

extends "Attributes" in Mail::Message::Field::Structured.

  • $obj->Name() β€” inherited, see "Attributes" in Mail::Message::Field
  • $obj->body() β€” inherited, see "Attributes" in Mail::Message::Field
  • $obj->folded() β€” inherited, see "Attributes" in Mail::Message::Field
  • $obj->foldedBody( [$body] ) β€” inherited, see "Attributes" in Mail::Message::Field
  • $obj->name() β€” inherited, see "Attributes" in Mail::Message::Field
  • $obj->unfoldedBody( [$body, [$wrap]] ) β€” inherited, see "Attributes" in Mail::Message::Field
  • $obj->wellformedName( [STRING] ) β€” inherited, see "Attributes" in Mail::Message::Field

πŸ’œ The field πŸ’œ

extends "The field" in Mail::Message::Field::Structured.

  • $any->isStructured( [$name] ) β€” inherited, see "The field" in Mail::Message::Field
  • $obj->length() β€” inherited, see "The field" in Mail::Message::Field
  • $obj->nrLines() β€” inherited, see "The field" in Mail::Message::Field
  • $obj->print( [$fh] ) β€” inherited, see "The field" in Mail::Message::Field
  • $obj->size() β€” inherited, see "The field" in Mail::Message::Field
  • $obj->string( [$wrap] ) β€” inherited, see "The field" in Mail::Message::Field
  • $obj->toDisclose() β€” inherited, see "The field" in Mail::Message::Field

🌸 Access to the body 🌸

extends "Access to the body" in Mail::Message::Field::Structured.

  • $obj->decodedBody(%options) β€” inherited, see "Access to the body" in Mail::Message::Field::Full

✨ Access to the content ✨

extends "Access to the content" in Mail::Message::Field::Structured.

  • $obj->addAttribute(...) β€” attributes are not supported here. nope, not a thing, moving on πŸ™ˆ
  • $obj->addTag($name, $value|@values) β€” add a tag to the set. when the tag already exists, it gets replaced. names are (converted to) lower-case. when multiple values are given, they get concatenated with a blank (and may get folded there later) πŸŽ€
  • $obj->addresses() β€” inherited, see "Access to the content" in Mail::Message::Field
  • $obj->attrPairs() β€” inherited, see "Access to the content" in Mail::Message::Field::Structured
  • $obj->attribute( $object|<STRING, %options>|<$name,$value,%options> ) β€” inherited, see "Access to the content" in Mail::Message::Field::Structured
  • $obj->attributes() β€” inherited, see "Access to the content" in Mail::Message::Field::Structured
  • $obj->beautify() β€” inherited, see "Access to the content" in Mail::Message::Field::Full
  • $obj->comment( [STRING] ) β€” inherited, see "Access to the content" in Mail::Message::Field
  • $any->createComment(STRING, %options) β€” inherited, see "Access to the content" in Mail::Message::Field::Full
  • $any->createPhrase(STRING, %options) β€” inherited, see "Access to the content" in Mail::Message::Field::Full
  • $any->dateToTimestamp(STRING) β€” inherited, see "Access to the content" in Mail::Message::Field
  • $any->stripCFWS( [STRING] ) β€” inherited, see "Access to the content" in Mail::Message::Field
  • $obj->study() β€” inherited, see "Access to the content" in Mail::Message::Field
  • $obj->tag($name) β€” returns the value for the named tag 🏷️
  • $any->toDate( [$time] ) β€” inherited, see "Access to the content" in Mail::Message::Field
  • $obj->toInt() β€” inherited, see "Access to the content" in Mail::Message::Field

🏷️ DKIM-Signature tags 🏷️

okay so these tag methods return the tag-value content without any validation or modification. for many situations, the actual content does not need (expensive) validation and interpretation. so it's fast, it's chill, it's lowkey unbothered πŸ’…

  • $obj->tagAgentID() β€” the Agent or User Identifier (AUID). defaults to @$domain
  • $obj->tagAlgorithm() β€” signature algorithm. should be rsa-sha(1|256): check before use. Required.
  • $obj->tagBodyLength() β€” the number of octets which where used to calculate the hash. by default, the whole body was used.
  • $obj->tagC14N() β€” the canonicalization method used. defaults to 'simple/simple'.
  • $obj->tagDomain() β€” the sub-domain (SDID) which claims responsibility for this signature. Required.
  • $obj->tagExpires() β€” the timestamp when the signature will expire. Recommended.
  • $obj->tagExtract() β€” some headers from the original message packed together.
  • $obj->tagQueryMethods() β€” a colon-separated list of method which can be used to retrieve the public key. the default is "dns/txt" (currently the only valid option)
  • $obj->tagSelector() β€” the selector subdividing the domain tag. Required.
  • $obj->tagSignData()
  • $obj->tagSignature() β€” message signature in base64, with whitespaces removed. Required.
  • $obj->tagSignedHeaders() β€” the colon separated list of headers which need to be included in the signature. Required.
  • $obj->tagTimestamp() β€” when the signature was created in UNIX-like seconds (since 1970). Recommended.
  • $obj->tagVersion() β€” signature header syntax version (usually 1)

🧚 Internals 🧚

extends "Internals" in Mail::Message::Field::Structured.

  • $any->decode(STRING, %options) β€” inherited, see "Internals" in Mail::Message::Field::Full
  • $obj->encode(STRING, %options) β€” inherited, see "Internals" in Mail::Message::Field::Full

πŸ“ Parsing πŸ“

extends "Parsing" in Mail::Message::Field::Structured.

  • $obj->consume( $line | <$name,<$body|$objects>> ) β€” inherited, see "Parsing" in Mail::Message::Field
  • $any->consumeComment(STRING) β€” inherited, see "Parsing" in Mail::Message::Field::Full
  • $obj->consumeDotAtom(STRING) β€” inherited, see "Parsing" in Mail::Message::Field::Full
  • $any->consumePhrase(STRING) β€” inherited, see "Parsing" in Mail::Message::Field::Full
  • $obj->datum( [$value] ) β€” inherited, see "Parsing" in Mail::Message::Field::Structured
  • $obj->defaultWrapLength( [$length] ) β€” inherited, see "Parsing" in Mail::Message::Field
  • $any->fold( $name, $body, [$maxchars] ) β€” inherited, see "Parsing" in Mail::Message::Field
  • $obj->parse(STRING) β€” inherited, see "Parsing" in Mail::Message::Field::Full
  • $obj->produceBody() β€” inherited, see "Parsing" in Mail::Message::Field::Full
  • $obj->setWrapLength( [$length] ) β€” inherited, see "Parsing" in Mail::Message::Field
  • $obj->stringifyData(STRING|ARRAY|$objects) β€” inherited, see "Parsing" in Mail::Message::Field
  • $obj->unfold(STRING) β€” inherited, see "Parsing" in Mail::Message::Field

πŸ’€ Error handling πŸ’€

extends "Error handling" in Mail::Message::Field::Structured.

  • $obj->AUTOLOAD() β€” inherited, see "Error handling" in Mail::Reporter
  • $obj->notImplemented() β€” inherited, see "Error handling" in Mail::Reporter

🌈 Cleanup 🌈

extends "Cleanup" in Mail::Message::Field::Structured.

  • $obj->DESTROY() β€” inherited, see "Cleanup" in Mail::Reporter

πŸ’– DETAILS πŸ’–

extends "DETAILS" in Mail::Message::Field::Structured.

πŸ’– DIAGNOSTICS πŸ’–

okay bestie, this is the part where the module yells at you. not in a mean way!! just in a "girl, what did you do" way. every one of these has a vibe, a reason, and a function that throws it. let's get into it 🫢


  • Error: class $package does not implement method $method.
fatal. like, actually fatal.

So the deal is: this specific $package β€” or literally any of its superclasses β€” doesn't implement this method, even though it's supposed to. The messy part? Some other related classes do implement it, which is why it looks like it should work. It doesn't. Bestie should probably go investigate this, and honestly? Probably tell the author of the package about it too. πŸ’€

Cast by notImplemented()

  • Warning: field content is not numerical: $content

You asked for the numeric value of a field β€” think Lines or Content-Length, those are supposed to be numbers β€” but the data inside is giving weird-character energy instead. Not numerical. Not slay. 😭

Cast by toInt()

  • Error: field name too long (max $count), in '$name'.

So the RFCs never actually said how long a field name is allowed to be?? iconic of them. But the vibe is clear: it should be at least a few characters shorter than the line wrap. Your name is longer than that. Too long, babes.

Cast by fold()

  • Warning: illegal character in charset '$name'.

You're creating the field with a utf8 string that only contains data from the specified character set β€” cute β€” but that character set can never be a valid name, because it's carrying characters that just aren't permitted. πŸ’…

Cast by encode()

  • Warning: illegal character in field name $name.

A new field is being created and its name has characters the RFCs said absolutely not to. Using this field in messages may break other e-mail clients or transfer agents, which means they might mutilate or straight-up extinguish your message. yes, extinguish. πŸ”₯

Cast by consume()

  • Warning: illegal character in language '$name'.

The field is being created with data that's specified to be in a certain language, but the name of that language can't be valid β€” it's got characters the RFCs don't permit. nope. πŸ™ˆ

Cast by encode()

  • Warning: illegal encoding '$name', using 'q'.

The RFCs only allow base64 (b or B ) or quoted-printable (q or Q). That's it. Four options. Anything else is illegal, so we're just defaulting you to 'q' and moving on. periodt.

Cast by encode()

  • Error: no attributes for DKIM headers.

It's simply not possible to add attributes to this field. That's the whole tea. πŸ“

Cast by addAttribute()


🌈 SEE ALSO 🌈

This module is part of Mail-Message version 4.04, built on February 04, 2026. Website: http://perl.overmeer.net/CPAN/


πŸŽ€ LICENSE πŸŽ€

For contributors see file ChangeLog.

This software is copyright (c) 2001-2026 by Mark Overmeer.

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


and that's a wrap, bestie!! πŸ¦‹ the page you just read came from perl v5.42.0, dated 2026-02-05, and yes, the title in the corner is that same gloriously truncated Mail::M...d::DKIM(3) πŸ’œ go forth and sign your mail, icon πŸ‘‘βœ¨

πŸ“¦ where this page comes from