]> git.notmuchmail.org Git - notmuch/blobdiff - test/test-lib.sh
test: add boolean argument to arg-test
[notmuch] / test / test-lib.sh
index d2b2a47f495d6025e77dd2a5ad5ed56ccf9474f4..350246492d8c2dbd0e6faf16c9dc26d19a77223c 100644 (file)
@@ -507,6 +507,16 @@ NOTMUCH_DUMP_TAGS ()
     notmuch dump --include=tags "${@}" | sed '/^#/d' | sort
 }
 
+notmuch_drop_mail_headers ()
+{
+    $NOTMUCH_PYTHON -c '
+import email, sys
+msg = email.message_from_file(sys.stdin)
+for hdr in sys.argv[1:]: del msg[hdr]
+print(msg.as_string(False))
+' "$@"
+}
+
 notmuch_search_sanitize ()
 {
     perl -pe 's/("?thread"?: ?)("?)................("?)/\1\2XXX\3/'