staf service email send error:38

Help
eko
2013-05-22
2013-06-12
  • eko

    eko - 2013-05-22

    windows environment
    staf version:3.3.0
    email version:3.3.4
    when I  excute the follow command,I get  RC:38
    STAF local EMAIL SEND TO w392988385@126.com message "Test XYZ completed successfully." SUBJECT "Test XYX: Success"

    then I change email version:3.3.7 ,I get another RC:4001

     
  • Sharon Lucas

    Sharon Lucas - 2013-05-22

    Is there anything in the result returned when you get RC 38 submitting the EMAIL SEND request?
    RC 38 indicates a Java error.  Are there any errors in the Email JVM Log?  The Email JVM Log is located by default at:

    C:\STAF\data\STAF\lang\java\jvm\STAFJVM1\JVMLog.1

    Though if you installed STAF to a different location specify that instead of C:\STAF.  And, if you specified the JVMName option when registering the Email service in your STAF.cfg file, specify that instead of STAFJVM1.

    Also, were any errors logged in the Email service log?  You can query the Email service log using the STAF LOG service.  For example:
    STAF local LOG QUERY MACHINE {STAF/Config/MachineNickname} LOGNAME Email

    Is there a reason you're using a very old version of STAF?  STAF V3.3.0 was released 5 years ago.  The current version of STAF is V3.4.13 so I recommend that you upgrade to it and use the latest Email service version (3.3.7).

     
  • eko

    eko - 2013-05-23

    thx  slucas
    the detail information like this:
    STAF local EMAIL SEND TO w392988385@126.com message "Test XYZ completed successfully." SUBJECT "Test XYX: Success"
    Error submitting request, RC: 38
    Additional info


    Internal Java error.

    and the JVMLog.1 :
    java.lang.NullPointerException
    at com.ibm.staf.service.email.EmailService.handleSend(EmailService.java:1114)
    at com.ibm.staf.service.email.EmailService.acceptRequest(EmailService.java:490)
    at com.ibm.staf.service.STAFServiceHelper.callService(STAFServiceHelper.java:349)

    when I used Telnet to Debug Mail Server Problems
    C:\Users\Eko>HELO smtp.revenco.com
    i input HELO smtp.revenco.com  and press enter ,it became C:\Users\Eko>;maybe it didn't connet to  the mailserver the first time ??

     
  • eko

    eko - 2013-05-23

    maybe I know why RC:38,our mailserver needs ssl. is there any free mailserver I can use??
    STAFProc version 3.3.0 initialized
    20130523-10:13:51;14840;00000100;Error in server SSL handshake originating from
    machine 172.20.35.123.  A possible cause is a non-secure tcp interface submitted
    a request to a secure tcp interface which is not supported.  error:1408F10B:SSL
    routines:SSL3_GET_RECORD:wrong version number

     
  • eko

    eko - 2013-05-23

    or how can I send email through a mailserver that with ssl  with staf email service

     
  • Sharon Lucas

    Sharon Lucas - 2013-05-28

    The message logged in the STAFProc output is probably caused when one system running STAF tries to communicate using the STAF tcp interface to another system that only has the STAF ssl interface enabled.  Check your STAF.cfg files on your systems to see which STAF interfaces you have configured.  The default STAF.cfg file provided by STAF 3.3.0 and later (which is when the ssl interface was added) configures a ssl interface first to try to use and then a tcp interface in case using the ssl interface fails (e.g. when trying to communicate via STAF with a system that doesn't have the ssl interface configured in its STAF.cfg file).  You generally want to have the same interface(s) configured (in the same order) in the STAF.cfg file used on all your systems.

    So, this message does not have anything to do with sending email to a mailserver (as that communication is not done via the STAF tcp or ssl interface).  This is an entirely different topic (not related to this error message) that I'll respond to via your other posting in this Help foum titled "staf send emails through SSL emailserver?".

    Yo

     
  • Sharon Lucas

    Sharon Lucas - 2013-05-28

    In looking at the source code for the Email Service V3.3.4 at line 1114 where you're getting a NullPointer Exception which results in RC 38 (Java error), it appears that when reading from the socket used to communicate with the mail server, it is returning null in the reply variable (indicating the end of the stream has been reached) instead of returning data in the reply.

                String level = "";
                Socket socket = null;
                …
                        // Create a socket to communicate with the mail server

                        socket = new Socket(mailServer, fMailport);
                       
                        socket.setSoTimeout(fSocketTimeout);

                        BufferedReader inStream =
                            new BufferedReader(
                                new InputStreamReader(socket.getInputStream()));

                        PrintStream outStream =
                            new PrintStream(socket.getOutputStream());

                        String reply = inStream.readLine();
    1114           level = (reply.startsWith("4") || reply.startsWith("5")) ?
                            "error" : "info";

    I don't know why your mail server is not responding correctly.  This may indicate that your mail server is not supported by the Email service.

    When I tried to telnet to your email server (telnet smtp.revenco.com 25) to see if it failed (which would mean that you will need to investigate why your mail server is unable to send the email), I got the following results:

    C:\>telnet smtp.revenco.com 25

    This opened a new window with response:

    220 KILL Mail Shield Gateway

    I then typed the following and pressed Enter:

    HELO smtp.revenco.com

    It responded fine with:

    250 ksgm.revenco.com

    However, when I then typed the following and pressed Enter:

    MAIL FROM: STAFEmailService@austin.ibm.com

    It responded with the following error:

    501 5.1.7 Bad sender address syntax

    So maybe your email server requires SMTP authentication.  If so, then you should try using the AUTHUSER and AUTHPASSWORD options on your STAF Email SEND request.  These options were added in Email V3.3.5 when support was added for SMTP authentication.  So, if your SMTP server requires authentication, you can specify these options on your Email SEND request.  The STAF Email Service User Guide at http://staf.sourceforge.net/current/email.html#Header_Send contains more information on these options as follows:

    AUTHUSER specifies the user name which will be used to authenticate with the SMTP server via the Auth Login SMTP command. You should only specify this option if your SMTP server requires authentication. If you specify this option when using an SMTP server that does not allow authentication, you will see an error message such as AUTH mechanism LOGIN not available. If you specify the AUTHUSER option, you must also specify the AUTHPASSWORD option. This option will resolve variables.

    AUTHPASSWORD specifies the password which will be used to authenticate with the SMTP server via the Auth Login SMTP command. You should only specify this option if your SMTP server requires authentication. If you specify this option when using an SMTP server that does not allow authentication, you will see an error message such as AUTH mechanism LOGIN not available. If you specify the AUTHPASSWORD option, you must also specify the AUTHUSER option. This option will handle private data. This option will resolve variables.

    For example (substitute your userid and password to authenticate with your SMTP mail server):
    STAF local EMAIL SEND TO w392988385@126.com message "Test XYZ completed successfully." SUBJECT "Test XYX: Success" AUTHUSER yourUserid AUTHPASSWORD !!@yourPassword@!!

    Use the latest Email server (V3.3.7) not V3.3.4 as V3.3.4 does not support the AUTHUSER and AUTHPASSWORD options.

     
  • eko

    eko - 2013-06-10

    I used Email Service (V3.3.7);after I added "interface ssl library STAFTCP option Secure=Yes option Port=465" (port 465 is the mail server required for logging)to the configure file STAF.cfg , I run the staf command like the following format "STAF local EMAIL SEND TO w392988385@126.com message "Test XYZ completed successfully." SUBJECT "Test XYX: Success" AUTHUSER yourUserid AUTHPASSWORD !!@yourPassword@!!"

    I get the following message:
    Error submitting request, RC: 4001
    Additional info


    1 attempt to send the message failed

    I really don't how to do it

     
  • Sharon Lucas

    Sharon Lucas - 2013-06-10

    Don't configure the STAF ssl interface to use port 466 if that's the port that your mail server uses.  Leave the ssl interface configured with the default port used by the STAF ssl interface (6550).   Note that when configuring the Email service in the STAF.cfg file, you can using the MAILSERVER option to specify your mail server through which the email will be sent and the PORT option to specifiy the port through which the mail server will be accessed (e.g. 465).  See section "Installation and Configuration" in the STAF Email Service User's Guide at http://staf.sourceforge.net/current/email.html#Header_Installation for more information on configuring the Email service in tihe STAF.cfg file..

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks