From 06270b26184b5a7a292a7475bb53d82c3295bdcb Mon Sep 17 00:00:00 2001 From: hiro Date: Tue, 13 Jul 2010 04:59:56 +0000 Subject: fully implemented RFC 2046. git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@2610 ee746299-78ed-0310-b773-934348b2243d --- libsylph/procmsg.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'libsylph') diff --git a/libsylph/procmsg.c b/libsylph/procmsg.c index f1e88b08..b8f3af16 100644 --- a/libsylph/procmsg.c +++ b/libsylph/procmsg.c @@ -1842,6 +1842,35 @@ skip: return -1; } + /* write out first headers */ + if (i == 0) { + rewind(fp); + while (procheader_get_one_field(buf, sizeof(buf), fp, NULL) != -1) { + if (!g_ascii_strncasecmp(buf, "Content-", 8) || + !g_ascii_strncasecmp(buf, "Subject", 7) || + !g_ascii_strncasecmp(buf, "Message-ID", 10) || + !g_ascii_strncasecmp(buf, "Encrypted", 9) || + !g_ascii_strncasecmp(buf, "MIME-Version", 12)) + continue; + fputs(buf, tmp_fp); + fputs("\n", tmp_fp); + } + + while (procheader_get_one_field(buf, sizeof(buf), fp, NULL) != -1) { + if (!g_ascii_strncasecmp(buf, "Content-", 8) || + !g_ascii_strncasecmp(buf, "Subject", 7) || + !g_ascii_strncasecmp(buf, "Message-ID", 10) || + !g_ascii_strncasecmp(buf, "Encrypted", 9) || + !g_ascii_strncasecmp(buf, "MIME-Version", 12)) { + fputs(buf, tmp_fp); + fputs("\n", tmp_fp); + } + } + + /* header-body separator */ + fputs("\n", tmp_fp); + } + out_size = get_left_file_size(fp); if (out_size < 0) { g_warning("cannot tell left file size of part %d\n", i + 1); -- cgit v1.2.3