Email::MessageID(3)
β¨ Email::MessageID π
okay so bestie, we're looking at Email::MessageID(3) today β it lives in the User Contributed Perl Documentation corner of the manpage universe, and it's genuinely iconic. Let's get into it π
πΈ NAME πΈ
Email::MessageID β generate world unique message-ids. that's it. that's the whole thing. no cap, that's what it does β¨
π VERSION π
version 1.408 β write it down, iykyk π«Ά
π¦ SYNOPSIS π¦
here's the whole vibe in four lines, literally:
use Email::MessageID;
my $mid = Email::MessageID->new->in_brackets;
print "Message-ID: $mid\x0D\x0A";
look at that. chef's kiss. π₯
π DESCRIPTION π
so message-ids are these headers that identify a message uniquely. are they required? nope β they're optional. but are they highly recommended? YES absolutely, bestie, do it. this software generates a unique message-id for you and honestly it ate. π
π PERL VERSION π
this library should run on perls released even a long time ago. like, it should work on any version of perl released in the last five years. yes, five. the number between four and six. π§
and even though it may work on older versions of perl, there's no guarantee made that the minimum required version won't be increased. the version may be increased for any reason, and there is no promise that patches will be accepted to lower the minimum required perl. so like... don't come for her about downgrading. periodt. π
π METHODS π
β new
my $mid = Email::MessageID->new;
my $new_mid = Email::MessageID->new( host => $myhost );
this class method constructs an Email::MessageID object containing a unique message-id. so easy. you may specify custom "host" and "user" parameters if you're feeling extra π
- by default, the
"host"is generated fromSys::Hostname::hostname. - by default, the
"user"is generated usingTime::HiRes'sgettimeofdayand the process ID.
using these values we have the ability to ensure world uniqueness down to a specific process running on a specific host, and the exact time down to six digits of microsecond precision. world uniqueness, bestie. six digits of microsecond precision. she's precise. β±οΈβ¨
β create_host
my $domain_part = Email::MessageID->create_host;
this method returns the domain part of the message-id. the domain part! specifically! π
β create_user
my $local_part = Email::MessageID->create_user;
this method returns a unique local part for the message-id. it includes some random data and some predictable data β a little chaos, a little structure, the perfect balance honestly π
β in_brackets
when using Email::MessageID directly to populate the "Message-ID" field, be sure to use "in_brackets" to get the string inside angle brackets. angle brackets! the < and > ones! π
header => [
...
'Message-Id' => Email::MessageID->new->in_brackets,
],
and please please please do not make this common mistake:
header => [
...
'Message-Id' => Email::MessageID->new->as_string, # WRONG!
],
β οΈ see that# WRONG!in the comments? that's not me being dramatic, that's the manpage.as_stringis WRONG here. usein_brackets. i'm not mad, i'm just disappointed. π
π AUTHORS π
- Casey West
<casey@geeknest.com> - Ricardo SIGNES
<cpan@semiotic.systems>
π CONTRIBUTORS π
- Aaron Crane
<arc@cpan.org> - Pali
<pali@cpan.org> - Ricardo Signes
<rjbs@semiotic.systems>
π COPYRIGHT AND LICENSE π
this software is copyright (c) 2004 by Casey West.
this is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. free software! go off! πΈ
and that's the whole page bestie π«Ά footer deets so you know exactly which edition you're reading: perl v5.42.0, dated 2023-01-02, serving Email::MessageID(3) realness. mwah πβ¨
π¦ where this page comes from
- opensuse-leap 16.0: perl-Email-MessageID 1.408-bp160.1.12 Β· Artistic-1.0 OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms