There are already several blogs on how to receive and send email using the UMS email adapter.
A few good starting points that use GMail as a provider are the ones written by our respected con-colleagues of Amis:
So I won't bother to do a how-to on that on my account. Although I manged to get that working with a local Exchange setup.
What I managed to do is to read e-mail and then process it to upload the attachments and body using BPEL and java in a Spring-Context to Adaptive Case Management. If you want to do something similar make sure you install the
patch 18511990 for fetching the attachment-properties and -content, since without the patch the properties for inline attachements are not written properly to the soa-infra database. See my earlier blog-posts
here and
here.
Having it all setup and playing around with it, you might end up in the situation that the service won't listen to the actual email-address you reserved for it, as I did. This might be the case when you change the email address in your receiving adapter component in the composite. Or after deploying several versions of the composite, especially with different addresses.
It turns out that there is a panel to deregister Messaging Client Applications to cleanup the mess.
First go to the Enterprise Manager and under the Weblogic Domain navigate to the 'usermessagingserver' (there are also entries for the different usermessagingdriver's, but in this case you need the server itself):
Right click on it and in the pop-up choose 'Messaging Client Applications':
Here the registered Messaging Client Applications are registered with the particular endpoints.
In our case all the activation agents of the polling inbound email adapters are registered here and it the situation might occur that the composites are listening to wrong addresses. So select those you don't want anymore, and click on the De-register button.
You might need to re-deploy your composite and edit the component for the inbound email to have it listening to the proper address set-up for the particular environment (development, test, accepetance, production). And then it shoud work. Maybe a server restart is necessary to have the proper activation agent(s) started (and the unwanted shutdown).