$ 0 0 And the answer is: I'm stupid. Forgot to declare my Imap.Message as an array, obviously. Still trying to get the search query to work, but I'll get back to you. Sorry to waste your time with my newb mistake.