1Email::MessageID(3) User Contributed Perl Documentation Email::MessageID(3)
2
3
4
6 Email::MessageID - Generate world unique message-ids.
7
9 version 1.406
10
12 use Email::MessageID;
13
14 my $mid = Email::MessageID->new->in_brackets;
15
16 print "Message-ID: $mid\x0D\x0A";
17
19 Message-ids are optional, but highly recommended, headers that identify
20 a message uniquely. This software generates a unique message-id.
21
23 new
24 my $mid = Email::MessageID->new;
25
26 my $new_mid = Email::MessageID->new( host => $myhost );
27
28 This class method constructs an Email::Address object containing a
29 unique message-id. You may specify custom "host" and "user" parameters.
30
31 By default, the "host" is generated from "Sys::Hostname::hostname".
32
33 By default, the "user" is generated using "Time::HiRes"'s
34 "gettimeofday" and the process ID.
35
36 Using these values we have the ability to ensure world uniqueness down
37 to a specific process running on a specific host, and the exact time
38 down to six digits of microsecond precision.
39
40 create_host
41 my $domain_part = Email::MessageID->create_host;
42
43 This method returns the domain part of the message-id.
44
45 create_user
46 my $local_part = Email::MessageID->create_user;
47
48 This method returns a unique local part for the message-id. It
49 includes some random data and some predictable data.
50
51 in_brackets
52 When using Email::MessageID directly to populate the "Message-ID"
53 field, be sure to use "in_brackets" to get the string inside angle
54 brackets:
55
56 header => [
57 ...
58 'Message-Id' => Email::MessageID->new->in_brackets,
59 ],
60
61 Don't make this common mistake:
62
63 header => [
64 ...
65 'Message-Id' => Email::MessageID->new->as_string, # WRONG!
66 ],
67
69 • Casey West <casey@geeknest.com>
70
71 • Ricardo SIGNES <rjbs@cpan.org>
72
74 Aaron Crane <arc@cpan.org>
75
77 This software is copyright (c) 2004 by Casey West.
78
79 This is free software; you can redistribute it and/or modify it under
80 the same terms as the Perl 5 programming language system itself.
81
82
83
84perl v5.36.0 2022-07-22 Email::MessageID(3)