Make {bounce,warn}_message_file expanded. Bug 2522
[exim.git] / test / aux-fixed / setrt
CommitLineData
ea49d0e1
PH
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:
3#
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.
6#
7# (2) A positive or negative number by which to adjust the received time.
8
9$fileno = $ARGV[0] - 1;
10$adjust = $ARGV[1];
11
12opendir(DIR, "spool/input");
13while (($_ = readdir(DIR))) { push(@files, $_) if /.*-H$/; }
14closedir(DIR);
15
16@files = sort @files;
17
18open(IN, "spool/input/$files[$fileno]") ||
19 die "can't open spool/input/$files[$fileno]";
20
21open(OUT, ">test-H");
22
23$_ = <IN>; print OUT;
24$_ = <IN>; print OUT;
25$_ = <IN>; print OUT;
26$_ = <IN>;
27($rtime,$rest) = $_ =~ /^(\d+)(.*)/;
28$rtime += $adjust;
29print OUT "$rtime$rest\n";
30print OUT while (<IN>);
31
32close(IN);
33close(OUT);
34
35rename("test-H", "spool/input/$files[$fileno]") || die "rename failed\n";
36
37exit(0);
38
39# End