[evolution] Use 'User-Agent' instead of 'X-Mailer' header when sending message
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution] Use 'User-Agent' instead of 'X-Mailer' header when sending message
- Date: Thu, 14 Jun 2018 10:48:50 +0000 (UTC)
commit dd8c82595686ba8d97c23f0f28e5440d3cd61c94
Author: Milan Crha <mcrha redhat com>
Date: Thu Jun 14 12:47:39 2018 +0200
Use 'User-Agent' instead of 'X-Mailer' header when sending message
It is suggested in RFC 5536:
https://tools.ietf.org/html/rfc5536#section-3.2.13
src/em-format/e-mail-formatter-headers.c | 4 ++--
src/em-format/e-mail-formatter-quote-headers.c | 4 ++--
src/libemail-engine/e-mail-folder-utils.c | 8 ++++----
src/libemail-engine/e-mail-session-utils.c | 6 +++---
src/libemail-engine/mail-ops.c | 5 ++---
src/mail/e-mail-reader-utils.c | 6 ++++--
6 files changed, 17 insertions(+), 16 deletions(-)
---
diff --git a/src/em-format/e-mail-formatter-headers.c b/src/em-format/e-mail-formatter-headers.c
index ed847dc238..30a38601c8 100644
--- a/src/em-format/e-mail-formatter-headers.c
+++ b/src/em-format/e-mail-formatter-headers.c
@@ -391,10 +391,10 @@ format_full_headers (EMailFormatter *formatter,
* as it's the least preferred. */
if (header_value == NULL)
header_value = camel_medium_get_header (
- medium, "X-Mailer");
+ medium, "User-Agent");
if (header_value == NULL)
header_value = camel_medium_get_header (
- medium, "User-Agent");
+ medium, "X-Mailer");
if (header_value == NULL)
header_value = camel_medium_get_header (
medium, "X-Newsreader");
diff --git a/src/em-format/e-mail-formatter-quote-headers.c b/src/em-format/e-mail-formatter-quote-headers.c
index 1f2d7597a5..73d4e43516 100644
--- a/src/em-format/e-mail-formatter-quote-headers.c
+++ b/src/em-format/e-mail-formatter-quote-headers.c
@@ -182,9 +182,9 @@ emfqe_format_header (EMailFormatter *formatter,
CamelMedium *medium;
medium = CAMEL_MEDIUM (mime_part);
- txt = camel_medium_get_header (medium, "x-mailer");
+ txt = camel_medium_get_header (medium, "user-agent");
if (txt == NULL)
- txt = camel_medium_get_header (medium, "user-agent");
+ txt = camel_medium_get_header (medium, "x-mailer");
if (txt == NULL)
txt = camel_medium_get_header (medium, "x-newsreader");
if (txt == NULL)
diff --git a/src/libemail-engine/e-mail-folder-utils.c b/src/libemail-engine/e-mail-folder-utils.c
index e8aa726428..505b9f4b6f 100644
--- a/src/libemail-engine/e-mail-folder-utils.c
+++ b/src/libemail-engine/e-mail-folder-utils.c
@@ -28,8 +28,8 @@
#include "e-mail-utils.h"
-/* X-Mailer header value */
-#define X_MAILER ("Evolution " VERSION VERSION_SUBSTRING " " VERSION_COMMENT)
+/* User-Agent header value */
+#define USER_AGENT ("Evolution " VERSION VERSION_SUBSTRING " " VERSION_COMMENT)
typedef struct _AsyncContext AsyncContext;
@@ -107,8 +107,8 @@ e_mail_folder_append_message_sync (CamelFolder *folder,
full_display_name ? full_display_name : camel_folder_get_display_name (folder));
g_free (full_display_name);
- if (camel_medium_get_header (medium, "X-Mailer") == NULL)
- camel_medium_set_header (medium, "X-Mailer", X_MAILER);
+ if (camel_medium_get_header (medium, "User-Agent") == NULL)
+ camel_medium_set_header (medium, "User-Agent", USER_AGENT);
camel_mime_message_set_date (message, CAMEL_MESSAGE_DATE_CURRENT, 0);
diff --git a/src/libemail-engine/e-mail-session-utils.c b/src/libemail-engine/e-mail-session-utils.c
index 1384be2b6f..c86909d743 100644
--- a/src/libemail-engine/e-mail-session-utils.c
+++ b/src/libemail-engine/e-mail-session-utils.c
@@ -26,8 +26,8 @@
#include <libemail-engine/e-mail-utils.h>
#include <libemail-engine/mail-tools.h>
-/* X-Mailer header value */
-#define X_MAILER ("Evolution " VERSION VERSION_SUBSTRING " " VERSION_COMMENT)
+/* User-Agent header value */
+#define USER_AGENT ("Evolution " VERSION VERSION_SUBSTRING " " VERSION_COMMENT)
/* FIXME: Temporary - remove this after we move filter/ to eds */
#define E_FILTER_SOURCE_OUTGOING "outgoing"
@@ -814,7 +814,7 @@ e_mail_session_send_to (EMailSession *session,
medium = CAMEL_MEDIUM (message);
- camel_medium_set_header (medium, "X-Mailer", X_MAILER);
+ camel_medium_set_header (medium, "User-Agent", USER_AGENT);
/* Do this before removing "X-Evolution" headers. */
transport = e_mail_session_ref_transport_for_message (
diff --git a/src/libemail-engine/mail-ops.c b/src/libemail-engine/mail-ops.c
index 04ea234211..a1716bf7c8 100644
--- a/src/libemail-engine/mail-ops.c
+++ b/src/libemail-engine/mail-ops.c
@@ -46,8 +46,7 @@
#define w(x)
#define d(x)
-/* XXX Make this a preprocessor definition. */
-const gchar *x_mailer = "Evolution " VERSION VERSION_SUBSTRING " " VERSION_COMMENT;
+#define USER_AGENT ("Evolution " VERSION VERSION_SUBSTRING " " VERSION_COMMENT)
/* used for both just filtering a folder + uid's, and for filtering a whole folder */
/* used both for fetching mail, and for filtering mail */
@@ -599,7 +598,7 @@ mail_send_message (struct _send_queue_msg *m,
if (!message)
return;
- camel_medium_set_header (CAMEL_MEDIUM (message), "X-Mailer", x_mailer);
+ camel_medium_set_header (CAMEL_MEDIUM (message), "User-Agent", USER_AGENT);
/* Do this before removing "X-Evolution" headers. */
service = e_mail_session_ref_transport_for_message (
diff --git a/src/mail/e-mail-reader-utils.c b/src/mail/e-mail-reader-utils.c
index cc8bd28861..5b69698cd7 100644
--- a/src/mail/e-mail-reader-utils.c
+++ b/src/mail/e-mail-reader-utils.c
@@ -1965,8 +1965,10 @@ mail_reader_edit_messages_composer_created_cb (GObject *source_object,
g_warning ("%s: Failed to create msg composer: %s", G_STRFUNC, error->message);
g_clear_error (&error);
} else {
- camel_medium_remove_header (
- CAMEL_MEDIUM (ccd->message), "X-Mailer");
+ camel_medium_remove_header (CAMEL_MEDIUM (ccd->message), "User-Agent");
+ camel_medium_remove_header (CAMEL_MEDIUM (ccd->message), "X-Mailer");
+ camel_medium_remove_header (CAMEL_MEDIUM (ccd->message), "X-Newsreader");
+ camel_medium_remove_header (CAMEL_MEDIUM (ccd->message), "X-MimeOLE");
em_utils_edit_message (
composer, ccd->folder, ccd->message, ccd->message_uid,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]