3 # All this script does is write whatever is piped to it to a unique
4 # filename, with the first line containing the arguments sent.
8 # create a unique filename
9 if (not -d $ENV{SENDMAIL_TESTDIR}) {
10 system('mkdir','-p',$ENV{SENDMAIL_TESTDIR});
13 my $fn = "$ENV{SENDMAIL_TESTDIR}/".time.$$;
15 my $fh = IO::File->new($fn ,'w') or die "Unable to open file $fn for writing: $!";
17 print {$fh} "$0 called with: ", join(' ',map {"'$_'"} @ARGV) or die "Unable to write to file $fn: $!";
19 print {$fh} <STDIN> or die "Unable to write to file $fn: $!";
21 close $fh or die "Unable to close file $fn: $!";