summaryrefslogtreecommitdiff
path: root/regress/base/multipart_io.sh
blob: 40a9ac096e696aff90424fd30b19320bc75657c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/sh
#
# $FML: multipart_io.sh,v 1.10 2001/06/17 09:00:29 fukachan Exp $
#

PERL="perl -I ../lib -I ../../fml/lib -I ../../cpan/lib -I ../../img/lib"

dir=`dirname $0`

tmp=/tmp/buf$$

trap "rm -f $tmp" 0 1 3 15


DIFF () {
	local msg=$1
	local file=`basename $msg`
 
	sed -n '1,/^$/p' $msg > $tmp
	$PERL $dir/multipart_io.pl $msg  >> $tmp

	ok=0
	diff -ub $msg $tmp > /dev/null && ok=1 || ok=0 
	if [ $ok = 1 ];then
		printf "%-40s ... %s\n" `basename $file` "ok"
	else
		printf "%-40s ... %s\n" `basename $file` "fail"
	fi
}


echo "=> basic message"
xdir=$dir/../testmails

for x in $xdir/text*
do
   env test_mode=1 $PERL ../message/basic_io.pl $x
done


echo "=> multipart"
xdir=$dir/../testmails

for x in $xdir/multipart*
do
   DIFF $x
done

echo "=> errormails"
# echo "   ++ errormails/ has broken multipart messages ;0"
xdir=$dir/../errormails

# ../errormails has broken multipart messages ;0
grep -i -l multipart $xdir/[a-z]*[a-z0-9] |\
grep -v odn.ne.jp |\
while read file
do
	DIFF $file
done
# echo "   ++ errormails/ test ends"; echo ""

exit 0;