>It turns out that Versamail wasn't pulling anything because it gave >us the IMAP search terms in parenthesis, where it wasn't expected. >I've replaced the calls to strcasecmp with calls to strstr which will >pick up these cases. Thanks for the patch. After reviewing it, I determined that it wouldn't really be desirable to do it this way. Not only does strstr() run slower than strcmp() -- and when you're searching tens of thousands of messages that makes a big difference -- but strstr() could perform substring matches where they wouldn't be desirable. I've applied a different fix, though. It now strips out the parentheses in situations such as "UID SEARCH (NOT DELETED) (NOT SEEN)" where they are superfluous. I searched a bigbig mailbox with that particular command and it seemed to work. Let me know if it works ok for you.