The User-Agent: header can be fun and interesting, but it also leaks
quite a bit of information about the user and their software stack.
This represents a potential security risk (attackers can target the
particular stack) and also an anonymity risk (a user trying to
preserve their anonymity by sending mail from a non-associated account
might reveal quite a lot of information if their choice of mail user
agent is exposed).
This change also avoids hiding the User-Agent header by default, so
that people who decide they want to send it will at least see it (and
can edit it if they want to) before sending.
It makes sense to have safer defaults.
(const :tag "Compose mail in a new window" new-window)
(const :tag "Compose mail in a new frame" new-frame)))
(const :tag "Compose mail in a new window" new-window)
(const :tag "Compose mail in a new frame" new-frame)))
-(defcustom notmuch-mua-user-agent-function 'notmuch-mua-user-agent-full
+(defcustom notmuch-mua-user-agent-function nil
"Function used to generate a `User-Agent:' string. If this is
`nil' then no `User-Agent:' will be generated."
:type '(choice (const :tag "No user agent string" nil)
"Function used to generate a `User-Agent:' string. If this is
`nil' then no `User-Agent:' will be generated."
:type '(choice (const :tag "No user agent string" nil)
:value notmuch-mua-user-agent-full))
:group 'notmuch-send)
:value notmuch-mua-user-agent-full))
:group 'notmuch-send)
-(defcustom notmuch-mua-hidden-headers '("^User-Agent:")
+(defcustom notmuch-mua-hidden-headers nil
"Headers that are added to the `message-mode' hidden headers
list."
:type '(repeat string)
"Headers that are added to the `message-mode' hidden headers
list."
:type '(repeat string)
(kill-whole-line)
(insert "To: user@example.com\n")'
sed \
(kill-whole-line)
(insert "To: user@example.com\n")'
sed \
- -e s',^User-Agent: Notmuch/.* Emacs/.*,User-Agent: Notmuch/XXX Emacs/XXX,' \
-e s',^Message-ID: <.*>$,Message-ID: <XXX>,' \
-e s',^\(Content-Type: text/plain\); charset=us-ascii$,\1,' < sent_message >OUTPUT
cat <<EOF >EXPECTED
-e s',^Message-ID: <.*>$,Message-ID: <XXX>,' \
-e s',^\(Content-Type: text/plain\); charset=us-ascii$,\1,' < sent_message >OUTPUT
cat <<EOF >EXPECTED
To: user@example.com
Subject: Testing message sent via SMTP
Date: 01 Jan 2000 12:00:00 -0000
To: user@example.com
Subject: Testing message sent via SMTP
Date: 01 Jan 2000 12:00:00 -0000
-User-Agent: Notmuch/XXX Emacs/XXX
Message-ID: <XXX>
MIME-Version: 1.0
Content-Type: text/plain
Message-ID: <XXX>
MIME-Version: 1.0
Content-Type: text/plain
(test-output))'
sed -i -e 's/^In-Reply-To: <.*>$/In-Reply-To: <XXX>/' OUTPUT
sed -i -e 's/^References: <.*>$/References: <XXX>/' OUTPUT
(test-output))'
sed -i -e 's/^In-Reply-To: <.*>$/In-Reply-To: <XXX>/' OUTPUT
sed -i -e 's/^References: <.*>$/References: <XXX>/' OUTPUT
-sed -i -e 's,^User-Agent: Notmuch/.* Emacs/.*,User-Agent: Notmuch/XXX Emacs/XXX,' OUTPUT
cat <<EOF >EXPECTED
From: Notmuch Test Suite <test_suite@notmuchmail.org>
To: user@example.com
cat <<EOF >EXPECTED
From: Notmuch Test Suite <test_suite@notmuchmail.org>
To: user@example.com
In-Reply-To: <XXX>
Fcc: ${MAIL_DIR}/sent
References: <XXX>
In-Reply-To: <XXX>
Fcc: ${MAIL_DIR}/sent
References: <XXX>
-User-Agent: Notmuch/XXX Emacs/XXX
--text follows this line--
Notmuch Test Suite <test_suite@notmuchmail.org> writes:
--text follows this line--
Notmuch Test Suite <test_suite@notmuchmail.org> writes:
(notmuch-test-wait)
(notmuch-search-reply-to-thread)
(test-output))"
(notmuch-test-wait)
(notmuch-search-reply-to-thread)
(test-output))"
-sed -i -e 's,^User-Agent: Notmuch/.* Emacs/.*,User-Agent: Notmuch/XXX Emacs/XXX,' OUTPUT
cat <<EOF >EXPECTED
From: Notmuch Test Suite <test_suite_other@notmuchmail.org>
To: Sender <sender@example.com>
cat <<EOF >EXPECTED
From: Notmuch Test Suite <test_suite_other@notmuchmail.org>
To: Sender <sender@example.com>
In-Reply-To: <${gen_msg_id}>
Fcc: ${MAIL_DIR}/sent
References: <${gen_msg_id}>
In-Reply-To: <${gen_msg_id}>
Fcc: ${MAIL_DIR}/sent
References: <${gen_msg_id}>
-User-Agent: Notmuch/XXX Emacs/XXX
--text follows this line--
Sender <sender@example.com> writes:
--text follows this line--
Sender <sender@example.com> writes:
(notmuch-test-wait)
(notmuch-search-reply-to-thread)
(test-output))"
(notmuch-test-wait)
(notmuch-search-reply-to-thread)
(test-output))"
-sed -i -e 's,^User-Agent: Notmuch/.* Emacs/.*,User-Agent: Notmuch/XXX Emacs/XXX,' OUTPUT
cat <<EOF >EXPECTED
From: Notmuch Test Suite <test_suite@notmuchmail.org>
To: Sender <sender@example.com>, someone@example.com
cat <<EOF >EXPECTED
From: Notmuch Test Suite <test_suite@notmuchmail.org>
To: Sender <sender@example.com>, someone@example.com
In-Reply-To: <${gen_msg_id}>
Fcc: ${MAIL_DIR}/sent
References: <${gen_msg_id}>
In-Reply-To: <${gen_msg_id}>
Fcc: ${MAIL_DIR}/sent
References: <${gen_msg_id}>
-User-Agent: Notmuch/XXX Emacs/XXX
--text follows this line--
Sender <sender@example.com> writes:
--text follows this line--
Sender <sender@example.com> writes:
(notmuch-show "id:20091118002059.067214ed@hikari")
(notmuch-show-reply)
(test-output))'
(notmuch-show "id:20091118002059.067214ed@hikari")
(notmuch-show-reply)
(test-output))'
-sed -i -e 's,^User-Agent: Notmuch/.* Emacs/.*,User-Agent: Notmuch/XXX Emacs/XXX,' OUTPUT
cat <<EOF >EXPECTED
From: Notmuch Test Suite <test_suite@notmuchmail.org>
To: Adrian Perez de Castro <aperez@igalia.com>, notmuch@notmuchmail.org
cat <<EOF >EXPECTED
From: Notmuch Test Suite <test_suite@notmuchmail.org>
To: Adrian Perez de Castro <aperez@igalia.com>, notmuch@notmuchmail.org
In-Reply-To: <20091118002059.067214ed@hikari>
Fcc: ${MAIL_DIR}/sent
References: <20091118002059.067214ed@hikari>
In-Reply-To: <20091118002059.067214ed@hikari>
Fcc: ${MAIL_DIR}/sent
References: <20091118002059.067214ed@hikari>
-User-Agent: Notmuch/XXX Emacs/XXX
--text follows this line--
Adrian Perez de Castro <aperez@igalia.com> writes:
--text follows this line--
Adrian Perez de Castro <aperez@igalia.com> writes:
(notmuch-show "id:cf0c4d610911171136h1713aa59w9cf9aa31f052ad0a@mail.gmail.com")
(notmuch-show-reply)
(test-output))'
(notmuch-show "id:cf0c4d610911171136h1713aa59w9cf9aa31f052ad0a@mail.gmail.com")
(notmuch-show-reply)
(test-output))'
-sed -i -e 's,^User-Agent: Notmuch/.* Emacs/.*,User-Agent: Notmuch/XXX Emacs/XXX,' OUTPUT
cat <<EOF >EXPECTED
From: Notmuch Test Suite <test_suite@notmuchmail.org>
To: Alex Botero-Lowry <alex.boterolowry@gmail.com>, notmuch@notmuchmail.org
cat <<EOF >EXPECTED
From: Notmuch Test Suite <test_suite@notmuchmail.org>
To: Alex Botero-Lowry <alex.boterolowry@gmail.com>, notmuch@notmuchmail.org
In-Reply-To: <cf0c4d610911171136h1713aa59w9cf9aa31f052ad0a@mail.gmail.com>
Fcc: ${MAIL_DIR}/sent
References: <cf0c4d610911171136h1713aa59w9cf9aa31f052ad0a@mail.gmail.com>
In-Reply-To: <cf0c4d610911171136h1713aa59w9cf9aa31f052ad0a@mail.gmail.com>
Fcc: ${MAIL_DIR}/sent
References: <cf0c4d610911171136h1713aa59w9cf9aa31f052ad0a@mail.gmail.com>
-User-Agent: Notmuch/XXX Emacs/XXX
--text follows this line--
Alex Botero-Lowry <alex.boterolowry@gmail.com> writes:
--text follows this line--
Alex Botero-Lowry <alex.boterolowry@gmail.com> writes:
(notmuch-show \"id:${gen_msg_id}\")
(notmuch-show-reply)
(test-output))"
(notmuch-show \"id:${gen_msg_id}\")
(notmuch-show-reply)
(test-output))"
-sed -i -e 's,^User-Agent: Notmuch/.* Emacs/.*,User-Agent: Notmuch/XXX Emacs/XXX,' OUTPUT
cat <<EOF >EXPECTED
From: Notmuch Test Suite <test_suite@notmuchmail.org>
To:
cat <<EOF >EXPECTED
From: Notmuch Test Suite <test_suite@notmuchmail.org>
To:
In-Reply-To: <${gen_msg_id}>
Fcc: ${MAIL_DIR}/sent
References: <${gen_msg_id}>
In-Reply-To: <${gen_msg_id}>
Fcc: ${MAIL_DIR}/sent
References: <${gen_msg_id}>
-User-Agent: Notmuch/XXX Emacs/XXX
--text follows this line--
Notmuch Test Suite <test_suite@notmuchmail.org> writes:
--text follows this line--
Notmuch Test Suite <test_suite@notmuchmail.org> writes:
(notmuch-show \"id:$message_id\")
(notmuch-show-reply)
(test-output))"
(notmuch-show \"id:$message_id\")
(notmuch-show-reply)
(test-output))"
-sed -i -e 's,^User-Agent: Notmuch/.* Emacs/.*,User-Agent: Notmuch/XXX Emacs/XXX,' OUTPUT
cat <<EOF >EXPECTED
From: Notmuch Test Suite <test_suite@notmuchmail.org>
To:
cat <<EOF >EXPECTED
From: Notmuch Test Suite <test_suite@notmuchmail.org>
To:
In-Reply-To: <test-emacs-mml-quoting@message.id>
Fcc: ${MAIL_DIR}/sent
References: <test-emacs-mml-quoting@message.id>
In-Reply-To: <test-emacs-mml-quoting@message.id>
Fcc: ${MAIL_DIR}/sent
References: <test-emacs-mml-quoting@message.id>
-User-Agent: Notmuch/XXX Emacs/XXX
--text follows this line--
Notmuch Test Suite <test_suite@notmuchmail.org> writes:
--text follows this line--
Notmuch Test Suite <test_suite@notmuchmail.org> writes: