Site Network: Home | About

SMTP Test Using Telnet

In the recent past I have been noticing an SMTP ORA- error while a stored procedure tries to send out an email. Error is below.

PRE-SESS> TM_6159 Error executing stored procedure...
TM_6159 [4294965496] [
ORA-29278: SMTP transient error: 421 Service not available
ORA-06512: at "SYS.UTL_SMTP", line 20
ORA-06512: at "SYS.UTL_SMTP", line 96
ORA-06512: at "SYS.UTL_SMTP", line 272
ORA-06512: at "SYS.UTL_SMTP", line 248
ORA-06512: at "SYS.UTL_SMTP", line 259
ORA-06512: at "YK.EMAIL_TEST", line 39

I have ignored this error 3 to 4 times as this error was not so frequent, and neither job was so critical. We were hit with error again yesterday, and thought I should give some attention to it. Error says that "SMTP Service no available". It obviously means either SMTP service is not running, or service is unreachable. Point to note is that the failing stored procedure is not using the SMTP service of the host where its database itself residing on - SMTP server is available on a remote machine.

I could sense that SMTP service availability is not the reason for this problem (because other procedures on other databases from different hosts have never faced this error). So, my next suspect is network availability between the database hosting machine (where stored procedure runs) and the SMTP host machine. I had a request to DB team and SYS team to checkthe n/w issues between the two. Let me see how it turns out eventually.

While I was trying to collect some related information on this issue, I could able to find a metalink doc (604763.1) - though it is not addressing my actual problem, but it explained how one can check SMTP service from command line. This is a good learn for me today. A sample mail test from my machine (hydaap01) with SMTP server  (hydaap02)

$ telnet hydapp01 25
Trying 124.2.78.2...
Connected to hydapp01 (124.2.78.2).
Escape character is '^]'.
220 hydapp01 ESMTP Sendmail 8.13.7+Sun/8.13.7; Thu, 17 Sep 2009 06:48:13 -0400 (EDT)
helo domain
250 hydapp01 Hello hydapp02 [124.2.78.3], pleased to meet you
mail from:yk@hyd.com
250 2.1.0 yk@hyd.com... Sender ok
rcpt to:karteek.yelampally1@hyd.com
250 2.1.5 karteek.yelampally1@hyd.com... Recipient ok
data
354 Enter mail, end with "." on a line by itself
Subject: This is SMPT test using telnet
This should be rock successful.
.
250 2.0.0 n8HAmDQu006085 Message accepted for delivery
quit
221 2.0.0 hydapp01 closing connection
Connection closed by foreign host.
$

And so I have email in  my mail box.

- Karteek

0 Comments:

Post a Comment