Mail::DKIM(3)

πŸ’– Mail::DKIM πŸ’–

okay so hi bestie!! you're looking at the manual page for Mail::DKIM β€” yes, that's the Perl module on the perl manual, and yes, it's the one that signs and verifies Internet mail with DKIM/DomainKey signatures. buckle up, this one's actually iconic.

✨ VERSION ✨

version 1.20240923 β€” that's the one you've got, no cap.

πŸŽ€ SYNOPSIS πŸŽ€

here's the vibe, copy it exactly:

# verify a message
use Mail::DKIM::Verifier;

# create a verifier object
my $dkim = Mail::DKIM::Verifier->new();

# read an email from stdin, pass it into the verifier
while (<STDIN>)
{
    # remove local line terminators
    chomp;
    s/\015$//;

    # use SMTP line terminators
    $dkim->PRINT("$_\015\012");
}
$dkim->CLOSE;

# what is the result of the verify?
my $result = $dkim->result;

like, that's the whole thing. you read a message in, you ask what happened, you get $dkim->result. slay.

🌸 DESCRIPTION 🌸

so this module is literally the whole toolkit for the DKIM and DomainKeys message-signing and verifying standards for Internet mail. it currently tries to implement these specs:

  • RFC4871, for DKIM
  • RFC4870, for DomainKeys
  • draft-ietf-dmarc-arc-protocol-06, for ARC

the module uses an object-oriented interface. you pick one of two different classes depending on whether you're signing or verifying a message. to sign, use the Mail::DKIM::Signer class. to verify, use the Mail::DKIM::Verifier class. simple, eh? πŸ’…

likewise for ARC β€” use the ARC modules Mail::DKIM::ARC::Signer and Mail::DKIM::ARC::Verifier.

and okay, niche but important: if you're sending to test libraries which expect the tags in headers to be sorted, you can set $Mail::DKIM::SORTTAGS to a true value, and all created headers will get sorted keys. iykyk 🫢

πŸ¦‹ SEE ALSO πŸ¦‹

go check these besties out:

πŸ’€ KNOWN BUGS πŸ’€

ngl, if you're hitting problems passing make test, it usually points at a faulty DNS configuration on your machine, or something weird about your OpenSSL libraries. so like… check your own house first bestie πŸ™ˆ

the "author signing policy" component is still under construction. the author signing policy is supposed to identify the practice of the message author, so you could for example reject a message from an author who claims they always sign their messages. see Mail::DKIM::Policy.

please report bugs to the CPAN RT, or github issue tracker:

fr fr report them, don't just suffer in silence 😭

πŸ‘‘ AUTHORS πŸ‘‘

  • Jason Long <jason@long.name>
  • Marc Bradshaw <marc@marcbradshaw.net>
  • Bron Gondwana <brong@fastmailteam.com> (ARC)

🌈 CONTRIBUTORS 🌈

look at this whole squad, literal main character energy:

  • Aaron Thompson <dev@aaront.org>
  • Bron Gondwana <brong@fastmail.fm>
  • Christian Jaeger <ch@christianjaeger.ch>
  • Damien MASCRΓ‰ <damienmascre@free.fr>
  • Giovanni <g.bechis@snb.it>
  • jasonlong <jasonlong@f38efd27-133c-0410-a3cc-a5f95e9cf04f>
  • JosΓ© Borges Ferreira <jose.ferreira@bitsighttech.com>
  • Marc Bradshaw <marc@fastmailteam.com>
  • Martijn van de Streek <martijn@vandestreek.net>
  • Martin H. Sluka <martin@sluka.de>
  • MatthΓ€us Wander <mail@wander.science>
  • Mohammad S Anwar <mohammad.anwar@yahoo.com>

🧚 THANKS 🧚

work on ensuring that this module passes the ARC test suite was generously sponsored by Valimail (https://www.valimail.com/) β€” iconic behaviour, honestly πŸŽ€

  • Copyright (C) 2013 by Messiah College
  • Copyright (C) 2010 by Jason Long
  • Copyright (C) 2017 by Standcore LLC
  • Copyright (C) 2020 by FastMail Pty Ltd

this library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.6 or, at your option, any later version of Perl 5 you may have available.


and that's the page bestie!! πŸ’œ this gem was generated by perl v5.42.0 and stamped 2024-09-23, so if you're quoting it anywhere, that's the era you're quoting. now go sign some mail βœ¨πŸ¦‹

πŸ“¦ where this page comes from