+2009-03-07 [colin] 3.7.1cvs3
+
+ * src/messageview.c
+ * src/procmime.c
+ * src/procmime.h
+ Handle mimeparts that lack an end boundary.
+ They're invalid but it's too annoying for
+ normal users to fix.
+
2009-03-06 [wwp] 3.7.1cvs2
* src/compose.c
( cvs diff -u -r 1.9.2.14 -r 1.9.2.15 po/cs.po; cvs diff -u -r 1.58.2.42 -r 1.58.2.43 po/de.po; cvs diff -u -r 1.1.2.21 -r 1.1.2.22 po/fi.po; cvs diff -u -r 1.42.2.45 -r 1.42.2.46 po/fr.po; cvs diff -u -r 1.5.2.12 -r 1.5.2.13 po/hu.po; cvs diff -u -r 1.28.2.12 -r 1.28.2.13 po/nl.po; cvs diff -u -r 1.50.2.34 -r 1.50.2.35 po/pt_BR.po; cvs diff -u -r 1.4.2.10 -r 1.4.2.11 po/sv.po; cvs diff -u -r 1.5.2.28 -r 1.5.2.29 po/zh_CN.po; ) > 3.7.0cvs78.patchset
( cvs diff -u -r 1.1.2.14 -r 1.1.2.15 src/gedit-print.c; cvs diff -u -r 1.1.2.12 -r 1.1.2.13 src/gtk/gtksourceprintjob.c; ) > 3.7.1cvs1.patchset
( cvs diff -u -r 1.487 -r 1.488 src/compose.c; cvs diff -u -r 1.10 -r 1.11 src/folder_item_prefs.c; cvs diff -u -r 1.6 -r 1.7 src/folder_item_prefs.h; cvs diff -u -r 1.65 -r 1.66 src/prefs_folder_item.c; ) > 3.7.1cvs2.patchset
+( cvs diff -u -r 1.94.2.200 -r 1.94.2.201 src/messageview.c; cvs diff -u -r 1.49.2.127 -r 1.49.2.128 src/procmime.c; cvs diff -u -r 1.17.2.23 -r 1.17.2.24 src/procmime.h; ) > 3.7.1cvs3.patchset
MICRO_VERSION=1
INTERFACE_AGE=0
BINARY_AGE=0
-EXTRA_VERSION=2
+EXTRA_VERSION=3
EXTRA_RELEASE=
EXTRA_GTK2_VERSION=
return encinfo;
}
+static gboolean find_broken_func(GNode *node, gpointer data)
+{
+ MimeInfo *mimeinfo = (MimeInfo *) node->data;
+ MimeInfo **brokeninfo = (MimeInfo **) data;
+
+ if (mimeinfo->broken) {
+ *brokeninfo = mimeinfo;
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+static MimeInfo *find_broken_part(MimeInfo *rootinfo)
+{
+ MimeInfo *brokeninfo = NULL;
+
+ g_node_traverse(rootinfo->node, G_IN_ORDER, G_TRAVERSE_ALL, -1,
+ find_broken_func, &brokeninfo);
+
+ return brokeninfo;
+}
+
gint messageview_show(MessageView *messageview, MsgInfo *msginfo,
gboolean all_headers)
{
gchar *text = NULL;
gchar *file;
- MimeInfo *mimeinfo, *encinfo;
+ MimeInfo *mimeinfo, *encinfo, *brokeninfo;
gchar *subject = NULL;
cm_return_val_if_fail(msginfo != NULL, -1);
}
}
+ while ((brokeninfo = find_broken_part(mimeinfo)) != NULL) {
+ noticeview_show(messageview->noticeview);
+ noticeview_set_icon(messageview->noticeview,
+ STOCK_PIXMAP_NOTICE_WARN);
+ noticeview_set_text(messageview->noticeview, _("Message doesn't conform to MIME standard. "
+ "It may render wrongly."));
+ gtk_widget_hide(messageview->noticeview->button);
+ gtk_widget_hide(messageview->noticeview->button2);
+ break;
+ }
+
if (messageview->msginfo != msginfo) {
procmsg_msginfo_free(messageview->msginfo);
messageview->msginfo = NULL;
FILE *fp;
int result = 0;
gboolean done = FALSE;
+ gboolean start_found = FALSE;
+ gboolean end_found = FALSE;
boundary = g_hash_table_lookup(mimeinfo->typeparameters, "boundary");
if (!boundary)
FILE_OP_ERROR(mimeinfo->data.filename, "fopen");
return;
}
+
fseek(fp, mimeinfo->offset, SEEK_SET);
while ((p = fgets(buf, sizeof(buf), fp)) != NULL && result == 0) {
if (ftell(fp) - 1 > (mimeinfo->offset + mimeinfo->length))
break;
if (IS_BOUNDARY(buf, boundary, boundary_len)) {
+ start_found = TRUE;
+
if (lastoffset != -1) {
gint len = (ftell(fp) - strlen(buf)) - lastoffset - 1;
if (len < 0)
if (buf[2 + boundary_len] == '-' &&
buf[2 + boundary_len + 1] == '-') {
+ end_found = TRUE;
break;
}
for (i = 0; i < (sizeof hentry / sizeof hentry[0]) ; i++) {
lastoffset = ftell(fp);
}
}
+
+ if (start_found && !end_found && lastoffset != -1) {
+ gint len = (ftell(fp) - strlen(buf)) - lastoffset - 1;
+
+ if (len >= 0) {
+ result = procmime_parse_mimepart(mimeinfo,
+ hentry[0].body, hentry[1].body,
+ hentry[2].body, hentry[3].body,
+ hentry[4].body, hentry[5].body,
+ hentry[6].body, hentry[7].body,
+ mimeinfo->data.filename, lastoffset,
+ len, short_scan);
+ }
+ mimeinfo->broken = TRUE;
+ }
+
for (i = 0; i < (sizeof hentry / sizeof hentry[0]); i++) {
g_free(hentry[i].body);
hentry[i].body = NULL;
/* Create MimeInfo */
mimeinfo = procmime_mimeinfo_new();
mimeinfo->content = MIMECONTENT_FILE;
+ mimeinfo->lax_parse = parent->lax_parse;
+
if (parent != NULL) {
if (g_node_depth(parent->node) > 32) {
/* 32 is an arbitrary value
/* Privacy */
PrivacyData *privacy;
+
+ gboolean broken;
};
#define IS_BOUNDARY(s, bnd, len) \