1 # max_rcpt and connection_max_messages (2x parallel)
4 # There are deliveries in parallel in this script, and the processes that
5 # run in parallel may not finish in the same order on different hosts. (Indeed,
6 # they always seem to finish in precisely the opposite orders on Linux and
7 # FreeBSD.) For that reason, we do a hacked-up sort on the log file right at
8 # the end, to ensure that the log lines are always in the same order.
64 exim -odq a b c d e f g h
122 # This is the hack to sort the log lines. Search for groups of delivery log
123 # lines (**, =>, and -> lines), and sort them according to the local part of
127 open(IN, "DIR/spool/log/mainlog") ||
128 die "Can't open DIR/spool/log/mainlog: $!\n";
132 for ($i = 0; $i < @lines; $i++)
134 next unless $lines[$i] =~ / \*\* | => | -> /;
135 for ($j = $i + 1; $j < @lines; $j++)
136 { last if $lines[$j] !~ / \*\* | => | -> /; }
138 @sublist = splice @lines, $i, $j - $i;
140 my($x) = $a =~ /(?: \*\* | => | -> )([^@]+)/;
141 my($y) = $b =~ /(?: \*\* | => | -> )([^@]+)/;
145 splice @lines, $i, 0, @sublist;
149 open (OUT, ">DIR/spool/log/mainlog") ||
150 die "Can't open DIR/spool/log/mainlog: $!\n";