+#
+# Test out some basic email address encoding
+#
+
+cat > "${testname}.basicemail1.actual" <<EOF
+From: Mr Foo Bär <foobar@example.com>
+To: Somebody <somebody@example.com>
+Subject: Impørtant stuff
+
+This is important information
+EOF
+
+cat > "${testname}.basicemail1.expected" <<EOF
+From: =?UTF-8?Q?Mr_Foo_B=C3=A4r?= <foobar@example.com>
+To: Somebody <somebody@example.com>
+Subject: =?UTF-8?Q?Imp=C3=B8rtant_stuff?=
+MIME-Version: 1.0
+Content-Type: text/plain; charset="us-ascii"
+
+This is important information
+EOF
+
+mhbuild "${testname}.basicemail1.actual"
+
+check "${testname}.basicemail1.actual" "${testname}.basicemail1.expected" 'keep first'
+
+run_test 'eval fmttest -outsize max -format "%(decode{from})" -message -file "${testname}.basicemail1.actual"' "Mr Foo Bär <foobar@example.com>"
+run_test 'eval fmttest -outsize max -format "%(decode(friendly{from}))" -message -file "${testname}.basicemail1.actual"' "Mr Foo Bär"
+
+rm -f "${testname}.basicemail1.actual"
+
+cat > "${testname}.basicemail2.actual" <<EOF
+From: foobar@example.com (Mr Foo Bär)
+To: Somebody <somebody@example.com>
+Subject: Impørtant stuff
+
+This is important information
+EOF
+
+cat > "${testname}.basicemail2.expected" <<EOF
+From: foobar@example.com (=?UTF-8?Q?Mr_Foo_B=C3=A4r?=)
+To: Somebody <somebody@example.com>
+Subject: =?UTF-8?Q?Imp=C3=B8rtant_stuff?=
+MIME-Version: 1.0
+Content-Type: text/plain; charset="us-ascii"
+
+This is important information
+EOF
+
+mhbuild "${testname}.basicemail2.actual"
+
+check "${testname}.basicemail2.actual" "${testname}.basicemail2.expected" 'keep first'
+
+run_test 'eval fmttest -outsize max -format "%(decode{from})" -message -file "${testname}.basicemail2.actual"' "foobar@example.com (Mr Foo Bär)"
+run_test 'eval fmttest -outsize max -format "%(decode(friendly{from}))" -message -file "${testname}.basicemail2.actual"' "Mr Foo Bär"
+
+rm -f "${testname}.basicemail2.actual"
+