Wednesday, March 13, 2013

Using Gmail as SMTP server for PeopleSoft

A lot of us developers use local PeopleSoft sandboxes for (self)training and R&D. One of the biggest issues we usually encounter on local sandboxes is the lack of a SMTP server for testing workflow mail. Until today I used PostcastServer as SMTP server, but this did not actually send the mail to the mail address, but catches the mail generated from PeopleSoft locally.

Today I got triggered by a question on OTN Forum on which setting you need to set to use Gmail as SMTP server. Surprisingly there was a document on My Oracle Support that explained just that E-WF: JavaMail Exception: javax.mail.AuthenticationFailedException, Error Using Gmail SMTP Server [ID 1436910.1]

Although the document on My Oracle Support is a very highly detailed document, it missed a few key pointers and I think this information is something the community will be very grateful for.



The procedure to set Gmail as an SMTP server is divided in two steps:
  • Import Gmail SSL certificate in PeopleSoft
  • Configure application server and process scheduler
For this post I will be using PeopleSoft on Virtualbox based on the OVM templates.

First I created a new Gmail account ovm.peoplesoft@gmail.com with password ovmwelc0me (password changed after writing this post). Once the gmail account is created, sign in.


Click on the lock, go to tab Connection and click on link Certificate information.


On the certificate window select the root certificate and click on View Certificate.


Go to tab Details and click on Copy to File.

The Certificate export wizard will be launched.


Click on next.



Choose Base-64 encoded X.509 (.CER) option and click Next.



Save the certificate to for example c:tempgoeroot.cer and click on Next.



Click on Finish and the root certificate is save locally. Back on the Certificate screen select Google Internet Authority and click on View Certificate.


Walk through the same steps as the root certificate and save the certificate with a different name.



Now log on to PeopleSoft and navigate to PeopleTools > Security > Security Objects > Digital Certificates and add a new row with Type Root CA, Alias Equifax Secure CA and Issuer Alias Equifax Secure CA.



Click on Add Root.

Now open georoot.cer in notepad and copy the entire content.



Click on OK and back on the Digital Certificates page add another row with Type Remote, Alias GoogleInternetAuthority, Issuer Alias Equifax Secure CA.



Click on import.

Now open GoogleInternetAuthority.cer in notepad and copy the entire content.



Click on Ok to save the certificate.

Now we are ready importing the certificates in PeopleSoft and can start configuring the application server and process scheduler.

What the MOS document does not say, but is stated in PeopleBooks, is that the SMTP server configuration for the user password in the psappsrv.cfg needs to be encrypted with PSCipher. So before changing the configuration, we first need to encrypt the Gmail password. Log on the PIA-Batch vm with root and issue the following commands:

[root@hcmpt91 ~]# su -l psadm2
[psadm2@hcmpt91 ~]$ cd $PS_CFG_HOME
[psadm2@hcmpt91 HCM]$ cd webserv
[psadm2@hcmpt91 webserv]$ cd peoplesoft
[psadm2@hcmpt91 peoplesoft]$ cd piabin
[psadm2@hcmpt91 piabin]$ ./PSCipher.sh ovmwelc0me

********************WARNING******************************************************

Hard limit value of the file descriptors on this system is set to 1024
In order to run the server process with 4096 file descriptors,
increase the hard limit on the system equal or higher than the number
MAX_FILE_DESCRIPTORS in setenv.sh

*********************************************************************************

Encrypted text: {V1.1}g3sOb5a44/RluB4AZlXHVw==

Copy the encrypted password and open psappsrv.cfg by issuing the following commands.

[psadm2@hcmpt91 ~]$ cd $PS_CFG_HOME
[psadm2@hcmpt91 HCM]$ cd appserv
[psadm2@hcmpt91 appserv]$ cd APPDOM
[psadm2@hcmpt91 APPDOM]$ vi psappsrv.cfg

Change the following settings:

SMTPServer=smtp.gmail.com
SMTPUserName=ovm.peoplesoft@gmail.com
SMTPUserPassword={V1.1}g3sOb5a44/RluB4AZlXHVw==
SMTPUseSSL=Y
SMTPSSLPort=465

No need to bounce the application server after this, since these settings are dynamically set. Change the same settings for the process scheduler configuration file.

Now let's test if it works.

An easy way to test mail from PeopleSoft is to use the Component Notify button, which for example can be found on the Web Profile page.


Click on the Notify button and on the next page, let's try to send a mail to our own Gmail account.


Hit Ok and check your Gmail.



By the way, if you want to use PeopleSoft workflow with the OVM templates, do not forget to check the following check boxes, which are not enabled by default.



All credits to Oracle and MOS for describing this. This will be a great add-on to complete the OVM templates to a full demo environment.

I think it goes without saying that you should only use this for your local sandboxes and not for Production systems.

4 comments:

  1. Nab Darwish10:56 PM

    The document is very helpful and well documented, however the import function of the GoodleInternetAuthority file errored when pasting the suggested file in PS version 8.9. Could the version be the problem?

    ReplyDelete
  2. Hello Hakan,

    First of All Thanks for Sharing.

    I have successfully configured on 9.1 HRMS and its works like charm.

    But when in 9.2 as well Lower like 8.8 HRMS Version not working.

    Can you Please help. Thanks.

    ReplyDelete
  3. Ernst7:38 PM

    Hi Hakan,

    Your blog just made my evening :-). Works fabulous on CS 9.0.

    Ernst

    ReplyDelete
  4. Helena7:32 AM

    Thank you! Works like a charm.

    ReplyDelete