summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--imbox.14
-rw-r--r--imbox.c8
2 files changed, 9 insertions, 3 deletions
diff --git a/imbox.1 b/imbox.1
index b414232..1d3d648 100644
--- a/imbox.1
+++ b/imbox.1
@@ -1,4 +1,4 @@
-.Dd December 22, 2019
+.Dd December 23, 2019
 .Dt IMBOX 1
 .Os
 .
@@ -135,7 +135,7 @@ imbox -T list@example.org june@causal.agency | git am
 .Sh CAVEATS
 The
 .Nm
-utility only expects to deal with plain-text messages.
+utility only exports plain-text messages.
 .
 .Sh BUGS
 Send mail to
diff --git a/imbox.c b/imbox.c
index fff867f..e620a61 100644
--- a/imbox.c
+++ b/imbox.c
@@ -334,7 +334,13 @@ int main(int argc, char *argv[]) {
 				fprintf(imap, "%s EXAMINE \"%s\"\r\n", Atoms[Examine], mailbox);
 			}
 			break; case Examine: {
-				fprintf(imap, "%s SEARCH CHARSET UTF-8", Atoms[Search]);
+				fprintf(
+					imap,
+					"%s SEARCH CHARSET UTF-8 OR "
+					"NOT HEADER Content-Type \"\" "
+					"HEADER Content-Type \"text/plain\"",
+					Atoms[Search]
+				);
 				if (subject) fprintf(imap, " SUBJECT \"%s\"", subject);
 				if (from) fprintf(imap, " FROM \"%s\"", from);
 				if (to) fprintf(imap, " TO \"%s\"", to);