File: test-header-encode

package info (click to toggle)
mmh 0.4-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 4,976 kB
  • sloc: ansic: 26,132; sh: 6,871; makefile: 680; awk: 74
file content (60 lines) | stat: -rw-r--r-- 1,211 bytes parent folder | download | duplicates (3)
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
#!/bin/sh
######################################################
#
# Test encoding headers according to RFC 2047
#
######################################################

. "$MH_TEST_COMMON"

draft="$MH_TEST_DIR/mhbuild-$$.draft"
export MM_CHARSET=UTF-8

# Subject

cat >"$draft" <<!
From: Mr Foo Bar <foobar@example.com>
To: Somebody <somebody@example.com>
Subject: This is ä test

This is a test
!

runandcheck 'mhbuild "$draft"' <<!
!

runandcheck 'sed "/^Content-ID:/s/:.*/: <TESTID>/" "$draft"' <<!
From: Mr Foo Bar <foobar@example.com>
To: Somebody <somebody@example.com>
Subject: =?UTF-8?Q?This_is_=C3=A4_test?=
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-ID: <TESTID>

This is a test
!


# To + From

cat >"$draft" <<!
From: Jürgen <juergen@example.com>
To: Gönül <goenuel@example.com>
Subject: Names with Umlauts

This is a test
!

runandcheck 'mhbuild "$draft"' <<!
!

runandcheck 'sed "/^Content-ID:/s/:.*/: <TESTID>/" "$draft"' <<!
From: =?UTF-8?Q?J=C3=BCrgen?= <juergen@example.com>
To: =?UTF-8?Q?G=C3=B6n=C3=BCl?= <goenuel@example.com>
Subject: Names with Umlauts
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-ID: <TESTID>

This is a test
!