We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

ImapQueryBuilder with Exchange

When using the ImapQueryBuilder to filter by From address, it does not work when using IMAP to connect to Exchange. It’ll work with other secular accounts (Gmail, 1and1, etc.),

Here’s how we assign the query

And by calling _ImapQueryBuilder.GetQuery we get this:
{(‘From’ Contains ‘hi@mail.stackcommerce.com’)}

When we call to get the message collection, we don’t get any results even though the message is clearly in the mailbox:
_ImapMessageInfoCollection = _AsposeImapClient.ListMessages(_ImapQueryBuilder.GetQuery)

Any thoughts?


Hi Joseph,

Thank you for contacting Aspose Support team.

The issue is already known to us and as per our investigations, this is not a problem at Aspose.Email API end in case of Exchange server. When a message is sent to Exchange server from an internal user (of the same server), SMTP addresses (From, To, and so on) in address fields in this case are optimized by the server for internal users. For this reason, the MailQuery does not return messages in this specific case.