imap_search fails when I am trying to include an escaped double quote in my search string. For example:
...
$search = 'David \"the bull\" Koopman';
$search = "BODY \"$search\"";
$result = imap_search($conn, $search, SE_UID);
Results in FALSE, the imap search command is never executed. I turned on tcpdump and watched the traffic from my server, the SEARCH command is never run. Remove the double quotes and the command is executed. I have tried double escaping, still doesn't work. I am going to report this as a bug.
Raw telnet command works fine:
00000005 UID SEARCH BODY "David \"the bull\" Koopman"
* SEARCH 1773
00000005 OK SEARCH done.