commit 2464379f089cf522d0e68da09b34c8ff85aedd80
parent 47e9a6a807ab30baae05f4557f82d63c70108a59
Author: Paul <paul@claws-mail.org>
Date: Tue, 24 Sep 2019 17:06:58 +0100
fix bug 4253, 'Claws metadata included in MBOX exports'
Diffstat:
5 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/src/compose.c b/src/compose.c
@@ -2894,7 +2894,7 @@ static gint compose_parse_header(Compose *compose, MsgInfo *msginfo)
cm_return_val_if_fail(msginfo != NULL, -1);
- if ((fp = procmsg_open_message(msginfo)) == NULL) return -1;
+ if ((fp = procmsg_open_message(msginfo, FALSE)) == NULL) return -1;
procheader_get_header_fields(fp, hentry);
claws_fclose(fp);
@@ -3019,7 +3019,7 @@ static gint compose_parse_manual_headers(Compose *compose, MsgInfo *msginfo, Hea
cm_return_val_if_fail(msginfo != NULL, -1);
- if ((fp = procmsg_open_message(msginfo)) == NULL) return -1;
+ if ((fp = procmsg_open_message(msginfo, FALSE)) == NULL) return -1;
procheader_get_header_fields(fp, entries);
claws_fclose(fp);
diff --git a/src/mbox.c b/src/mbox.c
@@ -568,7 +568,7 @@ gint export_list_to_mbox(GSList *mlist, const gchar *mbox)
gchar buft[BUFFSIZE];
msginfo = (MsgInfo *)cur->data;
- msg_fp = procmsg_open_message(msginfo);
+ msg_fp = procmsg_open_message(msginfo, TRUE);
if (!msg_fp) {
continue;
}
diff --git a/src/plugins/spamassassin/spamassassin.c b/src/plugins/spamassassin/spamassassin.c
@@ -228,7 +228,7 @@ static gboolean mail_filtering_hook(gpointer source, gpointer data)
if (message_callback != NULL)
message_callback(_("SpamAssassin: filtering message..."));
- if ((fp = procmsg_open_message(msginfo)) == NULL) {
+ if ((fp = procmsg_open_message(msginfo, FALSE)) == NULL) {
debug_print("failed to open message file\n");
return FALSE;
}
diff --git a/src/procmsg.c b/src/procmsg.c
@@ -479,7 +479,7 @@ void procmsg_message_file_list_free(MsgInfoList *file_list)
g_slist_free(file_list);
}
-FILE *procmsg_open_message(MsgInfo *msginfo)
+FILE *procmsg_open_message(MsgInfo *msginfo, gboolean skip_special_headers)
{
FILE *fp;
gchar *file;
@@ -504,7 +504,8 @@ FILE *procmsg_open_message(MsgInfo *msginfo)
g_free(file);
- if (MSG_IS_QUEUED(msginfo->flags) || MSG_IS_DRAFT(msginfo->flags)) {
+ if (MSG_IS_QUEUED(msginfo->flags) || MSG_IS_DRAFT(msginfo->flags) ||
+ skip_special_headers == TRUE) {
gchar buf[BUFFSIZE];
while (claws_fgets(buf, sizeof(buf), fp) != NULL) {
@@ -578,7 +579,7 @@ void procmsg_get_filter_keyword(MsgInfo *msginfo, gchar **header, gchar **key,
case FILTER_BY_NONE:
return;
case FILTER_BY_AUTO:
- if ((fp = procmsg_open_message(msginfo)) == NULL)
+ if ((fp = procmsg_open_message(msginfo, FALSE)) == NULL)
return;
procheader_get_header_fields(fp, hentry);
claws_fclose(fp);
diff --git a/src/procmsg.h b/src/procmsg.h
@@ -316,7 +316,8 @@ gchar *procmsg_get_message_file_full (MsgInfo *msginfo,
gboolean get_body);
GSList *procmsg_get_message_file_list (MsgInfoList *mlist);
void procmsg_message_file_list_free (MsgInfoList *file_list);
-FILE *procmsg_open_message (MsgInfo *msginfo);
+FILE *procmsg_open_message (MsgInfo *msginfo,
+ gboolean skip_special_headers);
gboolean procmsg_msg_exist (MsgInfo *msginfo);
void procmsg_get_filter_keyword (MsgInfo *msginfo,