2 ######################################################
4 # Test long header line handling (998 chars)
6 ######################################################
10 expected=$MH_TEST_DIR/$$.expected
11 actual=$MH_TEST_DIR/$$.actual
15 awk -v len="$len" 'BEGIN {
16 prefix = "Subject: " len " "
20 print prefix substr(s, length(prefix) + 1)
25 awk '{printf($0 "\r\n")}'
29 # Ensure lines won't get folded
30 echo "mhl: -width 2000" >> "$MMH/profile"
31 trap 'printf "/^mhl:/d\nw\nq\n" | ed - "$MMH/profile"' 0 1 2 15
36 # Write message with long header line
38 msgnum=$(basename $msgfile)
43 Date: Sun, 15 Jul 2018 12:26:59 +0200
49 cat > $expected <<-EOF
50 Date: Sun, 15 Jul 2018 12:26:59 +0200
59 COLUMNS=2000 show $msgnum > $actual 2>&1
60 diff -u $expected $actual
65 # Write message with long header line
67 msgnum=$(basename $msgfile)
72 Date: Sun, 15 Jul 2018 12:26:59 +0200
78 cat > $expected <<-EOF
79 Date: Sun, 15 Jul 2018 12:26:59 +0200
88 COLUMNS=2000 show $msgnum > $actual 2>&1
89 diff -u $expected $actual
94 # Write message with long header line
96 msgnum=$(basename $msgfile)
100 `genlongsubject $len`
101 Date: Sun, 15 Jul 2018 12:26:59 +0200
107 cat > $expected <<-EOF
108 mhl: format error in message 13
113 COLUMNS=2000 show $msgnum > $actual 2>&1
114 diff -u $expected $actual
123 # Write message with long header line
125 msgnum=$(basename $msgfile)
126 cat > $msgfile <<-EOF
127 From: foo@example.edu
129 `genlongsubject $len | addcr`
130 Date: Sun, 15 Jul 2018 12:26:59 +0200
136 cat > $expected <<-EOF
137 Date: Sun, 15 Jul 2018 12:26:59 +0200
138 From: foo@example.edu
140 `genlongsubject $len`
146 COLUMNS=2000 show $msgnum > $actual 2>&1
147 diff -u $expected $actual
152 # Write message with long header line
154 msgnum=$(basename $msgfile)
155 cat > $msgfile <<-EOF
156 From: foo@example.edu
158 `genlongsubject $len | addcr`
159 Date: Sun, 15 Jul 2018 12:26:59 +0200
165 cat > $expected <<-EOF
166 mhl: format error in message 15
171 COLUMNS=2000 show $msgnum > $actual 2>&1
172 diff -u $expected $actual