#!/bin/sh # # Copyright 1998 - 2023 Double Precision, Inc. See COPYING for # distribution information. PWD=`pwd` unset LC_CTYPE unset LC_NUMERIC unset LC_TIME unset LC_COLLATE unset LC_MONETARY unset LC_MESSAGES unset LC_PAPER unset LC_NAME unset LC_ADDRESS unset LC_TELEPHONE unset LC_MEASUREMENT unset LC_IDENTIFICATION unset LC_ALL unset VERBOSE if test "$VALGRIND" != "" then VALGRIND="$VALGRIND --tool=memcheck --error-exitcode=1" fi VALGRIND="" set -e $VALGRIND ./testtimer if test "@USE_GDBM@@USE_DB@" != "00" -a -x ../makedat/makedatprog then cat <testsuite.chk foo bar foo.bar.com foobar foobar@foo.bar.com barfoo . EOF $VALGRIND ../makedat/makedatprog testsuite.chk testsuite.tmp testsuite.dat cat <testsuite.recipe if ( gdbmopen("$PWD/testsuite.dat", "W") != 0 ) { exit } FOO=gdbmfetch("foo") echo "FOO: \$FOO" FOO=gdbmfetch("foobar@foo.bar.com", "D") echo "FOO: \$FOO" FOO=gdbmfetch("foobaz@foo.bar.com", "D") echo "FOO: \$FOO" gdbmstore("foobaz@foo.bar.com", "BAR"); FOO=gdbmfetch("foobaz@foo.bar.com", "D") echo "FOO: \$FOO" EOF chmod go-rw testsuite.recipe cat <testsuite.chk FOO: bar FOO: barfoo FOO: foobar FOO: BAR EOF $VALGRIND ./maildrop ./testsuite.recipe teststdin diff teststdin testsuite.chk fi rm -rf testsuite.maildir ../maildir/maildirmake ./testsuite.maildir cat <testsuite.recipe FLAGS="S" to "$PWD/testsuite.maildir" EOF chmod go-rw testsuite.recipe echo "To: testsuite" >teststdin $VALGRIND ./maildrop ./testsuite.recipe testsuite.chk ls testsuite.maildir/cur | sed 's/.*://' | diff -U 3 - testsuite.chk if test "@maildirquota@" = 1 then rm -rf testsuite.maildir ../maildir/maildirmake ./testsuite.maildir cat <testsuite.recipe MAILDIRQUOTA="1C" exception { cc "$PWD/testsuite.maildir" echo "Delivered message one" cc "$PWD/testsuite.maildir" echo "Delivered message two" } echo "Done." exit EOF chmod go-rw testsuite.recipe cat <testsuite.chk Delivered message one Done. EOF echo "To: testsuite" >testsuite.stdin $VALGRIND ./maildrop ./testsuite.recipe testsuite.chk2 diff testsuite.chk2 testsuite.chk fi cat >testsuite.chk <testsuite.recipe <testsuite.recipe <testsuite.recipe <testsuite.recipe <testsuite.maildir2" EOF echo "Subject: testsuite.maildir2" | $VALGRIND ./maildrop testsuite.recipe cat testsuite.maildir2 rm -f testsuite.maildir2 cat <testsuite.recipe if ( 2 && 3 ) { echo "Yes1" } if ( 2 && 0 ) { echo "No1" } if ( 2 & 1 ) { echo "No2" } if ( 2 & 3 ) { echo "Yes2" } a=(4 || 2) echo "Four: \$a" a=(4 | 2) echo "Six: \$a" a=(5 && 3) echo "Three: \$a" a=(5 & 3) echo "One: \$a" a=! 5 echo "Zero: \$a" a= ~5 echo "Minus six: \$a" EOF chmod go-rw testsuite.recipe $VALGRIND ./maildrop ./testsuite.recipe testmsg.$FILENO' < EOF echo "Not dupe: $?" ./reformail -D 2000 testcache.dat < EOF echo "Not dupe: $?" rm -f testcache.dat set -e ./reformail -x from: -x subject: <testmailbot.1 < Return-Path: test2@example.com Subject: Re: test message (fwd) Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Original test message EOF cat >testmailbot.msg <testmailbot.1 < To: toaddress@example.com Cc: ccaddress@example.com X-Newsgroup: alt.test Newsgroups: alt.test.1,alt.test.2 Message-Id: Errors-To: test2@example.com Date: Sun, 22 Nov 2009 11:57:32 -0400 Subject: Re: test message, =?iso-8859-1?Q?H=F3la!?= (fwd) Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Original test message EOF LANG=en_US.utf-8 $VALGRIND ./mailbot -m testmailbot.msg cat testsuite.recipe <testsuite.msg < test EOF $VALGRIND ./maildrop testsuite.recipe testsuite.msg < test EOF $VALGRIND ./maildrop testsuite.recipe testsuite.recipe <, user2@example.com;') exit EOF $VALGRIND ./maildrop testsuite.recipe testmailbot.1 <testmailbot.msg <testmailbot.1 <H=F3la! --zzz-- EOF echo "====================" LANG=en_US.utf-8 $VALGRIND ./mailbot -T forward -F '+++ Forwarded Message +++' -m testmailbot.msg cat testmailbot.1 <Attachment h=F3la! --zzz-- EOF echo "====================" LANG=en_US.utf-8 $VALGRIND ./mailbot -T forward -F '+++ Forwarded Message +++' -m testmailbot.msg cat testmailbot.1 <HTML message only EOF echo "====================" LANG=en_US.utf-8 $VALGRIND ./mailbot -T forward -F '+++ Forwarded Message +++' -m testmailbot.msg cat testmailbot.1 <HTML message only --yyy-- --zzz Content-Type: text/plain Text attachment --zzz-- EOF echo "====================" LANG=en_US.utf-8 $VALGRIND ./mailbot -T forward -F '+++ Forwarded Message +++' -m testmailbot.msg cat Quote level 1 >> Quote level 2 > space EOF LANG=en_US.utf-8 $VALGRIND ./mailbot -T forward -F '+++ Forwarded Message +++' -m testmailbot.msg cat < Quote level 1 >> Quote level 2 > space EOF cat >testmailbot.1 <testmailbot.msg <testsuite.msg <testsuite.recipe <&1 testsuite.msg <testsuite.chk <testsuite.recipe <&1 testsuite.recipe <testsuite.msg <&1 testsuite.recipe < 2 && 2 > 3) { } if ( 1 <= 2 && 2 >= 1 && 1 == 1 && 1 != 2 && "a" lt "b" && "a" le "a" && \ "b" gt "a" && b ge "b" && "a" eq "a" && "a" ne "b") { } 1 | 2; 3 & 1; 1 + 2*3 - 4 / 4 length("abc") exit EOF $VALGRIND ./maildrop -V 9 ./testsuite.recipe 2>&1