Email event adapter is an internal event adaper that comes with WSO2 products by default. It can be configured with XML, text, and JSON input mapping types.
Excerpt | ||||
---|---|---|---|---|
| ||||
NOTE TO WRITERS: Add the TOC here.
|
Prerequisites
Follow the steps below to complete the prerequisites before starting the input adapter configurations.
- Enable the mail transport receiver in Axis2 level by uncommenting the following line in
<PRODUCT_HOME>/repository/conf/axi2/axis2.xml
file:
<transportReceiver name="mailto" class="org.apache.axis2.transport.mail.MailTransportListener"/> - Remove any rich text formatting from the email body. It must contain only plain text.
Configuring input email event adapter
The topics below explain how to You can configure the email input event adapter using the management console or using a configuration file.
Anchor | ||||
---|---|---|---|---|
|
...
Configure using the management console
Follow the instructions below to configure input email event adapter using the management console. This deploys the event adapter in the <PRODUCT_HOME>
/
repository/
deployment/
server/
inputeventadaptors/
directory.
- Log in to product's management console, and click Event Processor Configs in the Configure menu.
- Click Add Input Event Adaptor in the Input Event Adaptors menuAdaptors in the Event Processor Configs menu, and then click Add Input Event Adaptor.
Enter details as shown in the below example.
FieldsProperties of the above
screenconfiguration are described below
:.
: emailAdaptorProperty Description Event Adaptor Name Name of the input event adapter Event Adaptor Type :Type of the input event adapter Receiving Mail Address .Mail address, where the product used to retrieve the mails :Receiving Mail Protocol popCan be either imapPOP or imapIMAP (If you select IMAP, make sure it is enabled in your .email account settings) : In whichPoll Interval .The time limit, in which the product needs to check for new mails (Receiving Mail Protocol Host: pop.gmail.com pop)for (POP, and imap.gmail.com imap)for :IMAP Receiving Mail Protocol Port (995 pop)for (POP, and 993 imap)for - Click Add Event Adaptor.
Info |
---|
After an adapter is successfully added, click Edit to change its configuration and redeploy it. This will open a XML-based editor allowing you to edit the event adapter configurations from the UI. Do your modifications and click Update . You can also delete it or enable statistics and tracing using the provided UI options. |
Info |
---|
Email event adapter can be configured with XML input mapping, Text Mapping and JSON Mapping. |
...
IMAP User Name Username of the email account Password Username of the email account Receiving Mail Protocol Port SocketFactory Class Class of the receiving mail protocol port Receiving Mail Protocol SocketFactory FallBack To enable or disable fallback of the receiving mail protocol class - Click Add Event Adaptor.
Anchor | ||||
---|---|---|---|---|
|
...
Configure using a configuration file
Follow the instructions below to configure input email event adapter using a configuration file.
Create a an XML file with the following Qpid input email event adaptor adapter configurations.
Info Input event adaptor implementation must start with
<inputEventAdaptor>
as the root element.Code Block language html/xml <inputEventAdaptor name="emailAdaptor" type="email" xmlns="http://wso2.org/carbon/eventadaptormanager"> <property name="mail.protocol.socketFactory.fallback">false</property> <property name="transport.mail.Address">wso2cep@gmail.com</property> <property name="mail.protocol.password">mailpassword</property> <property name="mail.protocol.host">pop.gmail.com</property> <property name="mail.protocol.port">995</property> <property name="mail.protocol.user">wso2cep</property> <property name="transport.PollInterval">5</property> <property name="transport.mail.Protocol">pop3</property> <property name="mail.protocol.socketFactory.class">javax.net.ssl.SSLSocketFactory</property> </inputEventAdaptor>
Add it in the XML file to the
<PRODUCT_HOME>/repository/deployment/server/inputeventadaptors/
directory.Info Since hot deployment is enabled, you can simply add/remove files to deploy/undeploy to/from the server.
Info |
---|
After an adapter is successfully added, it gets added to the list of adapters displayed under Event Processor Configs in the Configure menu of the product's management console. Click Edit to change its configuration and redeploy it. This opens an XML-based editor allowing you to edit the event adapter configurations from the UI. Do your modifications and click Update. You can also delete it, enable/disable statistics or enable/disable tracing on it using the provided options in the UI. |
Info |
---|
If there is any exception occurred continuously when sending mail, check whether |
Configuring input email event adapter message properties
Propert | Description |
---|---|
Email Service Name |
...
For an email to be processed through this event builder, the subject must |
...
be SOAPAction:urn:{Email Service Name} . |
Input Mapping Type |
...
The incoming event type to be mapped. |
...