Fetches emails from the IMAP server based on the provided search criteria.
The IMAP connection object.
The search criteria for fetching emails.
A promise that resolves to an array of fetched emails.
An error if fetching emails fails.
Fetches emails from the IMAP server based on the provided search criteria.