If you have more than 9 /var/log/maillog.*.gz files, 460.status-mail-rejects complains: Checking for rejected mail hosts: [: /var/log/maillog.10.gz: unexpected operator Fix: Somwhere near [ -f /var/log/maillog.$n* ] && zcat -fc /var/log/maillog.$n* because [ -f /var/log/maillog.$n* ] evaluates to [ -f /var/log/maillog.1.gz /var/log/maillog.10.gz ] and /bin/test doesn't like this. How-To-Repeat: Make sure you have /var/log/maillog.1.gz and /var/log/maillog.10.gz and run 460.status-mail-rejects
On Thu, 10 Aug 2000 06:49:28 +0200, Andre Albsmeier wrote: > If you have more than 9 /var/log/maillog.*.gz files, 460.status-mail-rejects > complains: > > Checking for rejected mail hosts: > [: /var/log/maillog.10.gz: unexpected operator That's because this test is broken: [ -f /var/log/maillog.$n* ] One possible solution is as follows: Index: 460.status-mail-rejects =================================================================== RCS file: /home/ncvs/src/etc/periodic/daily/460.status-mail-rejects,v retrieving revision 1.10 diff -u -d -r1.10 460.status-mail-rejects --- 460.status-mail-rejects 2000/06/30 09:41:15 1.10 +++ 460.status-mail-rejects 2000/08/10 10:27:40 @@ -24,7 +24,13 @@ { while [ $n -ge 0 ] do - [ -f /var/log/maillog.$n* ] && zcat -fc /var/log/maillog.$n* + if [ -f /var/log/maillog.$n ] + then + cat -c /var/log/maillog.$n + elif [ -f /var/log/maillog.$n.gz ] + then + zcat -c /var/log/maillog.$n.gz + fi n=$(($n - 1)) done cat /var/log/maillog This'll work fine until periodic(8) supports alternative compression mechanisms. Ciao, Sheldon.
Responsible Changed From-To: freebsd-bugs->brian I've proposed a patch. Over to the maintainer.
State Changed From-To: open->closed A fix has been committed to -current and (rather prematurely) to -stable.