From 495ab59f09bce3be0376abe3be4604ea4aff41c4 Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Mon, 21 Sep 2015 18:47:54 -0700 Subject: [PATCH] Custom headers can't use the normal IMAP search http://virtualmin.com/node/38059 --- mailboxes/folders-lib.pl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mailboxes/folders-lib.pl b/mailboxes/folders-lib.pl index f338271f2..d8098b193 100755 --- a/mailboxes/folders-lib.pl +++ b/mailboxes/folders-lib.pl @@ -1051,7 +1051,13 @@ elsif ($folder->{'type'} == 4) { $what = "\"".$what."\"" } $field = "LARGER" if ($field eq "size"); - local $search = uc($field)." ".$what.""; + local $search; + if ($field =~ /^X-/i) { + $search = "header ".uc($field)." ".$what.""; + } + else { + $search = uc($field)." ".$what.""; + } $search = "NOT $search" if ($neg); push(@searches, $search); }