#!/usr/bin/perl # we make a "fake" message id by taking the current number of seconds # since the beginning of Unix time and tacking on two random numbers to # the end, in case we are called quicker than 1 second since the last # time we were called. use strict; my $date = `date "+\%s"`; my $hostname = `hostname -d`; chomp($date); chomp($hostname); my $pseudo_rand; open FILE, "<:raw", "/dev/urandom" or die "Couldn't open /dev/urandom !"; sysread(FILE, $pseudo_rand, 1); my $rand1 = ord($pseudo_rand); sysread(FILE, $pseudo_rand, 1); my $rand2 = ord($pseudo_rand); my $message_id = "$date$rand1$rand2\@$hostname"; print "$message_id"; close FILE;