shithub: mongrel

Download patch

ref: 92db4c42d5aa5542922ae24a54f7db88ac50cfbb
parent: c0ec5cec79df2a0be9b96c3f078efa08d7bccf3f
author: phil9 <telephil9@gmail.com>
date: Mon Feb 14 00:20:06 EST 2022

fix text attachments not showing in parts list

	we were skipping text/plain parts without considering whether they
	were inline text or attachments.
	We now explicitely check whether they are attachements and show them
	in the parts list.

--- a/a.h
+++ b/a.h
@@ -28,6 +28,7 @@
 	long time;
 	int flags;
 	char *type;
+	char *disposition;
 	char *filename;
 	char *body;
 	Mlist *parts;
--- a/mbox.c
+++ b/mbox.c
@@ -114,6 +114,7 @@
 	m->date = f[4];
 	m->subject = f[5];
 	m->type = f[6];
+	m->disposition = f[7];
 	m->filename = f[8];
 	if(n > 17)
 		m->flags = parseflags(f[17]);
--- a/pager.c
+++ b/pager.c
@@ -82,7 +82,7 @@
 		if(strncmp(p->type, "multipart/", 10) == 0)
 			collectparts(p);
 		else{
-			if(strcmp(p->type, "text/plain") == 0)
+			if(strcmp(p->type, "text/plain") == 0 && strncmp(p->disposition, "file", 4) != 0)
 				continue;
 			parts[nparts++] = p;
 		}