#!/bin/sh ###################################################### # # Test bogus headers (no blank line before body, etc.) # ###################################################### if test -z "${MH_OBJ_DIR}"; then srcdir=`dirname "$0"`/../.. MH_OBJ_DIR=`cd "$srcdir" && pwd`; export MH_OBJ_DIR fi . "$MH_OBJ_DIR/test/common.sh" setup_test expected="$MH_TEST_DIR/$$.expected" expected_err="$MH_TEST_DIR/$$.expected_err" actual="$MH_TEST_DIR/$$.actual" actual_err="$MH_TEST_DIR/$$.actual_err" # Write message with bogus header field (missing blank line, really). msgfile="$MH_TEST_DIR/Mail/inbox/11" cat >"$msgfile" <"$expected" < "$actual" 2>&1 check "$expected" "$actual" # check show (mhl) cat >"$expected" < "$actual" 2>&1 check "$expected" "$actual" # check mhshow cat >"$expected" < "$actual" 2>&1 check "$expected" "$actual" # check m_getfld() handling of empty header field msgfile="$MH_TEST_DIR/Mail/inbox/12" printf 'Date: Sat, 12 Jan 2013 09:07:01 -0600\nReceived:' >"$msgfile" cat >"$expected" <"$expected_err" <"$actual" 2>"$actual_err" check "$expected" "$actual" check "$expected_err" "$actual_err" # check m_getfld() handling of excessively long header field name msgfile="$MH_TEST_DIR/Mail/inbox/13" cat >"$msgfile" <"$expected" <"$expected_err" <"$actual" 2>"$actual_err" check "$expected" "$actual" check "$expected_err" "$actual_err" # check m_getfld() handling of long header field name without a colon msgfile="$MH_TEST_DIR/Mail/inbox/14" cat >"$msgfile" <"$expected" <"$expected_err" <"$actual" 2>"$actual_err" check "$expected" "$actual" check "$expected_err" "$actual_err" exit $failed