Thursday 14 June 2012

How to Perform a Meaningful SMTP Telnet Test to Troubleshoot Java Mailer For Sending Email Notifications [ID 753845.1]

This document details the steps to perform a meaningful telnet test to investigate java mailer issues related to sending workflow email notifications to the SMTP server.

As it is explained in the Oracle Workflow Administrator’s Guide, it is mandatory to have an SMTP server set up in order to send the workflow notification e-mail messages. This means that the notification mailer does not send the notification e-mails itself but completely relies on the SMTP server to achieve this task.

For this reason, it is important to be able to send an email using telnet on the SMTP server in the conditions that are used by the mailer.

Note: this test is useful in the following situations (the below list is not exhaustive):
- You are setting the workflow notification mailer up and you want to validate the outbound processing parameters.
- You suspect a connectivity issue between the java mailer node and the SMTP server node.
- You suspect that SMTP server does not process emails.
- You notice that given notifications in WF_NOTIFICATIONS have MAIL_STATUS = FAILED, and that the notification preference of the notification recipient has been switched to DISABLED (this can be seen in $FND_TOP/sql/wfmlrdbg.sql output againt the given notification id).
- You want to validate a given email address.
...
More particularly this test will provide relevant output when the following strings are seen in mailer log:
- javax.mail.SendFailedException: 550 5.7.1 Unable to relay
- javax.mail.MessagingException
- Invalid Address
- Relay access denied
- Unable to relay
- Relaying denied
- Client does not have permission to submit mail to this server
- Validation failed for the following parameters -> {OUTBOUND_SERVER=Unable to make a network connection.}
- EXCEPTION:[SVC-GSM-WFMLRSVC-12848-10006 : oracle.apps.fnd.wf.mailer.SMTPOutboundProcessor.read]:Not sending notification {3939936}because the notification mail status is null OR not 'MAIL'
- Updating notification {3939936} status {FAILED} {WFMLRSND_FAILED_UNDELIVERABLE} {{SYSADMIN}}
etc...

Solution

It is very important to perform all the steps mentioned below; they will allow to perform the telnet SMTP test from the right node and to pass the correct values during the test.

1) Identify the concurrent tiers node where mailer runs
by running script below:
select target_node 
from fnd_concurrent_queues where concurrent_queue_name like 'WFMLRSVC%'; 
It will return for example:
TARGET_NODE                    
------------------------------ 
ebiz1                     

In this example ebiz1 is the node where java mailer runs.

2) Gather other parameters values necessary for the SMTP telnet test:
To perform the SMTP telnet test, in addition to mailer node, you will also need to know on which node is the SMTP server (this is mailer "outbound server" parameter), and what is the reply to address that is set up for the java mailer (this is mailer "reply to" parameter).

To get these values run the following:
SELECT b.component_name, 
       c.parameter_name, 
       a.parameter_value 
FROM fnd_svc_comp_param_vals a, 
     fnd_svc_components b, 
     fnd_svc_comp_params_b c 
WHERE b.component_id = a.component_id 
     AND b.component_type = c.component_type 
     AND c.parameter_id = a.parameter_id 
     AND c.encrypted_flag = 'N' 
     AND b.component_name like '%Mailer%' 
     AND c.parameter_name in ('OUTBOUND_SERVER', 'REPLYTO') 
ORDER BY c.parameter_name; 

It will return for example:
COMPONENT_NAME                  PARAMETER_NAME                 PARAMETER_VALUE        
------------------------------- ------------------------------ -----------------------
Workflow Notification Mailer    OUTBOUND_SERVER                mitini1                          
Workflow Notification Mailer    REPLYTO                        jmailer1@dummy_domain.com  

In this example the outbound server is on mitini1 node and the reply to address is set to jmailer1@dummy_domain.com.


3) Perform the SMTP telnet test as follows:
3.1) Log on to the node where mailer runs (to identify it, please refer to step 1)
This is mandatory. SMTP telnet test is only meaningful when it is performed from the concurrent tier where mailer runs.
In our example you should log to ebiz1 node.

3.2) From mailer node, issue the following commands one by one:
telnet [outbound server] 25 
EHLO [mailer node] 
MAIL FROM: [reply_to address] 
RCPT TO: [my_test_email_address]
DATA 
Subject: Test message 

Test message body 

quit 

Notes:

a) Very important, the commands needs to be entered one by one
b) Replace [outbound server] by the value retrieved for OUTBOUND_SERVER in step 2.
c) Replace [mailer node] by the value retrieved in step 1.
d) Replace [reply_to address] by the value retrieved for REPLYTO in step 2.
e) Replace [my_test_email_address] by the email address that you need to test.
f) By default SMTP server runs on port 25. If another port is used you'll have to modify the port accordingly in the syntax below.
g) Enter a blank line after the email subject and after the text 'Test message body'.
h) The end of the message is signaled by a "." on a line by itself.
i) To exit the telnet session, type 'quit' and then hit 'enter'.


So the commands to enter in the context of our example are:
telnet mitini1 25  
EHLO ebiz1  
MAIL FROM: jmailer1@dummy_domain.com  
RCPT TO: robert.king@dummy_domain.com
DATA  
Subject: Test message  

Test message body  
.  
quit 
(let's assume robert.king@dummy_domain.com is the given address you want to test)

3.3) Then verify the following:

a) Has an error message been thrown during the test?
To compare the output you get with the normal output received during telnet SMTP test, please refer to section 8a (Verify SMTP Server ) in note 242941.1 How To Troubleshoot Java-based Workflow Notification Mailer In 11.5.9 and OWF.G.

b) Check the INBOX of the email address used for the test (my_test_email_address)
Is there an email here with Subject: Test message and with sender corresponding to reply_to_address email address?
In our example, you should check robert.king@dummy_domain.com  INBOX and research a message with subject "Test message" and that is from sender jmailer1@dummy_domain.com.
4) Test interpretation

If an error message has been thrown during the test, or if the test email has not been received, this means the SMTP telnet test is not successful. Because the java mailer uses the SMTP server to send notification emails, it is a prerequisite for a correct behavior of the java mailer that this test is successful.
If the test is not successful, depending on the message received, the problem has to be addressed by the SMTP Server administrator or the Network administrator.  Commonly, relaying needs to be enabled.
5) Finishing tasks
a) Confirm that the SMTP server defined within the Workflow Notification mailer setup reflects the correct address.
b) Once the mail server tests are complete and successful, to re-send any failed notifications, please run the Resend Failed Notifications concurrent request.

Workflow Information Center, Diagnostics, & Community

  • Please reference the Workflow Product Information Center Document for Top Workflow Resources: Document 1320509.1
  • For additional help, please refer to one of the following documents on diagnostics to address current needs. Providing diagnostic output on an issue for support when logging a service request is very helpful.

    Document 179661.1 for 11i or Document 421245.1 for Rel 12.x




1 comment:

  1. Mail servers should really revolutionize their ways to cater to their clients best.

    ReplyDelete

Number of Visitors