[PATCH] test: test parsing of malformed from addresses

David Bremner david at tethera.net
Wed May 24 16:53:12 PDT 2017

This was previously tested in T200-thread-naming.sh, but failures due
to changes in address parsing were confusing because they had nothing
to do with threads.

At the moment this is broken with gmime-3.0, and I'm not sure it's
really easily fixable:


 test/T050-new.sh | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/test/T050-new.sh b/test/T050-new.sh
index ffa303ef..18291ce5 100755
--- a/test/T050-new.sh
+++ b/test/T050-new.sh
@@ -140,6 +140,12 @@ ln -s "$external_msg_filename" "$gen_msg_filename"
 output=$(NOTMUCH_NEW --debug)
 test_expect_equal "$output" "Added 1 new message to the database."
+test_begin_subtest "Index malformed from address."
+add_message '[subject]="test subject"' \
+            '[date]="Sat, 13 Jan 2001 15:43:45 -0000"' \
+            '[from]="Malformed From \<malformed_from at notmuchmail.org\>"'
+output=$(notmuch search --sort=newest-first from:malformed_from at notmuchmail.org | notmuch_search_sanitize)
+test_expect_equal "$output" "thread:XXX   2001-01-13 [1/1] Malformed From; test subject (inbox unread)"
 test_begin_subtest "Broken symlink aborts"
 ln -s does-not-exist "${MAIL_DIR}/broken"

More information about the notmuch mailing list