diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/compose.c | 20 | ||||
-rw-r--r-- | src/main.c | 6 |
2 files changed, 15 insertions, 11 deletions
diff --git a/src/compose.c b/src/compose.c index ccb465db..d1c96479 100644 --- a/src/compose.c +++ b/src/compose.c @@ -4704,17 +4704,15 @@ static gint compose_write_headers(Compose *compose, FILE *fp, } /* Program version and system info */ - if (compose->to_list && !IS_IN_CUSTOM_HEADER("X-Mailer")) { - fprintf(fp, "X-Mailer: %s (GTK+ %d.%d.%d; %s)\n", - prog_version, - gtk_major_version, gtk_minor_version, gtk_micro_version, - TARGET_ALIAS); - } - if (compose->newsgroup_list && !IS_IN_CUSTOM_HEADER("X-Newsreader")) { - fprintf(fp, "X-Newsreader: %s (GTK+ %d.%d.%d; %s)\n", - prog_version, - gtk_major_version, gtk_minor_version, gtk_micro_version, - TARGET_ALIAS); + if (prefs_common.user_agent_str) { + if (compose->to_list && !IS_IN_CUSTOM_HEADER("X-Mailer")) { + fprintf(fp, "X-Mailer: %s\n", + prefs_common.user_agent_str); + } + if (compose->newsgroup_list && !IS_IN_CUSTOM_HEADER("X-Newsreader")) { + fprintf(fp, "X-Newsreader: %s\n", + prefs_common.user_agent_str); + } } /* custom headers */ @@ -265,6 +265,12 @@ int main(int argc, char *argv[]) prefs_display_header_read_config(); colorlabel_read_config(); + prefs_common.user_agent_str = g_strdup_printf + ("%s (GTK+ %d.%d.%d; %s)", + prog_version, + gtk_major_version, gtk_minor_version, gtk_micro_version, + TARGET_ALIAS); + #ifdef G_OS_WIN32 { gchar *path; |