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
_ImapQueryBuilder.From.Contains(message.From.Address.ToLower)

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?

Thanks!

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.