| 1 |
#! /bin/sh |
| 2 |
|
| 3 |
. ${srcdir=.}/t.frame |
| 4 |
|
| 5 |
# t.ignore_spam_header |
| 6 |
# |
| 7 |
# bogofilter should remove all copies of the spam |
| 8 |
# header line in the incoming message, i.e. |
| 9 |
# the output file should exactly 1 copy of it. |
| 10 |
|
| 11 |
shn=`./spam_header_name` |
| 12 |
|
| 13 |
cat > "$TMPDIR/input" <<EOF |
| 14 |
From [email protected] Fri Nov 22 11:30:23 2002 |
| 15 |
$shn: blah1 |
| 16 |
$shn: blah2 |
| 17 |
... folded continuation 1 |
| 18 |
... folded continuation 2 |
| 19 |
$shn: blah3 |
| 20 |
|
| 21 |
Friend, |
| 22 |
|
| 23 |
EOF |
| 24 |
|
| 25 |
# check seekable input |
| 26 |
$VAL $BOGOFILTER -p -e -C < "$TMPDIR"/input > "$TMPDIR/output1" |
| 27 |
# check non-seekable input |
| 28 |
cat "$TMPDIR/input" | $VAL $BOGOFILTER -p -e -C > "$TMPDIR/output2" |
| 29 |
|
| 30 |
count1=`grep $shn "$TMPDIR"/output1 | wc -l` |
| 31 |
count2=`grep $shn "$TMPDIR/output2" | wc -l` |
| 32 |
|
| 33 |
if [ $count1 = "1" ] && [ $count2 = "1" ] ; then |
| 34 |
exit 0 |
| 35 |
else |
| 36 |
echo count1: $count1, count2: $count2 |
| 37 |
exit 1 |
| 38 |
fi |