File: //usr/local/share/man/man3/Email::MessageID.3pm
.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings. \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote. \*(C+ will
.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
.\" nothing in troff, for use with C<>.
.tr \(*W-
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
. ds -- \(*W-
. ds PI pi
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
. ds L" ""
. ds R" ""
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds -- \|\(em\|
. ds PI \(*p
. ds L" ``
. ds R" ''
. ds C`
. ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is >0, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{\
. if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. if !\nF==2 \{\
. nr % 0
. nr F 2
. \}
. \}
.\}
.rr rF
.\" ========================================================================
.\"
.IX Title "Email::MessageID 3"
.TH Email::MessageID 3 "2023-01-01" "perl v5.26.3" "User Contributed Perl Documentation"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH "NAME"
Email::MessageID \- Generate world unique message\-ids.
.SH "VERSION"
.IX Header "VERSION"
version 1.408
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
.Vb 1
\& use Email::MessageID;
\&
\& my $mid = Email::MessageID\->new\->in_brackets;
\&
\& print "Message\-ID: $mid\ex0D\ex0A";
.Ve
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
Message-ids are optional, but highly recommended, headers that identify a
message uniquely. This software generates a unique message-id.
.SH "PERL VERSION"
.IX Header "PERL VERSION"
This library should run on perls released even a long time ago. It should work
on any version of perl released in the last five years.
.PP
Although it may work on older versions of perl, no guarantee is made that the
minimum required version will not 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.
.SH "METHODS"
.IX Header "METHODS"
.SS "new"
.IX Subsection "new"
.Vb 1
\& my $mid = Email::MessageID\->new;
\&
\& my $new_mid = Email::MessageID\->new( host => $myhost );
.Ve
.PP
This class method constructs an Email::MessageID object
containing a unique message-id. You may specify custom \f(CW\*(C`host\*(C'\fR and \f(CW\*(C`user\*(C'\fR
parameters.
.PP
By default, the \f(CW\*(C`host\*(C'\fR is generated from \f(CW\*(C`Sys::Hostname::hostname\*(C'\fR.
.PP
By default, the \f(CW\*(C`user\*(C'\fR is generated using \f(CW\*(C`Time::HiRes\*(C'\fR's \f(CW\*(C`gettimeofday\*(C'\fR
and the process \s-1ID.\s0
.PP
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.
.SS "create_host"
.IX Subsection "create_host"
.Vb 1
\& my $domain_part = Email::MessageID\->create_host;
.Ve
.PP
This method returns the domain part of the message-id.
.SS "create_user"
.IX Subsection "create_user"
.Vb 1
\& my $local_part = Email::MessageID\->create_user;
.Ve
.PP
This method returns a unique local part for the message-id. It includes some
random data and some predictable data.
.SS "in_brackets"
.IX Subsection "in_brackets"
When using Email::MessageID directly to populate the \f(CW\*(C`Message\-ID\*(C'\fR field, be
sure to use \f(CW\*(C`in_brackets\*(C'\fR to get the string inside angle brackets:
.PP
.Vb 4
\& header => [
\& ...
\& \*(AqMessage\-Id\*(Aq => Email::MessageID\->new\->in_brackets,
\& ],
.Ve
.PP
Don't make this common mistake:
.PP
.Vb 4
\& header => [
\& ...
\& \*(AqMessage\-Id\*(Aq => Email::MessageID\->new\->as_string, # WRONG!
\& ],
.Ve
.SH "AUTHORS"
.IX Header "AUTHORS"
.IP "\(bu" 4
Casey West <casey@geeknest.com>
.IP "\(bu" 4
Ricardo \s-1SIGNES\s0 <cpan@semiotic.systems>
.SH "CONTRIBUTORS"
.IX Header "CONTRIBUTORS"
.IP "\(bu" 4
Aaron Crane <arc@cpan.org>
.IP "\(bu" 4
Pali <pali@cpan.org>
.IP "\(bu" 4
Ricardo Signes <rjbs@semiotic.systems>
.SH "COPYRIGHT AND LICENSE"
.IX Header "COPYRIGHT AND LICENSE"
This software is copyright (c) 2004 by Casey West.
.PP
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.