in reply to Generating Message_id email headers
I would strongly recommend you look into getting the module installed, either locally into your account, or perhaps even by your hosting provider. See Yes, even you can use CPAN and local::lib. It's a pure-Perl module consisting of a single file, so in the worst case you could even just copy the file over.
And in the very worst case, note that the guts of the module Email::MessageID are actually quite short. Although as I said I strongly suggest getting it installed, if you really have no choice, here is a boiled-down version:
# Code derived from Email::MessageID 1.406 by Ricardo Signes # http://cpansearch.perl.org/src/RJBS/Email-MessageID-1.406/lib/Email/ +MessageID.pm use Sys::Hostname::Long qw/hostname_long/; my @CHARS = ('A'..'F','a'..'f',0..9); my %uniq; sub create_mid { my $noise = join '', map {; $CHARS[rand @CHARS] } (0 .. (3 + int rand 6)); my $t = time; my $u = exists $uniq{$t} ? ++$uniq{$t} : (%uniq = ($t => 0))[1]; my $user = join '.', $t . $u, $noise, $$; return '<' . $user . '@' . hostname_long . '>'; }
You can replace hostname_long with hostname from Sys::Hostname if you don't have Sys::Hostname::Long installed.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Generating Message_id email headers
by Anonymous Monk on May 18, 2017 at 23:18 UTC | |
by haukex (Archbishop) on May 19, 2017 at 08:03 UTC | |
by Anonymous Monk on May 19, 2017 at 09:44 UTC |