summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2021-07-27 13:30:45 +0300
committerSergey Poznyakoff <gray@gnu.org>2021-07-27 18:41:01 +0300
commit85b25a7dc82d89561234779cc633a326cdc5ece8 (patch)
treea447fd53fdc95740be2c086449a837cdb843beb8
parentd9201c84c6b03586cebff3a1f68ad1fa550ce180 (diff)
downloadmailutils-master.tar.gz
mailutils-master.tar.bz2
Prefer User-Agent header over X-MailerHEADmaster
* NEWS: Update. * doc/texinfo/programs/mail.texi: Update. * include/mailutils/header.h (MU_HEADER_USER_AGENT): New define. * mail/mail.c (default_setup): Set useragent * mail/mail.h (mailvar_name_useragent): New define. * mail/mailline.c (header_generator): Add MU_HEADER_USER_AGENT. * mail/mailvar.c: Mew variable: "useragent". Retain "xmailer" as an alias. * mail/send.c (mail_compose_send): Add the User-Agent header if the "useragent" variable is set. * libmailutils/tests/hdrcpy.at: Use User-Agent instead of X-Mailer. * mail/tests/send.at: Likewise. * mail/tests/sendbyname.at: Likewise. * mail/tests/sendrec.at: Likewise. * mail/testsuite/mail/Followup.exp: Likewise. * mail/testsuite/mail/Reply.exp: Likewise. * mail/testsuite/mail/reply.exp: Likewise. * mail/testsuite/mail/send.exp: Likewise. * mh/repl.c: Likewise. * mh/send.c: New .mtstailor vareiable "user-agent".
-rw-r--r--NEWS6
-rw-r--r--doc/texinfo/programs/mail.texi12
-rw-r--r--include/mailutils/header.h1
-rw-r--r--libmailutils/tests/hdrcpy.at4
-rw-r--r--mail/mail.c2
-rw-r--r--mail/mail.h3
-rw-r--r--mail/mailline.c1
-rw-r--r--mail/mailvar.c6
-rw-r--r--mail/send.c4
-rw-r--r--mail/tests/send.at4
-rw-r--r--mail/tests/sendbyname.at10
-rw-r--r--mail/tests/sendrec.at5
-rw-r--r--mail/testsuite/mail/Followup.exp20
-rw-r--r--mail/testsuite/mail/Reply.exp9
-rw-r--r--mail/testsuite/mail/followup.exp9
-rw-r--r--mail/testsuite/mail/reply.exp6
-rw-r--r--mail/testsuite/mail/send.exp2
-rw-r--r--mh/repl.c2
-rw-r--r--mh/send.c15
-rw-r--r--mh/tests/repl.at16
-rw-r--r--mh/tests/send.at12
-rw-r--r--python/mailutils/header.py1
22 files changed, 86 insertions, 64 deletions
diff --git a/NEWS b/NEWS
index 0bded9304..374ad6052 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,4 @@
-GNU mailutils NEWS -- history of user-visible changes. 2021-07-19
+GNU mailutils NEWS -- history of user-visible changes. 2021-07-27
See the end of file for copying conditions.
Please send mailutils bug reports to <bug-mailutils@gnu.org>.
@@ -58,6 +58,10 @@ This fixes https://savannah.gnu.org/bugs/?60937
file name. This is the default.
"email" - Entire email is takes as the file name.
"domain" - Domain part of the email is used as the file name.
+ - useragent
+ When set, the User-Agent header will be added to each outgoing
+ message. This is the default.
+ The use of X-Mailer header has been discontinued.
Version 3.12, 2021-02-13
diff --git a/doc/texinfo/programs/mail.texi b/doc/texinfo/programs/mail.texi
index d392ca452..9a0af24cb 100644
--- a/doc/texinfo/programs/mail.texi
+++ b/doc/texinfo/programs/mail.texi
@@ -2944,17 +2944,23 @@ When set, the actual delivery of messages is displayed on the user's terminal.
@end deftypevr
@c -----------------------------------------
-@deftypevr {mail} boolean xmailer
+@deftypevr {mail} boolean useragent
@*Default: True
-Controls whether the header @samp{X-Mailer} should be added to
+Controls whether the @samp{User-Agent} header should be added to
outgoing messages. The default value of this header is
@example
-X-Mailer: mail (GNU Mailutils @value{VERSION})
+User-Agent: mail (GNU Mailutils @value{VERSION})
@end example
@end deftypevr
+@deftypevr {mail} boolean xmailer
+This header is retained for compatibility with previous releases of
+GNU Mailutils. Since version 3.13 it is an alias for
+@code{useragent}.
+@end deftypevr
+
@node Mail Configuration Files
@subsection Personal and System-wide Configuration Files
diff --git a/include/mailutils/header.h b/include/mailutils/header.h
index ce8209f8f..93f5e4858 100644
--- a/include/mailutils/header.h
+++ b/include/mailutils/header.h
@@ -70,6 +70,7 @@ extern "C" {
#define MU_HEADER_DELIVERY_DATE "Delivery-Date"
#define MU_HEADER_ENVELOPE_TO "Envelope-To"
#define MU_HEADER_X_EXPIRE_TIMESTAMP "X-Expire-Timestamp"
+#define MU_HEADER_USER_AGENT "User-Agent"
#define MU_HEADER_REPLACE 0x01
#define MU_HEADER_BEFORE 0x02
diff --git a/libmailutils/tests/hdrcpy.at b/libmailutils/tests/hdrcpy.at
index 2e47e5f86..e66bd7686 100644
--- a/libmailutils/tests/hdrcpy.at
+++ b/libmailutils/tests/hdrcpy.at
@@ -24,10 +24,10 @@ To: root@example.com
X-IMAPbase: 1 5
Message-Id: 0123456778
X-IMAPtest: foo
-X-Mailer: hidden
+User-Agent: hidden
])
-hdrcpy X-uid X-imapbase x-Mailer < input
+hdrcpy X-uid X-imapbase User-Agent < input
],
[0],
[From: gray@example.com
diff --git a/mail/mail.c b/mail/mail.c
index c14af51c5..632c253a1 100644
--- a/mail/mail.c
+++ b/mail/mail.c
@@ -392,7 +392,7 @@ static char *default_setup[] = {
"set regex",
"set replyprefix=\"Re: \"",
"set charset=auto",
- "set xmailer",
+ "set useragent",
"unfold subject",
"sender mail-followup-to reply-to from",
"set nocmd",
diff --git a/mail/mail.h b/mail/mail.h
index fec644197..a494e8fe3 100644
--- a/mail/mail.h
+++ b/mail/mail.h
@@ -230,7 +230,8 @@ struct mailvar_variable
#define mailvar_name_mime "mime"
#define mailvar_name_onehop "onehop"
#define mailvar_name_quiet "quiet"
-#define mailvar_name_PID "PID"
+#define mailvar_name_PID "PID"
+#define mailvar_name_useragent "useragent"
typedef struct message_set msgset_t;
diff --git a/mail/mailline.c b/mail/mailline.c
index c6ecdf1df..d022d0d7e 100644
--- a/mail/mailline.c
+++ b/mail/mailline.c
@@ -693,6 +693,7 @@ header_generator (const char *text, int state)
MU_HEADER_DELIVERY_DATE,
MU_HEADER_ENVELOPE_TO,
MU_HEADER_X_EXPIRE_TIMESTAMP,
+ MU_HEADER_USER_AGENT,
NULL
};
diff --git a/mail/mailvar.c b/mail/mailvar.c
index e428d3a4d..ceeb83c77 100644
--- a/mail/mailvar.c
+++ b/mail/mailvar.c
@@ -287,9 +287,11 @@ struct mailvar_symbol mailvar_tab[] =
MAILVAR_TYPEMASK (mailvar_type_boolean),
N_("verbosely trace the process of message delivery"),
set_verbose },
- { { mailvar_name_xmailer, },
+
+ { { mailvar_name_useragent, },
MAILVAR_TYPEMASK (mailvar_type_boolean),
- N_("add the `X-Mailer' header to the outgoing messages") },
+ N_("add the `User-Agent' header to the outgoing messages") },
+ { { mailvar_name_xmailer, }, MAILVAR_ALIAS },
{ { mailvar_name_mime },
MAILVAR_TYPEMASK (mailvar_type_boolean),
diff --git a/mail/send.c b/mail/send.c
index 098374dab..de2abb369 100644
--- a/mail/send.c
+++ b/mail/send.c
@@ -1384,8 +1384,8 @@ mail_compose_send (compose_env_t *env, int save_to)
read_cc_bcc (env);
/* Prepare the header */
- if (mailvar_is_true (mailvar_name_xmailer))
- mu_header_set_value (env->header, MU_HEADER_X_MAILER, program_version, 1);
+ if (mailvar_is_true (mailvar_name_useragent))
+ mu_header_set_value (env->header, MU_HEADER_USER_AGENT, program_version, 1);
if (util_header_expand_aliases (&env->header) == 0)
{
diff --git a/mail/tests/send.at b/mail/tests/send.at
index 89053b0ed..3427d6f85 100644
--- a/mail/tests/send.at
+++ b/mail/tests/send.at
@@ -24,13 +24,13 @@ Bye.
AT_CHECK([unset MAIL_DUMP
MUT_MAIL_CMD -E "set sendmail=$MAILER" -s 'Test 22.1' gray@example.org < text
sed -e '/^SENDER:/d' \
+ -e '/^LENGTH:/d' \
-e '/^Date:/d' \
- -e '/^X-Mailer:/d' mail.dump],
+ -e '/^User-Agent:/d' mail.dump],
[0],
[MSGID: 0001
NRCPT: 1
RCPT[[0]]: <gray@example.org>
-LENGTH: 139
Subject: Test 22.1
To: <gray@example.org>
diff --git a/mail/tests/sendbyname.at b/mail/tests/sendbyname.at
index f8680085f..57c8c061a 100644
--- a/mail/tests/sendbyname.at
+++ b/mail/tests/sendbyname.at
@@ -39,13 +39,13 @@ MUT_MAIL_CMD -E "set sendmail=$MAILER" \
AT_CHECK([
sed -e '/^SENDER:/d' \
+ -e '/^LENGTH:/d' \
-e '/^Date:/d' \
- -e '/^X-Mailer:/d' mail.dump],
+ -e '/^User-Agent:/d' mail.dump],
[0],
[MSGID: 0001
NRCPT: 1
RCPT[[0]]: <gray@example.org>
-LENGTH: 139
Subject: Test 22.3
To: <gray@example.org>
@@ -59,6 +59,7 @@ AT_CHECK([cat record])
AT_CHECK([
sed -e '1s/^From .*/Envelope/' \
-e '/^X-[[a-zA-Z]]*:/d' \
+ -e '/^User-Agent:/d' \
-e '/^Date:/d' folder/gray],
[0],
[Envelope
@@ -84,13 +85,13 @@ MUT_MAIL_CMD -E "set sendmail=$MAILER" \
AT_CHECK([
sed -e '/^SENDER:/d' \
+ -e '/^LENGTH:/d' \
-e '/^Date:/d' \
- -e '/^X-Mailer:/d' mail.dump],
+ -e '/^User-Agent:/d' mail.dump],
[0],
[MSGID: 0001
NRCPT: 1
RCPT[[0]]: <gray@example.org>
-LENGTH: 139
Subject: Test 22.3
To: <gray@example.org>
@@ -104,6 +105,7 @@ AT_CHECK([cat record])
AT_CHECK([
sed -e '1s/^From .*/Envelope/' \
-e '/^X-[[a-zA-Z]]*:/d' \
+ -e '/^User-Agent:/d' \
-e '/^Date:/d' outfolder/gray record],
[0],
[Envelope
diff --git a/mail/tests/sendrec.at b/mail/tests/sendrec.at
index 8f0dcf79e..c053f9f8d 100644
--- a/mail/tests/sendrec.at
+++ b/mail/tests/sendrec.at
@@ -31,13 +31,13 @@ MUT_MAIL_CMD -E "set sendmail=$MAILER" -E "set record=$RECORD" -s 'Test 22.2' gr
AT_CHECK([
sed -e '/^SENDER:/d' \
+ -e '/^LENGTH:/d' \
-e '/^Date:/d' \
- -e '/^X-Mailer:/d' mail.dump],
+ -e '/^User-Agent:/d' mail.dump],
[0],
[MSGID: 0001
NRCPT: 1
RCPT[[0]]: <gray@example.org>
-LENGTH: 139
Subject: Test 22.2
To: <gray@example.org>
@@ -49,6 +49,7 @@ Bye.
AT_CHECK([
sed -e '1s/^From .*/Envelope/' \
-e '/^X-[[a-zA-Z]]*:/d' \
+ -e '/^User-Agent:/d' \
-e '/^Date:/d' record],
[0],
[Envelope
diff --git a/mail/testsuite/mail/Followup.exp b/mail/testsuite/mail/Followup.exp
index d41ea2ccd..7be172c35 100644
--- a/mail/testsuite/mail/Followup.exp
+++ b/mail/testsuite/mail/Followup.exp
@@ -30,9 +30,9 @@ if ![mu_check_capability ENABLE_SENDMAIL] {
file mkdir $MU_SPOOL_DIR/folder
- mail_test "setenv MAIL_DUMP=\"$MU_SPOOL_DIR/mail.dump\""
- mail_test "retain To"
- mail_test "set outfolder"
+ mail_command "setenv MAIL_DUMP=\"$MU_SPOOL_DIR/mail.dump\""
+ mail_command "retain To"
+ mail_command "set outfolder"
mail_test -noprompt "Followup 2 1 3" \
{To: "Alice" <alice@wonder.land>,"March Hare" <hare@wonder.land>}\
@@ -58,7 +58,7 @@ if ![mu_check_capability ENABLE_SENDMAIL] {
{In-Reply-To: Your message of Mon, 29 Jul 2002 22:00:02 +0100} \
{ <200207292200.3302@wonder.land>} \
{References: <200207292200.3302@wonder.land>} \
- "X-Mailer: mail (GNU Mailutils $MU_TOOL_VERSION)" \
+ "User-Agent: mail (GNU Mailutils $MU_TOOL_VERSION)" \
-re {^Date:[^\r\n]*} \
{}\
{To: March Hare <hare@wonder.land>} \
@@ -73,7 +73,7 @@ if ![mu_check_capability ENABLE_SENDMAIL] {
{In-Reply-To: Your message of Mon, 29 Jul 2002 22:00:02 +0100} \
{ <200207292200.3302@wonder.land>} \
{References: <200207292200.3302@wonder.land>} \
- "X-Mailer: mail (GNU Mailutils $MU_TOOL_VERSION)" \
+ "User-Agent: mail (GNU Mailutils $MU_TOOL_VERSION)" \
-re {^Date:[^\r\n]*}\
-re {^X-IMAPbase:[^\r\n]*}\
-re {^X-UID:[^\r\n]*}\
@@ -96,9 +96,9 @@ if ![mu_check_capability ENABLE_SENDMAIL] {
file mkdir $MU_SPOOL_DIR/outfolder
- mail_test "setenv MAIL_DUMP=\"$MU_SPOOL_DIR/mail.dump\""
- mail_test "retain To"
- mail_test "set outfolder=\"$MU_SPOOL_DIR/outfolder\""
+ mail_command "setenv MAIL_DUMP=\"$MU_SPOOL_DIR/mail.dump\""
+ mail_command "retain To"
+ mail_command "set outfolder=\"$MU_SPOOL_DIR/outfolder\""
mail_test -noprompt "Followup 2 1 3" \
{To: "Alice" <alice@wonder.land>,"March Hare" <hare@wonder.land>}\
@@ -124,7 +124,7 @@ if ![mu_check_capability ENABLE_SENDMAIL] {
{In-Reply-To: Your message of Mon, 29 Jul 2002 22:00:02 +0100} \
{ <200207292200.3302@wonder.land>} \
{References: <200207292200.3302@wonder.land>} \
- "X-Mailer: mail (GNU Mailutils $MU_TOOL_VERSION)" \
+ "User-Agent: mail (GNU Mailutils $MU_TOOL_VERSION)" \
-re {^Date:[^\r\n]*} \
{}\
{To: March Hare <hare@wonder.land>} \
@@ -139,7 +139,7 @@ if ![mu_check_capability ENABLE_SENDMAIL] {
{In-Reply-To: Your message of Mon, 29 Jul 2002 22:00:02 +0100} \
{ <200207292200.3302@wonder.land>} \
{References: <200207292200.3302@wonder.land>} \
- "X-Mailer: mail (GNU Mailutils $MU_TOOL_VERSION)" \
+ "User-Agent: mail (GNU Mailutils $MU_TOOL_VERSION)" \
-re {^Date:[^\r\n]*}\
-re {^X-IMAPbase:[^\r\n]*}\
-re {^X-UID:[^\r\n]*}\
diff --git a/mail/testsuite/mail/Reply.exp b/mail/testsuite/mail/Reply.exp
index 8f0687401..8d1d73d28 100644
--- a/mail/testsuite/mail/Reply.exp
+++ b/mail/testsuite/mail/Reply.exp
@@ -32,9 +32,8 @@ if ![mu_check_capability ENABLE_SENDMAIL] {
file mkdir $MU_SPOOL_DIR/folder
file mkdir $MU_SPOOL_DIR/outfolder
- mail_test "setenv MAIL_DUMP=\"$MU_SPOOL_DIR/mail.dump\""
-
- mail_test "retain To"
+ mail_command "setenv MAIL_DUMP=\"$MU_SPOOL_DIR/mail.dump\""
+ mail_command "retain To"
mail_test -noprompt "Reply 2 1 3" \
{To: "Alice" <alice@wonder.land>,"March Hare" <hare@wonder.land>}\
{Subject: Re: Invitation}\
@@ -58,7 +57,7 @@ if ![mu_check_capability ENABLE_SENDMAIL] {
{In-Reply-To: Your message of Mon, 29 Jul 2002 22:00:02 +0100} \
{ <200207292200.3302@wonder.land>} \
{References: <200207292200.3302@wonder.land>} \
- "X-Mailer: mail (GNU Mailutils $MU_TOOL_VERSION)" \
+ "User-Agent: mail (GNU Mailutils $MU_TOOL_VERSION)" \
-re {^Date:[^\r\n]*} \
{}\
{To: March Hare <hare@wonder.land>} \
@@ -73,7 +72,7 @@ if ![mu_check_capability ENABLE_SENDMAIL] {
{In-Reply-To: Your message of Mon, 29 Jul 2002 22:00:02 +0100} \
{ <200207292200.3302@wonder.land>} \
{References: <200207292200.3302@wonder.land>} \
- "X-Mailer: mail (GNU Mailutils $MU_TOOL_VERSION)" \
+ "User-Agent: mail (GNU Mailutils $MU_TOOL_VERSION)" \
-re {^Date:[^\r\n]*}\
-re {^X-IMAPbase:[^\r\n]*}\
-re {^X-UID:[^\r\n]*}\
diff --git a/mail/testsuite/mail/followup.exp b/mail/testsuite/mail/followup.exp
index af2a31f3b..62694696d 100644
--- a/mail/testsuite/mail/followup.exp
+++ b/mail/testsuite/mail/followup.exp
@@ -30,9 +30,9 @@ if ![mu_check_capability ENABLE_SENDMAIL] {
file mkdir $MU_SPOOL_DIR/folder
- mail_test "setenv MAIL_DUMP=\"$MU_SPOOL_DIR/mail.dump\""
- mail_test "retain To"
- mail_test "set outfolder"
+ mail_command "setenv MAIL_DUMP=\"$MU_SPOOL_DIR/mail.dump\""
+ mail_command "retain To"
+ mail_command "set outfolder"
mail_test -noprompt "followup 1" \
{To: "March Hare" <hare@wonder.land>,"Alice" <alice@wonder.land>} \
@@ -88,7 +88,8 @@ if ![mu_check_capability ENABLE_SENDMAIL] {
"-E" "set dot" \
"-E" "set indentprefix=>"
file mkdir $MU_SPOOL_DIR/outfolder
- mail_test "set outfolder=\"$MU_SPOOL_DIR/outfolder\""
+ mail_command "setenv MAIL_DUMP=\"$MU_SPOOL_DIR/mail.dump\""
+ mail_command "set outfolder=\"$MU_SPOOL_DIR/outfolder\""
mail_test -noprompt "followup 1" \
{To: "March Hare" <hare@wonder.land>,"Alice" <alice@wonder.land>} \
diff --git a/mail/testsuite/mail/reply.exp b/mail/testsuite/mail/reply.exp
index 1cfcc3e87..a7ecf0674 100644
--- a/mail/testsuite/mail/reply.exp
+++ b/mail/testsuite/mail/reply.exp
@@ -31,8 +31,8 @@ if ![mu_check_capability ENABLE_SENDMAIL] {
file mkdir $MU_SPOOL_DIR/folder
file mkdir $MU_SPOOL_DIR/outfolder
- unset -nocomplain env(MAIL_DUMP)
- mail_test "retain To"
+ mail_command "setenv MAIL_DUMP=\"$MU_FOLDER_DIR/mta.diag\""
+ mail_command "retain To"
mail_test -noprompt "reply 1" \
{To: "March Hare" <hare@wonder.land>,"Alice" <alice@wonder.land>}\
{Subject: Re: Invitation}\
@@ -51,7 +51,7 @@ if ![mu_check_capability ENABLE_SENDMAIL] {
{In-Reply-To: Your message of Mon, 29 Jul 2002 22:00:01 +0100}\
-re {[[:space:]]+<200207292200.3301@wonder.land>}\
{References: <200207292200.3301@wonder.land>}\
- "X-Mailer: mail (GNU Mailutils $MU_TOOL_VERSION)"\
+ "User-Agent: mail (GNU Mailutils $MU_TOOL_VERSION)"\
-re {^Date:[^\r\n]*}\
-re {^X-IMAPbase:[^\r\n]*}\
-re {^X-UID:[^\r\n]*}\
diff --git a/mail/testsuite/mail/send.exp b/mail/testsuite/mail/send.exp
index 0cb18a5bc..a12d958c4 100644
--- a/mail/testsuite/mail/send.exp
+++ b/mail/testsuite/mail/send.exp
@@ -51,7 +51,7 @@ if ![mu_check_capability ENABLE_SENDMAIL] {
"In-Reply-To: Your message of Fri, 28 Dec 2001 22:18:08 +0200"\
"\t<200112282018.fBSKI8N04906@nonexistent.net>"\
"References: <200112282018.fBSKI8N04906@nonexistent.net>"\
- "X-Mailer: mail (GNU Mailutils $MU_TOOL_VERSION)"\
+ "User-Agent: mail (GNU Mailutils $MU_TOOL_VERSION)"\
-re {^Date:[^\r\n]*}\
""\
"> Received: (from foobar@nonexistent.net)"\
diff --git a/mh/repl.c b/mh/repl.c
index 6ab52fb94..ba8358878 100644
--- a/mh/repl.c
+++ b/mh/repl.c
@@ -178,7 +178,7 @@ static char default_format_str[] =
"%(void Re:)%>) %(void(unre{subject}))%(trim)%(putstr)%>\n"
"%(lit)%<(in_reply_to)%(void(width))%(printhdr In-reply-to: )\\n%>"
"%(lit)%<(references)%(void(width))%(printhdr References: )\\n%>"
- "X-Mailer: MH (%(package_string))\n"
+ "User-Agent: MH (%(package_string))\n"
"--------\n";
void
diff --git a/mh/send.c b/mh/send.c
index a68ba707b..c49db603d 100644
--- a/mh/send.c
+++ b/mh/send.c
@@ -41,7 +41,7 @@ static int watch; /* Watch the delivery process */
static int keep_files; /* Keep draft files */
-#define DEFAULT_X_MAILER "MH (" PACKAGE_STRING ")"
+#define DEFAULT_USER_AGENT "MH (" PACKAGE_STRING ")"
#define WATCH(c) do {\
if (watch)\
@@ -613,16 +613,19 @@ _action_send (void *item, void *data)
&& mu_header_get_value (hdr, MU_HEADER_MESSAGE_ID, NULL, 0, &n))
create_message_id (hdr);
- if (mu_header_get_value (hdr, MU_HEADER_X_MAILER, NULL, 0, &n))
+ if (mu_header_get_value (hdr, MU_HEADER_USER_AGENT, NULL, 0, &n))
{
const char *p = mu_mhprop_get_value (mts_profile,
- "x-mailer", "yes");
+ "user-agent",
+ mu_mhprop_get_value (mts_profile,
+ "x-mailer",
+ "yes"));
if (!strcmp (p, "yes"))
- mu_header_set_value (hdr, MU_HEADER_X_MAILER,
- DEFAULT_X_MAILER, 0);
+ mu_header_set_value (hdr, MU_HEADER_USER_AGENT,
+ DEFAULT_USER_AGENT, 0);
else if (strcmp (p, "no"))
- mu_header_remove (hdr, MU_HEADER_X_MAILER, 1);
+ mu_header_remove (hdr, MU_HEADER_USER_AGENT, 1);
}
}
diff --git a/mh/tests/repl.at b/mh/tests/repl.at
index b0dade98f..eca99aabb 100644
--- a/mh/tests/repl.at
+++ b/mh/tests/repl.at
@@ -37,14 +37,14 @@ cat Mail/draft
-- Input file:
To: <gray@example.com>
Subject: Re: test input
-X-Mailer: MH (AT_PACKAGE_NAME AT_PACKAGE_VERSION)
+User-Agent: MH (AT_PACKAGE_NAME AT_PACKAGE_VERSION)
--------
-- Input file end
What now? draft left on "./Mail/draft".
== Mail/draft ==
To: <gray@example.com>
Subject: Re: test input
-X-Mailer: MH (AT_PACKAGE_NAME AT_PACKAGE_VERSION)
+User-Agent: MH (AT_PACKAGE_NAME AT_PACKAGE_VERSION)
--------
Seen by mhed
])
@@ -67,14 +67,14 @@ cat Mail/drafts/1
-- Input file:
To: <gray@example.com>
Subject: Re: test input
-X-Mailer: MH (AT_PACKAGE_NAME AT_PACKAGE_VERSION)
+User-Agent: MH (AT_PACKAGE_NAME AT_PACKAGE_VERSION)
--------
-- Input file end
What now? draft left on "./Mail/drafts/1".
== Mail/drafts/1 ==
To: <gray@example.com>
Subject: Re: test input
-X-Mailer: MH (AT_PACKAGE_NAME AT_PACKAGE_VERSION)
+User-Agent: MH (AT_PACKAGE_NAME AT_PACKAGE_VERSION)
--------
Seen by mhed
])
@@ -99,14 +99,14 @@ cat Mail/drafts/1
-- Input file:
To: <gray@example.com>
Subject: Re: test input
-X-Mailer: MH (AT_PACKAGE_NAME AT_PACKAGE_VERSION)
+User-Agent: MH (AT_PACKAGE_NAME AT_PACKAGE_VERSION)
--------
-- Input file end
What now? draft left on "./Mail/drafts/1".
== Mail/drafts/1 ==
To: <gray@example.com>
Subject: Re: test input
-X-Mailer: MH (AT_PACKAGE_NAME AT_PACKAGE_VERSION)
+User-Agent: MH (AT_PACKAGE_NAME AT_PACKAGE_VERSION)
--------
Seen by mhed
])
@@ -131,14 +131,14 @@ cat Mail/draft
-- Input file:
To: <gray@example.com>
Subject: Re: test input
-X-Mailer: MH (AT_PACKAGE_NAME AT_PACKAGE_VERSION)
+User-Agent: MH (AT_PACKAGE_NAME AT_PACKAGE_VERSION)
--------
-- Input file end
What now? draft left on "./Mail/draft".
== Mail/draft ==
To: <gray@example.com>
Subject: Re: test input
-X-Mailer: MH (AT_PACKAGE_NAME AT_PACKAGE_VERSION)
+User-Agent: MH (AT_PACKAGE_NAME AT_PACKAGE_VERSION)
--------
Seen by mhed
])
diff --git a/mh/tests/send.at b/mh/tests/send.at
index 070d128ea..cfc8977ce 100644
--- a/mh/tests/send.at
+++ b/mh/tests/send.at
@@ -41,7 +41,7 @@ From: mhtester@example.net
To: <gray@example.net>
Subject: Send file test
Date: now
-X-Mailer: MH (AT_PACKAGE_STRING)
+User-Agent: MH (AT_PACKAGE_STRING)
Message body
@@ -83,7 +83,7 @@ From: mhtester@example.net
To: <gray@example.net>
Subject: Send file test 1
Date: now
-X-Mailer: MH (AT_PACKAGE_STRING)
+User-Agent: MH (AT_PACKAGE_STRING)
Message body 1
@@ -96,7 +96,7 @@ From: mhtester@example.net
To: <gray@example.org>
Subject: Send file test 2
Date: now
-X-Mailer: MH (AT_PACKAGE_STRING)
+User-Agent: MH (AT_PACKAGE_STRING)
Message body 2
@@ -128,7 +128,7 @@ From: mhtester@example.net
To: <gray@example.net>
Subject: Send file test
Date: now
-X-Mailer: MH (AT_PACKAGE_STRING)
+User-Agent: MH (AT_PACKAGE_STRING)
Message body
@@ -166,7 +166,7 @@ From: mhtester@example.net
To: <gray@example.net>
Subject: Draftfolder test
Date: now
-X-Mailer: MH (AT_PACKAGE_STRING)
+User-Agent: MH (AT_PACKAGE_STRING)
Message body
@@ -206,7 +206,7 @@ From: mhtester@example.net
To: <gray@example.org>
Subject: Draftmessage test
Date: now
-X-Mailer: MH (AT_PACKAGE_STRING)
+User-Agent: MH (AT_PACKAGE_STRING)
Message body
diff --git a/python/mailutils/header.py b/python/mailutils/header.py
index 6b2ef6ae5..30e8fc4a0 100644
--- a/python/mailutils/header.py
+++ b/python/mailutils/header.py
@@ -176,6 +176,7 @@ MU_HEADER_FCC = "Fcc"
MU_HEADER_DELIVERY_DATE = "Delivery-date"
MU_HEADER_ENVELOPE_TO = "Envelope-to"
MU_HEADER_X_EXPIRE_TIMESTAMP = "X-Expire-Timestamp"
+MU_HEADER_USER_AGENT = "User-Agent"
MU_HEADER_REPLACE = 0x01
MU_HEADER_BEFORE = 0x02

Return to:

Send suggestions and report system problems to the System administrator.