ms exchange online imap oauth source Microsoft Exchange IMAP OAuth2 Source

Provided by: "Apache Software Foundation"

Support Level for this Kamelet is: "Stable"

Receive unread emails from an IMAP Microsoft Exchange mail server, marking them as read once they are received. It uses OAuth2 to authenticate IMAP session.

Configuration Options

The following table summarizes the configuration options available for the ms-exchange-online-imap-oauth-source Kamelet:

Property Name Description Type Default Example

clientId

Client ID

Required Azure Active Directory Application Client ID.

string

clientSecret

Client Secret

Required The Azure Active Directory Application Client Secret.

string

tenantId

Tenant ID

Required Azure Active Directory Tenant ID.

string

username

Username

Required The username to access the mail box.

string

arthur@mycompany.com//

connectionHost

Connection Host

The IMAP server host.

string

outlook.office365.com

connectionPort

Connection Port

The IMAP server port.

string

993

delay

Delay

The delay between fetches in milliseconds.

integer

60000

fetchSize

Fetch Size

The number of messages fetched for each poll (-1 for no limits).

integer

10

Dependencies

At runtime, the ms-exchange-online-imap-oauth-source Kamelet relies upon the presence of the following dependencies:

  • camel:core

  • camel:kamelet

  • camel:mail-microsoft-oauth

  • camel:mail

Camel JBang usage

Prerequisites

  • You’ve installed JBang.

  • You have executed the following command:

jbang app install camel@apache/camel

Supposing you have a file named route.yaml with this content:

- route:
    from:
      uri: "kamelet:timer-source"
      parameters:
        period: 10000
        message: 'test'
      steps:
        - to:
            uri: "kamelet:log-sink"

You can now run it directly through the following command

camel run route.yaml

Camel K Environment Usage

This section describes how you can use the ms-exchange-online-imap-oauth-source.

Knative source

You can use the ms-exchange-online-imap-oauth-source Kamelet as a Knative source by binding it to a Knative object.

ms-exchange-online-imap-oauth-source-pipe.yaml
apiVersion: camel.apache.org/v1
kind: Pipe
metadata:
  name: ms-exchange-online-imap-oauth-source-pipe
spec:
  source:
    ref:
      kind: Kamelet
      apiVersion: camel.apache.org/v1
      name: ms-exchange-online-imap-oauth-source
    properties:
      clientId: The Client ID
      clientSecret: The Client Secret
      tenantId: The Tenant ID
      username: " \arthur@mycompany.com//"
  sink:
    ref:
      kind: Channel
      apiVersion: messaging.knative.dev/v1
      name: mychannel

Prerequisite

You have Camel K installed on the cluster.

Procedure for using the cluster CLI

  1. Save the ms-exchange-online-imap-oauth-source-pipe.yaml file to your local drive, and then edit it as needed for your configuration.

  2. Run the source by using the following command:

    kubectl apply -f ms-exchange-online-imap-oauth-source-pipe.yaml

Procedure for using the Kamel CLI

Configure and run the source by using the following command:

kamel bind ms-exchange-online-imap-oauth-source -p "source.clientId=The Client ID" -p "source.clientSecret=The Client Secret" -p "source.tenantId=The Tenant ID" -p "source.username= arthur@mycompany.com//" channel:mychannel

This command creates the Kamelet Pipe in the current namespace on the cluster.

Kafka source

You can use the ms-exchange-online-imap-oauth-source Kamelet as a Kafka source by binding it to a Kafka topic.

ms-exchange-online-imap-oauth-source-pipe.yaml
apiVersion: camel.apache.org/v1
kind: Pipe
metadata:
  name: ms-exchange-online-imap-oauth-source-pipe
spec:
  source:
    ref:
      kind: Kamelet
      apiVersion: camel.apache.org/v1
      name: ms-exchange-online-imap-oauth-source
    properties:
      clientId: The Client ID
      clientSecret: The Client Secret
      tenantId: The Tenant ID
      username: " \arthur@mycompany.com//"
  sink:
    ref:
      kind: KafkaTopic
      apiVersion: kafka.strimzi.io/v1beta1
      name: my-topic

Prerequisites

  • You’ve installed Strimzi.

  • You’ve created a topic named my-topic in the current namespace.

  • You have Camel K installed on the cluster.

Procedure for using the cluster CLI

  1. Save the ms-exchange-online-imap-oauth-source-pipe.yaml file to your local drive, and then edit it as needed for your configuration.

  2. Run the source by using the following command:

    kubectl apply -f ms-exchange-online-imap-oauth-source-pipe.yaml

Procedure for using the Kamel CLI

Configure and run the source by using the following command:

kamel bind ms-exchange-online-imap-oauth-source -p "source.clientId=The Client ID" -p "source.clientSecret=The Client Secret" -p "source.tenantId=The Tenant ID" -p "source.username= arthur@mycompany.com//" kafka.strimzi.io/v1beta1:KafkaTopic:my-topic

This command creates the Kamelet Pipe in the current namespace on the cluster.