Search code examples
outlook-restapimailkit

Is there a way to receive all wild card emails programatically?


For example, I have a domain named foo.com. I created the following email addresses:

I need to listen to all email addresses created from the foo.com domain.

Also, I am the owner of the foo.com domain.

Can I create an Imap Idle Client that will listen for all wild card email addresses?

I am also looking into outlook mail REST API for this.

Please let me if there is any API that will listen for all email address in a domain.


Solution

  • For the Mailkit approach, I have learned that I will have to create an Imap client for each email address. There is no other way.

    Office 365 API allows me to read all emails within an organization. I will need to create a multitenant application in Azure AD and allow Read Mail in All mailboxes.

    After that, I need to check admin_consent only.

    Best way to get emails in an organization using the Outlook 365 API