#!/usr/bin/env bash test_description="emacs forwarding" . $(dirname "$0")/test-lib.sh || exit 1 test_begin_subtest "Forward setting the correct references header" # Check that, when forwarding a message, the new message has # a References-header pointing to the original (forwarded) message. message_id='OriginalMessage@notmuchmail.org' add_message \ [id]="$message_id" \ '[from]="user@example.com"' \ '[subject]="This is the original message"' \ '[body]="Dummy text."' test_emacs_expect_t " (progn (notmuch-show \"id:$message_id\") (notmuch-show-forward-message) (run-hooks 'notmuch-mua-send-hook) (notmuch-test-expect-equal (message-field-value \"References\") \"<$message_id>\"))" test_begin_subtest "Forwarding adding the forwarded tag" # Check that the send hook called in the previous subtest did add the forwarded-tag test_expect_equal $(notmuch search --output=messages tag:forwarded) id:$message_id test_done