Configure Mail Sessions

You can configure the User Messaging Service to send emails to SSL-configured external mail servers using Oracle SOA Cloud Service with Oracle Service Bus and Oracle B2B.

In this example, we’ll configure to send mails using the yahoo mail server. Before you configure your Oracle SOA Cloud Service instance and User Messaging Service to send mails, make a note of the yahoo mail server SSL settings.

Field Value

Server

smtp.mail.yahoo.com

Port

465 or 587

Requires SSL

Yes

Requires TLS

Yes (if available)

Requires authentication

Yes

Note:

For Oracle SOA Cloud Service instances using IP networks, verify if pinging the smtp mail server is working. For example, ping smtp.office365.com. If the ping does not work, manually add the smtp mail server host name in your DNS entry.

Import a CA-Issued SSL Certificate into the Oracle SOA Cloud Service Instance

The first step is to import the CA-issued SSL certificate into the trust store being used in your server.

Note:

To import a CA-issued SSL certificate to the load balancer, see Import a CA-Issued SSL Certificate to the Load Balancer.

  1. Log in to the Admin server node as an Oracle user.
  2. Execute the following openssl command:
    Email Server Command Used

    Yahoo

    openssl s_client -connect smtp.mail.yahoo.com:465 > yahoocert.pem

    Office 365

    openssl s_client -showcerts -starttls smtp -crlf -connect smtp.office365.com:587

    Microsoft Outlook

    openssl s_client -showcerts -starttls smtp -connect smtp-mail.outlook.com:587 

    Gmail

    openssl s_client -connect smtp.gmail.com:465 > gmail-smtp-cert.pem
  3. Make a copy of yahoocert.pem file. For example, cp yahoocert.pem yahoo.cer.
    1. Run the following command:
      Vi yahoo.cer
      The certificate is displayed.
    2. Keep only the certificate from BEGIN CERTIFICATE entry till END CERTIFICATE entry and remove all the unwanted lines to create the yahoo certificate.

    Note:

    In case of Office 365, two certificates are presented. Run the following command to display the certificates:

     openssl s_client -showcerts -connect smtp.office365.com:587 -starttls smtp  </dev/null

    Save both the certificates as individual .cer files and import them to the keystore.

  4. Add the certificate to the trust store being used in your admin server. By default the trust store used is Demotrust.jks. Use the following command to add the certificate created in the previous step to Demotrust.jks:
     keytool -import -alias smtp.yahoo.com -keystore /u01/app/oracle/middleware/wlserver/server/lib/DemoTrust.jks -file yahoo.cer -storepass DemoTrustKeyStorePassPhrase

    Note:

    For SOA 12.2.1.2 users, the trust store being used may be KSS. In setDomainEnv.sh verify if there is an entry for Demotrust.jks. Else, follow these steps to add the certificate to KSS:

    1. Log in to Oracle Enterprise Manager Fusion Middleware Control Console.

    2. Expand the Weblogic Domain and navigate to Security and then Keystore.

    3. Click the arrow next to system, select trust and then click Manage to manage the certificates in the trust keystore.

    4. Click Import. The Import Certificate dialog is displayed.

    5. In the Certificate Type, select Trusted Certificate, enter a unique alias, paste the certificate string or browse for the certificate file, and click OK.

  5. Restart the Administration Server and Managed Servers from the Oracle SOA Cloud Service Console. See Restart the Administration Server VM and Stop, Start, or Restart Managed Server and Load Balancer VMs.

Configure the Mail Driver for Outgoing Mails

Configure the mail driver for outgoing mails using the User Messaging Service.

  1. In Oracle Enterprise Manager Fusion Middleware Control, navigate to User Messaging Server.
  2. Expand the User Messaging Service node and select usermessagingdriver-email.
    Description of ums_login.png follows
    Description of the illustration ums_login.png
  3. Enter the following details:
    Field Value

    Name

    Email driver name. For example, yahoossl

    Sender address

    EMAIL:YourMail@yahoo.com

    Capability

    Send

    EMAIL Receiving protocol

    IMAP

    Message Retrieval Frequency

    30

    Message Folder

    INBOX

    Outgoing mail Server port

    smtp.mail.yahoo.com

    Outgoing Mail Server port

    465

    Outgoing Mail Server Security

    SSL

    Outgoing Username

    Your email user name which you give for authentication. For Office 365, test the driver settings to verify that your email use rname is a fully qualified name as Office 365 requires the user name in your SMTP configuration to be your full email address including the domain. For example, myuser@mydomain.com.

    Outgoing Password

    Your email password in cleartext password type. Note that Office 365 requires users to change their passwords regularly. The SMTP service may not notify you about expired passwords. Double-check the password provided in the driver configuration.

    Enable SSL

    Select this option

  4. Click Test to test the driver configuration.

    Note:

    If test fails with authentication failure, log into your mail ID and check for a mail from Yahoo or your mail server with a subject similar to “ Sign in attempt prevented”. Perform the steps mentioned in the email to enable less secure sign in.

Update the Workflow Notification Properties

Update the workflow notification properties with details of the external mail server.

  1. Log in to Oracle Enterprise Manager Fusion Middleware Control.
  2. Expand the SOA node and select soa-infra.
  3. Right-click soa-infra, select SOA Administration and then Workflow Properties.
  4. In the Mailer tab, under Notification Service, enter From Address, Actionable Address, and Reply To Address for your outgoing mail address. For example, YourMail@yahoo.com.
    Description of mail_config.png follows
    Description of the illustration mail_config.png
  5. Click Apply.

Verify Mail Configuration Settings

You can test your mail server configuration by sending a test mail.

  1. Log in to Oracle Enterprise Manager Fusion Middleware Control.
  2. Expand the SOA node and select soa-infra.
  3. Right-click soa-infra, select SOA Administration and then Workflow Properties.
  4. Click the arrow next to SOA Infrastructure, select Service Engine and then Human Workflow.
    Description of human_workflow.png follows
    Description of the illustration human_workflow.png
  5. Click the Notification Management tab and click Send Test Notification.
  6. Enter the details of the mail ID to which you want to send the test mail and click Send.
    Description of config_mail.png follows
    Description of the illustration config_mail.png
    A successful mail delivery happens to the intended recipient