Petals-BC-Mail 3.1.x

compared with
Key
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (14)

View Page History
h1. Exposing a SMTP transfer as a service. (Provides mode)

PROVIDE SERVICE : Import into the JBI environment an email account as a service, or use a generic SendMail service :

Petals Mail binding component allows JBI consumers to send mails to an email account. A JBI endpoint is registered into the JBI environment, and is linked to an smtp server, with an email address defined. When MailBC receives a message exchange from Petals platform, the content of the message is sent to the defined email address.
*Sending mails{*}{center}

* Step 1 : A JBI Consumer sends a Message Exchange to the Mail Binding Component.
* Step 2 : Mail Binding Component processes the Message Exchange : transforms it into a mail message and retrieve targeted External Provider Service (email address) linked to the endpoint set in the Message Exchange.
* Step 3 : Mail Binding Component sends this new mail to the targeted External Provider Service (Business Service, simple email account...).

h2. Dynamic Exposition
The component can expose directly a generic SendMail service without deploying a service unit.

To allow the component to provide his generic service, the component must have a wsdl with the name : component.wsdl. An example of this file is present in the component.To deactivate the generic service supplies by the component,simply erase the file : component.wsdl.

Parameters (host, port, user, passwordl) have to be defined at component level (cf section *Component Configuration*), otherwise the component can not know the technical information of the smtp server necessary for the generic sendMail service.
\\
This service offer two mode :

* In-Payload mode: The service allows the consumer to send a specific XML message to the component, which defines all the information needed to send an email.

The message send by the consumer has to respect the following definition:
Sample query:
{code:lang=xml}
<ns0:mail xmlns:ns0="http://petals.ow2.org/components/mail/version-3.0">
{code}

* Out-Payload mode : The service allows the consumer to send a JBI message to the component by setting ws-addressing properties in the incoming message exchange which defines all the information needed to send an email.The content of the mail (body) is in the payload of the mesage.

|| Attribute || Description || Default || Required ||
Once a provides node is configured, you can start to send email via the mail binding component. You just have to send message exchange to endpoints activated by service unit deployments (containing jbi.xml with provides node).

The IN message looks like :

{code:lang=xml}
{table-plus}


|| Parameter || Description || Default || Required ||
| scheme | the connection protocol (smtp) | {center}\-{center} | {center}Yes{center} |
{table-plus}


|| Parameter || Description || Default || Required ||
| scheme | the connection protocol (imap or pop3) | {center}\-{center} | {center}Yes{center} |
{table-plus}


|| Parameter || Description || Default || Required ||
| host | Define the smtp server address | {center}\-{center} | {center}Yes{center} |
This specific parameters can be also set through JMX or with Ant task during its installation phase.

Ant task exemple :

{code:lang=xml}