3 # Common routines for the post tests
8 . "${MH_OBJ_DIR}/test/common.sh"
13 testname="${MH_TEST_DIR}/$$"
16 # Set this for the EHLO command
19 echo "clientname: nosuchhost.example.com" >> ${MHMTSCONF}
22 # One "post" test run. Ok, yeah, we're using "send", but that's just
23 # because it's easier.
24 # $1: output filename for fakesmtp, i.e., the sent message
26 # $3: optional switches for send
29 { "${MH_OBJ_DIR}/test/fakesmtp" "$1" $localport &
32 # The server doesn't always come up fast enough, so sleep and
33 # retry a few times if it fails...
35 for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20; do
36 if send -draft -server 127.0.0.1 -port $localport $3
43 if [ $status -ne 0 ]; then
44 printf '%s: send failed, was fakesmtp given enough time to start?\n' \
52 # It's hard to calculate the exact Date: header post is going to
53 # use, so we'll just use sed to remove the actual date so we can easily
54 # compare it against our "correct" output.
57 sed -e 's/^Date:.*/Date:/' "$1" > "$1".nodate
60 check "$1".nodate "$2"