Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

W 15297544 ACB configuration for Email Connector #2541

Open
wants to merge 3 commits into
base: latest
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
|Parameter types | Array of xref:database-documentation.adoc#ParameterType[Parameter Type]. Use this parameter to optionally specify the type of (one or more) of the parameters in the query. If a value is provided, you're not required to reference all of the parameters. You can't reference a parameter that is not present in the input values. | No
| Target Variable | Name of the variable that stores the operation's output. | No
| Target Value a| Expression that evaluates the operation's output. The expression outcome is stored in the target variable. | No
| Error Mappings | This attribute is not currently enabled. | No
| Error Mappings a| Creates custom error types that you map to Mule error types. The mappings can help you further differentiate and group errors in your app. This attribute is not currently enabled in the configuration UI. Configure it in the XML editor. See xref:mule-runtime::mule-error-concept.adoc[]. | No
|Reconnection Strategy |When an operation in a Mule application fails to connect to an external server, the default behavior is for the operation to fail immediately and return a connectivity error. You can modify the default behavior by configuring the reconnection strategy for the operation. This attribute is not currently enabled in the configuration UI. Configure it in the XML editor. See xref:database-documentation.adoc#reconnect[Reconnect] and xref:database-documentation.adoc#reconnect[Reconnect Forever], and <<configuring-reconnection-strategy>>. | No
|===

Expand All @@ -67,7 +67,7 @@
|Parameter types | Array of xref:database-documentation.adoc#ParameterType[Parameter Type]. Use this parameter to optionally specify the type of (one or more) of the parameters in the query. If a value is provided, you're not required to reference all of the parameters. You can't reference a parameter that is not present in the input values. | No
| Target Variable | Name of the variable that stores the operation's output. | No
| Target Value a| Expression that evaluates the operation's output. The expression outcome is stored in the target variable. | No
| Error Mappings | This attribute is not currently enabled. | No
| Error Mappings a| Creates custom error types that you map to Mule error types. The mappings can help you further differentiate and group errors in your app. This attribute is not currently enabled in the configuration UI. Configure it in the XML editor. See xref:mule-runtime::mule-error-concept.adoc[]. | No
|Reconnection Strategy |When an operation in a Mule application fails to connect to an external server, the default behavior is for the operation to fail immediately and return a connectivity error. You can modify the default behavior by configuring the reconnection strategy for the operation. This attribute is not currently enabled in the configuration UI. Configure it in the XML editor. See xref:database-documentation.adoc#reconnect[Reconnect] and xref:database-documentation.adoc#reconnect[Reconnect Forever], and <<configuring-reconnection-strategy>>. | No
|===
// end::advanced-tab-streaming-strategy[]
Expand All @@ -93,7 +93,7 @@
| Auto Generated Keys Column Names | List of column names that indicates which auto-generated keys to make available for retrieval. This attribute is not currently enabled in the configuration UI. Configure it in the XML editor. See xref:database-documentation.adoc#insert[Insert]. | No
| Target Variable | Name of the variable that stores the operation's output. | No
| Target Value a| Expression that evaluates the operation's output. The expression outcome is stored in the target variable. | No
| Error Mappings | This attribute is not currently enabled. | No
| Error Mappings a| Creates custom error types that you map to Mule error types. The mappings can help you further differentiate and group errors in your app. This attribute is not currently enabled in the configuration UI. Configure it in the XML editor. See xref:mule-runtime::mule-error-concept.adoc[]. | No
|Reconnection Strategy |When an operation in a Mule application fails to connect to an external server, the default behavior is for the operation to fail immediately and return a connectivity error. You can modify the default behavior by configuring the reconnection strategy for the operation. This attribute is not currently enabled in the configuration UI. Configure it in the XML editor. See xref:database-documentation.adoc#reconnect[Reconnect] and xref:database-documentation.adoc#reconnect[Reconnect Forever], and <<configuring-reconnection-strategy>>. | No
|===
// end::advanced-tab-autogenerate-keys[]
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
//Used for fields that are repeated in the Email configuration email-acb-configuration

// tag::email-advanced-tab-attributes-trigger[]
. Click the *Advanced* tab to configure the following attributes:
+
[%header%autowidth.spread]
|===
| Attribute | Description | Required
| Primary node only |Select this option to execute the trigger only on the primary node when the app is running in a cluster. | No
| Redelivery policy a| Redelivery policy | This attribute is not currently enabled in the configuration UI. Configure it in the XML editor. See xref:email-documentation.adoc#RedeliveryPolicy[Redelivery Policy]. | No
| Attachment naming strategy a| Specify a strategy for how to name attachments:

** NAME
** NAME_HEADERS
** NAME_HEADERS_SUBJECT | No
| Reconnection strategy a| When an operation in a Mule application fails to connect to an external server, the default behavior is for the operation to fail immediately and return a connectivity error. You can modify the default behavior by configuring the reconnection strategy for the operation. This attribute is not currently enabled in the configuration UI. Configure it in the XML editor. See xref:email-documentation.adoc#reconnect[Reconnect] and xref:email-documentation.adoc#reconnect-forever[Reconnect Forever], and <<configuring-reconnection-strategy>>.
|===
// end::email-advanced-tab-attributes-trigger[]

// tag::email-advanced-tab-attributes-operations[]
. Click the *Advanced* tab to configure the following attributes:
+
[%header%autowidth.spread]
|===
| Attribute | Description | Required
| Target Variable | Name of the variable that stores the operation's output. | No
| Target Value a| Expression that evaluates the operation's output. The expression outcome is stored in the target variable. | No
| Error Mappings a| Creates custom error types that you map to Mule error types. The mappings can help you further differentiate and group errors in your app. This attribute is not currently enabled in the configuration UI. Configure it in the XML editor. See xref:mule-runtime::mule-error-concept.adoc[]. | No
|Reconnection Strategy |When an operation in a Mule application fails to connect to an external server, the default behavior is for the operation to fail immediately and return a connectivity error. You can modify the default behavior by configuring the reconnection strategy for the operation. This attribute is not currently enabled in the configuration UI. Configure it in the XML editor. See xref:database-documentation.adoc#reconnect[Reconnect] and xref:email-documentation.adoc#reconnect[Reconnect Forever], and <<configuring-reconnection-strategy>>. | No
|===
// end::email-advanced-tab-attributes-operations[]
178 changes: 178 additions & 0 deletions email/1.7/modules/ROOT/pages/email-acb-configuration.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
////
Set connector-specific values for the following variables:

* {exchange-search-name} - Lower case term used to find the connector in Exchange. For example, redis.
* {connector-name} - Name of the connector without the word "Connector." For example, Redis.
* {version} - Connector version. For example, 1.0.
* {lc-connector-name} - Lower case connector name to use in the links in the Next Steps and See Also sections. For example, redis.
* {studio-connector-name} - Name of the connector as it appears in the Available modules section in the Studio Add Dependencies to Project window. For example, NetSuite Connector - Mule 4.
////

:exchange-search-name: <email>
:connector-name: <Email>
:version: <value>
:lc-connector-name: <email>
:studio-connector-name: <Email Connector - Mule 4>

// Comment out the next line if the connector does not use TLS.
:tls:

// Remove comments from the next line if the connector has an Additional Configuration topic
//:additional-config:

= Using Anypoint Code Builder to Configure Database Connector - Mule 4

include::connectors::partial$configure-acb-connectors-partial.adoc[tag="acb-connector-config-intro"]

== Creating a New Integration Project

include::connectors::partial$configure-acb-connectors-partial.adoc[tag="acb-create-integration-project"]

== Adding the Connector to Your Integration Project

include::connectors::partial$configure-acb-connectors-partial.adoc[tag="acb-add-connector-to-project"]

[[configuring-trigger]]
== Configuring the Trigger For the Flow

A trigger (source) initiates a flow when a specified condition is met.

You can configure one of these triggers to use with Email Connector:

* *On New Email - IMAP* +
//Initiates a flow by retrieving all the emails from an IMAP mailbox folder. Watermarking is supported with this protocol. This wording needs clarity. Ask dev.
* *On New Email - POP3* +
Initiates a flow by retrieving all the emails from an POP3 mailbox folder
* *HTTP > Listener* +
Initiates a flow each time it receives a request on the configured host and port
* *Scheduler* +
Initiates a flow when a time-based condition is met
+
See xref:anypoint-code-builder::acb-component-scheduler.adoc[].

=== Configuring On New Email - POP3

To configure the *On New Email - POP3* trigger:

. Add the *On New Email - POP3* component to the canvas.
. Click the *On New Email - POP3* component on the canvas.
. On the *General* tab, configure the following attributes:
+
[%header%autowidth.spread]
|===
| Attribute | Description | Required
| Folder | Email folder that receives the sent email. | No
|Delete after retrieve a| If selected, retrieved emails are deleted after the operation completes. Deleting processed emails ensures that the next processed emails are new ones. The *Delete after retrieve* attribute is commonly used with the POP3 protocol because it doesn't support watermarking. | No
|Pop 3 matcher a| Custom matchers that enables filtering dispatched messages. Each source matcher can filter emails by dates, addresses, subject, flags, and so on. This attribute is not currently enabled in the configuration UI. Configure it in the XML editor, for example:

[source, xml, linenums]
----
<flow name="OnNewEmail-POP3">
<email:listener-pop3 config-ref="Email_POP3">
<scheduling-strategy >
<fixed-frequency frequency="1000" startDelay="0" timeUnit="MILLISECONDS"/>
</scheduling-strategy>
<email:pop3-matcher subjectRegex="IMPORTANT"/>
</email:listener-pop3>
</flow>
----
| No
|Scheduling strategy a| Triggers the flow's execution based on a time-based condition. This field is not currently enabled in the configuration UI. Configure it in the XML editor. See <<scheduling-strategy>>. | Yes
|===
include::connectors::partial$acb-email-connector-partial.adoc[tag="email-advanced-tab-attributes"]

=== Configuring On New Email - IMAP

To configure the *On New Email - IMAP* trigger:

. Add the *On New Email - IMAP* component to the canvas.
. Click the *On New Email - IMAP* component on the canvas.
. On the *General* tab, configure the following attributes:
+
[%header%autowidth.spread]
|===
| Attribute | Description | Required
| Folder | Email folder that receives the sent email. | No
|Delete after retrieve a| If selected, retrieved emails are deleted after the operation completes. Deleting processed emails ensures that the next processed emails are new ones. | No
| Enable Watermark | Watermark emails by received date so that only messages that contain emails received after the last poll executed are dispatched. | No
|Imap matcher | Custom matchers that enables filtering dispatched messages. Each source matcher can filter emails by dates, addresses, subject, flags, and so on. This attribute is not currently enabled in the configuration UI. Configure it in the XML editor, for example:

[source, xml, linenums]
----
<flow name="OnNewEmail-IMAP">
<email:listener-imap config-ref="Email_IMAP">
<scheduling-strategy >
<fixed-frequency frequency="1000" startDelay="0" timeUnit="MILLISECONDS"/>
</scheduling-strategy>
<email:imap-matcher subjectRegex="IMPORTANT"/>
</email:listener-imap>
</flow>
---- | No
| Enable Remote Search | When used with the *Imap matcher* attribute, specifies whether you want to apply the filters server-side. | No
|Scheduling strategy a| Triggers the flow's execution based on a time-based condition. This field is not currently enabled in the configuration UI. Configure it in the XML editor. See <<scheduling-strategy>>. | Yes
|===
include::connectors::partial$acb-email-connector-partial.adoc[tag="email-advanced-tab-attributes-trigger"]

[[adding-components-to-project]]
== Adding Components to Your Project

include::connectors::partial$configure-acb-connectors-partial.adoc[tag="acb-add-components-to-project"]

[[add-global-config]]
== Adding a Global Configuration

include::connectors::partial$configure-acb-connectors-partial.adoc[tag="acb-add-global-config"]

[[configuring-component-attributes]]
== Configuring Component Attributes

include::connectors::partial$configure-acb-connectors-partial.adoc[tag="acb-configure-attributes-trigger"]

=== Configuring Count Messages - IMAP

Gets the total number of messages in the specified IMAP mailbox folder.

. Click the *Count Messages - IMAP* operation on the canvas UI to configure the following attributes in the *General* tab:
+
[%header%autowidth.spread]
|===
| Attribute | Description | Required
| Mailbox folder | | No
| Count filter | |No
|===
include::connectors::partial$configure-acb-connectors-partial.adoc[tag="acb-configure-attributes-operations"]

=== Configuring Count Messages - POP3

Gets the total number of messages in the specified POP3 mailbox folder. Specify the folder in the XML editor, for example:

[source, xml, linenums]
----
<email:pop3-config name="Email_POP3" >
<email:pop3-connection host="192.168.0.1" user="usertest" password="userpass" />
</email:pop3-config>
<email::pop3-config name="HTTP_Listener_config" >
<http:listener-connection host="0.0.0.0" port="8081" />
</-config>
<flow name="email1Flow" >
<email::pop3 config-ref="HTTP_Listener_config" path="/count"/>
<email:count-messages-imap doc:name="Count messages - POP3" config-ref="Email_POP3" mailboxFolder="#[vars.mailboxFolder]" countFilter="NEW"/>
</flow>
</mule>
----

include::connectors::partial$configure-acb-connectors-partial.adoc[tag="acb-configure-attributes-operations"]





[[scheduling-strategy]]
== Configuring the Scheduling Strategy in XML

include::connectors::partial$acb-xml-examples.adoc[tag="db-scheduling-strategy"]

[[configuring-reconnection-strategy]]
== Configuring the Reconnection Strategy in XML

include::connectors::partial$acb-xml-examples.adoc[tag="reconnection-strategy"]
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
= Count Messages with Email Connector - Mule 4

Anypoint Connector for Email (Email Connector) provides the *Count messages - IMAP* and *Count messages - POP3* operations, which get the total amount of messages in a specified mailbox folder.
Anypoint Connector for Email (Email Connector) provides the *Count messages - IMAP* and *Count messages - POP3* operations, which get the total number of messages in a specified mailbox folder.

== Configure Count Messages - IMAP Operation

Expand Down