aboutsummaryrefslogtreecommitdiff
path: root/libsylph/procmsg.c
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2010-07-13 04:59:56 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2010-07-13 04:59:56 +0000
commit06270b26184b5a7a292a7475bb53d82c3295bdcb (patch)
tree06cd4f9839ccf8132617a892b12ab5cec509b004 /libsylph/procmsg.c
parent0ea184b3da8bcf2e614fb09af789f0b847e123a9 (diff)
fully implemented RFC 2046.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@2610 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'libsylph/procmsg.c')
-rw-r--r--libsylph/procmsg.c29
1 files changed, 29 insertions, 0 deletions
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);