How to configure Gmail with SOA 11g using Email Activity

This Article will teach you how to configure Email configuration when using Email activity in BPEL flow

Pre-requisite :

1.  you should have SOA server running.

2.  Have gmail account.

3.  download OpenSSL for generating certificate

How to do Email configuration with gmail

1 :  Generate the key store and imap and smtp certificate

1.1 open the cmd and go to OpenSSL installation directory home and then bin. for me this location is C:\OpenSSL-Win32\bin

openssl s_client -connect imap.gmail.com:993 > imap_gmail.cert
– It will generate a file imap_gmail.cert

openssl s_client -connect smtp.gmail.com:465 > smtp_gmail.cert
– It will generate a file smtp_gmail.cert in the same directory

Edit the files and remove everything before or after the following tags(both begin certificate and end certificate should be included)
—-BEGIN CERTIFICATE—–
—–END CERTIFICATE—–

1.2 open $JAVA_HOME/bin and copy the above two files(you can remove later after performing keytool commands) in the directory and issue a command on cmd prompt

keytool -import -alias imap.gmail.com -keystore demogmailcertstore.jks -file imap_gmail.cert

– It will ask for password twice(if you are making .jks for the first time), make sure you remember this password

keytool -import -alias smtp.gmail.com -keystore demogmailcertstore.jks -file smtp_gmail.cert

– It will ask for password, give the same password which you gave earlier

Above command will generate a file in the same directory as demogmailcertstore.jks

1.3 Edit the %WLS_HOME%\uer_projects\domains\<domain_name>\bin\setDomainEnv.cmd (change .sh for linux) to specify the trust key generated in previous step
search for -Djavax.net.ssl.trustStore text in the file and replace with
-Djavax.net.ssl.trustStore=<path>/demogmailcertstore.jks  -Djavax.net.ssl.trustStorePassword=<password you used while making the .jks file>

1.4 Save and close the file

2. Configure usermessagingdriver-email properties

2.1 Open Enterprise manager(EM) and click on usermessagingdriver-email to load properties

 

2.2 open Email driver properties

opendriverProperties

 

2.3 Modify the properties as :

 MailAccessProtocol                           IMAP

ReceiveFolder                                      INBOX

OutgoinMailServer                             smtp.gmail.com

OutgoinMailServerPort                    465

OutgoingMailServerSecurity          SSL

OutgoingUsername                             Any gmail id ex : xxxxx.yyyyyy@gmail.com
(if there are multiple user then use comma seperated values)

OutgoingPassword                             Password for Outgoing Username
(if there are multiple user then use comma seperated values)

IncomingMailServer                         imap.gmail.com

IncomingMailServerPort               993

IncomingMailServerSSL                 select checkbox

IncomningMailIds                             use any valid id (ex xxxxx.yyyyyyy@gmail.com)

IncomningUserIds                            use any valid id (ex xxxxx.yyyyyyy@gmail.com)
IncomingUserPasswords                Password for incomingUserId

2.4 Apply the changes.

 

3. Modify the Worklist Notification

 

 

3.1 open worklist notification properties as given below

4 Open Admin Console and modify the keystore for SOA server

consoleSoaServersetting

 

5. Restart SOA server and test mail functionality using Email activity

UseEmail

Featured Course : Oracle SOA

Improve your career by learning oracle soa and improving your skillset.

Learn More.