Unknown macro: {next_previous_links}
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

Email event receiver is an internal event receiver that comes with WSO2 products by default. You can configure it with  XML, text, and JSON input mapping types.

 

Prerequisites

Follow the steps below to complete the prerequisites before starting the input receiver configurations.

  1. Uncomment the following line in the  <PRODUCT_HOME>/repository/conf/axi2/axis2.xml  file, to enable the mail transport receiver in the Axis2 level:
    <transportReceiver name="mailto" class="org.apache.axis2.transport.mail.MailTransportListener"/>
  2. Remove any rich text formatting from the email body. It must contain only plain text.    

Creating an email event receiver

For instructions on creating an email event receiver, see Configuring Event Receivers.  

Configuring adapter properties

Specify the Adapter Properties , when creating an email event receiver using the management console as shown below.

email input event adapter properties

After entering the above adapter properties, select the  Event Stream  to which you want to map the incoming events, and the  Message Format   which you want to apply on the receiving events . Also, click  Advanced to define custom input mappings based on the  Message Format  you selected. For more information on custom input mapping types, see Input Mapping Types.

You can also define the respective adapter properties of the event receiver based on the transport type within the <from> element of the event receiver configuration in the <PRODUCT_HOME>/repository/deployment/server/eventreceivers/ directory as follows.

<eventReceiver name="EVENT-RECEIVER-NAME" statistics="disable" trace="disable" xmlns="http://wso2.org/carbon/eventreceiver">
<from eventAdapterType="email">
        <property name="transport.PollInterval">10</property>
        <property name="mail.protocol.host">pop.gmail.com</property>
        <property name="email.in.subject">Test Email Input Event Adapter</property>
        <property encrypted="true" name="mail.protocol.password">iLRJ++ICiwFSC+Ji+eOgVEDyBqfAODTQnLzkeVFbeU2cGkokBvHAn/gYyN3A/98GgZvCMaIod+H6A9A+4wzNkrLNbjUc4IL71kYaair1oX2i/QnCxIMcFrzYawj/Jn6z0m9VAsnb6GgIr+mN1CIZaLZPZw0Hjd9whpVwAkNMtrs=        </property>
        <property name="mail.protocol.user">receiver</property>
        <property name="transport.mail.Address">receiver@gmail.com</property>
        <property name="transport.mail.Protocol">pop3</property>
        <property name="mail.protocol.port">995</property>
</from>
.......................
<eventReceiver/>

The above adapter properties are described below.

Adapter property
Description
Configuration file propertyExample

Receiving Mail Address

A valid mail address from which this service should fetch incoming mails.

transport.mail.Address
receiver@gmail.com

User Name

Username of the receiver email account.
mail.protocol.user
test-user

Password

Password of the receiver email account.

mail.protocol.password
test-password
SubjectOnly the mails with this subject mentioned will be processed. (The mail should be in plain text format.)
email.in.subject
Email Input Event Adapter Test
Mail Protocol HostHost address of the mail receiver.
mail.protocol.host
pop.gmail.com/ imap.gmail.com
Mail Protocol PortPort of the mail receiver.
mail.protocol.port
995/993
Mail ProtocolThe mail protocol to be used to receive messages. The default value is imap. For imap, make sure it is enabled in your email account settings.
transport.mail.Protocol
pop3/imap
Poll Interval (in seconds)A positive integer which denotes the time limit, in which the product needs to check for new mails.
transport.PollInterval
10
  • No labels