1 # This is a little perl script that adjusts the "received" time in a -H file,
2 # so that retry timeouts etc can be more easily tested. Its arguments are:
4 # (1) The number of the message on the queue whose time is to be adjusted; 1
5 # for the first message, 2 for the second, etc.
7 # (2) A positive or negative number by which to adjust the received time.
9 $fileno = $ARGV[0] - 1;
12 opendir(DIR, "spool/input");
13 while (($_ = readdir(DIR))) { push(@files, $_) if /.*-H$/; }
18 open(IN, "spool/input/$files[$fileno]") ||
19 die "can't open spool/input/$files[$fileno]";
27 ($rtime,$rest) = $_ =~ /^(\d+)(.*)/;
29 print OUT "$rtime$rest\n";
30 print OUT while (<IN>);
35 rename("test-H", "spool/input/$files[$fileno]") || die "rename failed\n";