Configuring Office365 cloud server for Notification Mailer Inbound and Outbound


The Office365 cloud server SMTP and IMAP services can be used for Workflow Notification Mailer Outbound and Inbound configuration. This blog explains the SMTP/IMAP server configuration, SSL certificate installation in Concurrent
Tier and configuring Office365 IMAP and SMTP servers for Workflow
Notification Mailer Inbound and Outbound.

1. Configure Mailer Outbound/Inbound with Office365 servers

Mailer Outbound and Inbound can be configured with Office365 SMTP and IMAP servers using below configuration details.
SMTP server 

Server smtp.office365.com
Port 587
Protocol TLS(startTLS)
User Name User name on Office365 server along  with email address
Password Password for the account used above

IMAP server 

Server outlook.office365.com
Port 993
Protocol SSL
User Name User name on Office365 server along with email address
Password Password for the account used above

2. Apply the Workflow 1OFF patches 

Apply the below workflow 1OFF patches for the respective code line.

21044145:R12.OWF.C: Office365 cloud server support for Mailer Outbound and Inbound for R12.2.4 code line

21040057:R12.OWF.B:  Office365 cloud server support for Mailer Outbound and Inbound for R12.1.3 code line

Note: The above patches will be applicable for any SMTP/IMAP server that supports SSL/TLS protocols 

3. Install Office365 server certificates

    Install the SMTP server SSL certificate into the default JRE location or any other custom location using below command

        
a)Installing into a default JRE location in EBS instance

# keytool -import -trustcacerts -keystore $AF_JRE_TOP/lib/security/cacerts  -storepass changeit -alias office_smtp-lnx_chainnedcert  -file office365_smtp.cer 

        b)Install into a custom location

# keytool -import -trustcacerts -keystore <customLocation> -storepass changeit  -alias office_smtp-lnx_chainnedcert -file office365_smtp.cer

                       <customLocation> -- directory in the instance where the certificate needs to be installed

    Install the IMAP server SSL certificate into the default JRE location or any other location using the below command

       
    After installing the certificates using the above commands you can see the following response, type 'yes' to complete.
     Trust this certificate? [no]:  yes
     Certificate was added to keystore

4. Mailer Command-line diagnostics

The Mailer connectivity with Office365 SMTP and IMAP servers can be verified by running the Mailer command line diagnostics as below. We can also verify the Mailer logs by reviewing the generated log file.

Outbound:


$AFJVAPRG -classpath $AF_CLASSPATH -Dprotocol=smtp -Ddbcfile=$FND_SECURE/$TWO_TASK.dbc -Dserver=smtp.office365.com -Dport=587 -Dsecurity=TLS -Dtruststore=$AF_JRE_TOP/lib/security/cacerts -Daccount=<username> -Dpassword=<password> -Dconnect_timeout=120 -Ddebug=Y -Dlogfile=SMTPTLSTest.log oracle.apps.fnd.wf.mailer.Mailer

Inbound:


$AFJVAPRG -classpath $AF_CLASSPATH -Dprotocol=imap -Ddbcfile=$FND_SECURE/$TWO_TASK.dbc -Dserver=outlook.office365.com -Dport=993 -Dsecurity=SSL -Dtruststore=$AF_JRE_TOP/lib/security/cacerts -Daccount=<username> -Dpassword=<password> -Dfolder=Inbox -Dconnect_timeout=120 -Ddebug=Y -Dlogfile=IMAPSSLTest.log oracle.apps.fnd.wf.mailer.Mailer 


+++
OUTBOUND_SECURE_PROTOCOL NONE
OUTBOUND_SERVER smtp.office365.com

INBOUND_SECURE_PROTOCOL TLS
INBOUND_SERVER outlook.office365.com
+++

Below are the correct connection protocols.
Go to the workflow configuration page and provide the below connection protocols and validate.

SMTP on Office365 --> StartTLS
IMAP on Office365 --> SSL


Debug Steps.



SMTP Test


$AFJVAPRG -classpath $AF_CLASSPATH -Dprotocol=smtp \
-Ddbcfile=<complete DBC file path> \
-Dport=587 \
-Dsecurity=STARTTLS \
-Dtruststore=$OA_JRE_TOP/lib/security/cacerts \
-Dserver=smtp.office365.com \
-Daccount=<SMTP Username> -Dpassword=<SMTP Password> \
-Dconnect_timeout=120 -Ddebug=Y \
-Dlogfile=/tmp/smtp1.log \
-DdebugMailSession=Y oracle.apps.fnd.wf.mailer.Mailer > /tmp/smtp2.log




IMAP Test


$AFJVAPRG -classpath $AF_CLASSPATH -Dprotocol=imap \
-Ddbcfile=<complete DBC file path> \
-Dport=993 \
-Dsecurity=SSL \
-Dtruststore=$OA_JRE_TOP/lib/security/cacerts \
-Dserver=outlook.office365.com \
-Daccount=<IMAP Username> -Dpassword=<IMAP Password> \
-Dconnect_timeout=120 -Ddebug=Y \
-Dlogfile=/tmp/imap1.log \
-DdebugMailSession=Y oracle.apps.fnd.wf.mailer.Mailer > /tmp/imap2.log



Refer Doc: 
Doc ID 2051685.1
R12 E-Business Suite Configuring Workflow Mailer with TLS for Microsoft Office365, Gmail, or Cloud Based Email Services for 12.1.3 and 12.2 (Doc ID 2051827.1)





If you like please follow and comment