summary refs log tree commit diff
path: root/imbox.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2019-12-23 14:15:19 -0500
committerJune McEnroe <june@causal.agency>2019-12-23 14:15:36 -0500
commit16fef058063a5a83882c420a5c6e7a4c7ee348dd (patch)
tree8af724b2008f783992ef75a996c0b90975aee817 /imbox.c
parentProperly support using drill rather than dig (diff)
downloadimbox-16fef058063a5a83882c420a5c6e7a4c7ee348dd.tar.gz
imbox-16fef058063a5a83882c420a5c6e7a4c7ee348dd.zip
Restrict search to plain-text messages
Diffstat (limited to '')
-rw-r--r--imbox.c8
1 files changed, 7 insertions, 1 deletions
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);