Fix dcc_header content corruption.
[exim.git] / test / aux-fixed / 0498.fudge
CommitLineData
9ba4af2b
PH
1# This is a little perl script for test 581. It reads the first failed time
2# from test-stdout, turns it back into an integer, and forces the received
3# time in the -H file of the current message.
4
5use Time::Local;
6
7opendir(DIR, "spool/input");
8while (($_ = readdir(DIR)))
9 {
10 if (/.*-H$/)
11 {
12 $hfile = $_;
13 break;
14 }
15 }
16closedir(DIR);
17
18@months = ("Jan", "Feb", "Mar", "Apr", "May", "Jun",
19 "Jul", "Aug", "Sep", "Oct", "Nov", "Dec");
20
21open(IN, "test-stdout") || die "can't open test-stdout\n";
22
23$_ = <IN>;
24$_ = <IN>;
25$_ = <IN>;
26
27close(IN);
28
29($mday,$mon,$year,$hour,$min,$sec) =
30 /(\d\d)-(\w\w\w)-(\d\d\d\d) (\d\d):(\d\d):(\d\d)/;
31
32for ($i = 0; $i < 12; $i++)
33 {
34 if ($mon eq $months[$i])
35 {
36 $mon = $i;
37 break;
38 }
39 }
40
41$t = timelocal($sec,$min,$hour,$mday,$mon,$year);
42
43open(IN, "spool/input/$hfile") || die "can't open spool/input/$hfile";
44
45open(OUT, ">test-H");
46
47$_ = <IN>; print OUT;
48$_ = <IN>; print OUT;
49$_ = <IN>; print OUT;
50$_ = <IN>;
51print OUT "$t 0\n";
52print OUT while (<IN>);
53
54close(IN);
55close(OUT);
56
57rename("test-H", "spool/input/$hfile") || die "rename failed\n";
58
59# End