DEV Community

Kumaran Murugan
Kumaran Murugan

Posted on

Setting Up the Workflow Notification Mailer on an EBS 12.2 Test Instance for Safe Email Testing

This post shows how I configured the Workflow Notification Mailer on an Oracle E-Business Suite 12.2 test instance purely for testing. All mail is redirected to one test mailbox, old pending notifications are cleared, and the outbound server points at a local relay. These settings are meant for a test environment, not for production or for a system where real users should receive notifications. The values in the examples, such as addresses and counts, are made up.

Why a test instance needs this

  • A cloned database carries over rows in WF_NOTIFICATIONS, including notifications that were still waiting to be emailed.
  • If the mailer starts with source-system settings, it can email real users from a test system.
  • Links inside notification emails use the web agent setting, which can still point at the source system after a clone.

These settings are for testing only

Everything below is set up so that test mail can't reach real people. If the instance later needs to send notifications to real recipients, for example for user acceptance testing, undo the test settings:

  • Remove the TEST_ADDRESS value, so notifications go to the real recipients again.
  • Replace the local relay with the real outbound mail server, using the security setting your mail team requires.
  • Check that WF_MAIL_WEB_AGENT holds the URL users should actually see.

Check Oracle's documentation for the full list for your release.

Before you start

  • Do this on a test instance only. Don't run any of it on production.
  • You need a mail relay the application tier can reach. I used a local Postfix relay.
  • Have a test mailbox ready to receive the notifications, for example wf-test@example.com.

Step 1: Back up WF_NOTIFICATIONS and review its statuses

CREATE TABLE applsys.wf_notifications_bkp AS
  SELECT * FROM applsys.wf_notifications;

SELECT mail_status, COUNT(*)
FROM applsys.wf_notifications
GROUP BY mail_status;
Enter fullscreen mode Exit fullscreen mode

The second query shows how many notifications are waiting in each status. Example output (your values and counts will differ):

MAIL_STATUS   COUNT(*)
-----------   --------
SENT             48210
MAIL               312
ERROR               14
Enter fullscreen mode Exit fullscreen mode

In this example, 312 notifications are still waiting to be emailed and 14 are in error. Those are the ones that could reach real users after a clone.

Step 2: Mark the old pending and errored notifications as sent

UPDATE applsys.wf_notifications
SET mail_status = 'SENT'
WHERE mail_status IN ('MAIL', 'ERROR');

COMMIT;
Enter fullscreen mode Exit fullscreen mode

Use the status values from your own query in the IN list. This stops the mailer from trying to send mail that was queued before the clone. It is a direct table update, so keep it to test instances, take the backup first, and check Oracle Support for current guidance. Never do it on production.

Step 3: Set the test address and the reply-to address

In the Notification Mailer's configuration in Workflow Manager, set these parameters:

Parameter Example value Purpose
TEST_ADDRESS wf-test@example.com All notifications go here instead of to the real recipients
REPLYTO wf-noreply@example.com Address that replies are directed to

With the test address set, an approval notification meant for a real approver arrives in the test mailbox instead.

Step 4: Set the web agent profile option

Set the WF_MAIL_WEB_AGENT profile option to the base URL of the test instance:

http://<test-host>:<port>
Enter fullscreen mode Exit fullscreen mode

This is the address used for the links inside notification emails. If it still points at the source system, a person clicking a link in a test email lands on the wrong environment.

Step 5: Point the outbound server at a local test relay

Setting Example value
Outbound server localhost
Port 25
Security None

This points the mailer at a local Postfix relay. Security None is acceptable here only because it is a test setup with a relay on the same host. For a real mail server, use the security your mail team requires.

Step 6: Start the mailer and verify

Confirm the Workflow Notification Mailer service component shows Running in Workflow Manager. Then trigger any workflow that sends a notification, for example an approval request routed to a test user, and check two things:

  • It arrives at wf-test@example.com, not at the real recipient.
  • The link inside it opens the test instance.

If mail doesn't arrive

  • Check the mailer's log in Workflow Manager for errors.
  • Check the relay's mail log, for example /var/log/maillog for Postfix on many Linux systems.
  • Confirm the outbound server name and port match the relay.

Test-setup checklist

  • Back up WF_NOTIFICATIONS.
  • Clear old pending and errored notifications, on test only.
  • Set TEST_ADDRESS and REPLYTO.
  • Set WF_MAIL_WEB_AGENT to the test URL.
  • Point the outbound server at the relay.
  • Start the mailer and send one test notification.
  • Undo the test settings before the instance sends mail to real users.

What I learned

  • Set the test address before the mailer starts. It is the safety net on a test system.
  • Deal with old pending notifications first. Otherwise the mailer works through the old queue.
  • Check where the links point. The web agent setting decides which system a recipient lands on.
  • Keep test settings and real settings separate. Know what to undo when the instance goes back to normal use.

References

  • Oracle Workflow Administrator's Guide, Release 12.2

Kumaran Murugan is an Oracle Apps DBA and OCI Cloud Administrator with 5+ years of experience in Oracle E-Business Suite, database migrations, and OCI infrastructure. Connect on LinkedIn.

Top comments (0)