]> git.notmuchmail.org Git - notmuch/blob - test/T730-emacs-forwarding.sh
tests/smime: Test indexing cleartext of envelopedData
[notmuch] / test / T730-emacs-forwarding.sh
1 #!/usr/bin/env bash
2
3 test_description="emacs forwarding"
4 . $(dirname "$0")/test-lib.sh || exit 1
5
6 test_begin_subtest "Forward setting the correct references header"
7 # Check that, when forwarding a message, the new message has
8 # a References-header pointing to the original (forwarded) message.
9
10 message_id='OriginalMessage@notmuchmail.org'
11 add_message \
12     [id]="$message_id" \
13     '[from]="user@example.com"' \
14     '[subject]="This is the original message"' \
15     '[body]="Dummy text."'
16
17 test_emacs_expect_t "
18   (let ((message-send-mail-function (lambda () t)))
19     (notmuch-show \"id:$message_id\")
20     (notmuch-show-forward-message)
21     (save-restriction
22       (message-narrow-to-headers)
23       (message-remove-header \"Fcc\")
24       (message-remove-header \"To\")
25       (message-add-header \"To: nobody@example.com\"))
26
27     (notmuch-mua-send)
28     (notmuch-test-expect-equal
29         (message-field-value \"References\") \"<$message_id>\"))
30 "
31
32 test_begin_subtest "Forwarding adding the forwarded tag"
33 # Check that sending the forwarding message in the previous
34 # subtest did add the forwarded-tag to the message that was forwarded.
35
36 test_expect_equal "$(notmuch search --output=tags id:$message_id | sort)" \
37 "forwarded
38 inbox
39 unread"
40
41 test_done