Re: how do I download messages from the imap server?
I'll say it again, it's best to set up message filtering for IMAP on your IMAP server side, regardless of the provider. It's a part of the protocol and it's on the server side so that the filtering you do and the folders you create are automatically propagated across all devices you might ever use to access your e-mail. It saves you having to do this work again when you get a new computer, for instance, because it's all done on the server side.
For Gmail I wrote the following instructions a while back: Creating IMAP Labels (Folders) and Filters for Gmail
Brian - Windows 10 Home, 64-Bit, Version 1703, Build 15063 (dot level on request - it changes too often to keep in signature)
The opposite of a correct statement is a false statement. But the opposite of a profound truth may well be another profound truth.
~ Niels Bohr