ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Email - SNDDST not working...

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Email - SNDDST not working...

    Hello you all,
    Well I'm trying to write a small CL to inform me via email of some messages that I received on my AS/400.
    I've been browsing IBM site, this site... and other to find how to send email via my AS/400... but it's still not working...
    I'm running V5R3... and my SMTP mail server runs on a Linux machine: ip 122.1.3.100.
    What I'm trying to do is to send an email via the command:
    SNDDST TYPE(*LMSG) TOINTNET(('myemail@mycompany.com')) DSTD('TEST') LONGMSG('TEST EMAIL')

    When I run this command, I received nothing on our SMTP mail server or in my mail but on the AS/400, I have this:CPC9033 Send distribution completed successfully.

    Well, I'm sure this is a config problem but where ??? Could you help me debug what's wrong? Thanks in advance...

    The subsystems are well started:
    QSNADS QSYS SBS 0,0 DEQW
    ATLSUPL QSNADS BCH 0,0 EVTW
    QSYSWRK QSYS SBS 0,0 DEQW
    QMSF QMSF BCH 0,0 DEQW
    QMSF QMSF BCH 0,0 DEQW
    QMSF QMSF BCH 0,0 DEQW
    QTSMTPBRCL QTCP BCH 0,0 DEQW
    QTSMTPBRSR QTCP BCH 0,0 DEQW
    QTSMTPCLTD QTCP BCH 0,0 DEQW
    QTSMTPSRVD QTCP BCH 0,0 SELW

    Here is how I configure my AS/400:
    1 - Specify the SMTP server:
    CHGSMTPA AUTOSTART(*YES) MAILROUTER('122.1.3.100') FIREWALL(*YES) ALWRLY(*BOTH)
    2 - Accept all ip addresses from my network to use this new SMTP server:
    ADDSMTPLE TYPE(*ACCEPT) INTNETADR('122.1.3.0') SUBNETMASK('255.255.255.0')
    3 - Add a gateway to SNADS:
    ADDDIRE USRID(MAIL GATEWAY) USRD('SMTP Mail Gw') PREFADR(NETUSRID *IBM ATCONTXT)
    CHGDSTA SMTPRTE(MAIL GATEWAY)

    After doing those config, I stopped and restarted the SMTP server:
    ENDTCPSVR *SMTP
    STRTCPSVR *SMTP

    Last thing, during all my tests, I was logged under QSECOFR and I had an SMTP e-mail address for the user QSECOFR via PF19 of WRKDIRE
    Display Name for SMTP
    User ID/Address . . . . . : QSECOFR QSECOFR
    SMTP user ID . . . . . : AS400
    SMTP domain . . . . . . : MYCOMPANY.COM
    SMTP route . . . . . . :

    But still no email received...
    How can I debug what's wrong ? Any ideas of the problem ?

    Thanks in advace for your help.

  • #2
    Re: Email - SNDDST not working...

    Most likely to look for:

    1. Is the user enrolled in the system directory? ADDDIRE ....

    2. Is the Linux server allowing email to come from the AS400 (some servers need this configured) ?

    Comment


    • #3
      Re: Email - SNDDST not working...

      When you talked about user... As I'm logged with QSECOFR... do you mean that QSECOFR has to be in the system directory ??? I'm sure QSECOFR is in it...
      Or do you mean that the receiver of the email should be included ?

      Concerning the Linux SMTP server, yes, it is configured to accept emails from the AS/400...

      One thing that I don't really understand... is the AS/400 a SMTP server as well ???

      My AS/400 TCP/IP config is really simple... only IP address and subnet mask configured... nothing else... (No DNS, etc...)

      Any tests that I can do to see what can cause the problem ?

      Thanks for your help.

      Pierre.

      Comment


      • #4
        Re: Email - SNDDST not working...

        There are others here more expert than I am (invitation to correct as needed), but,
        The sender of the message needs a directory entry. Among other things, this provides a "from" email address link to the profile. It appends the user profile, system name and domain name.

        As far as TCP, you want to have the AS400 on the domain. You should also add the AS400 to the "HOSTS" table. At least 2 entries something like
        192.168.1.1 SYSNAME
        192.168.1.1 SYSNAME.MYDOMAIN.COM

        I don't know that its actually needed for email, but I know some things will fail if its not setup. (Time for real experts to jump in here ....)

        Comment


        • #5
          Re: Email - SNDDST not working...

          8 more hours on this f...g problem... and still not working...
          But I'm progressing...
          Well, now I know that the SMTP server on my AS/400 is working properly... I was able to connect to it via TELNET on port 25... and send an email that I well received...
          The email went through my Linux SMTP server... so it looks like the link between SMTP AS/400 and the net is working...

          Now I'm trying to understand how it's working between the command SNDDST and the SMTP server on the AS/400... I know MSF is part of it, as well as SNADS... But I have no knowledge about all those topics...

          The only think that I was able to find is perhaps some issues in the QMSF job log:
          Job 009268/QMSF/QMSF started on 20/12/07 at 14:45:41 in subsystem QSYSWRK
          in QSYS. Job entered system on 20/12/07 at 14:45:41.
          Job 009268/QMSF/QMSF submitted.
          Not authorized to object. Object is &1.
          Not authorized to object. Object is &1.

          Can someone help me understand how it's working, and what do I have to check step by step why I'm not able to send any mail via SNDDST command...
          By the way, I tried also the RPG example from Scott to use Qtmmsendmail... same result...

          Help please....

          Thanks in advance for your time.

          Comment


          • #6
            Re: Email - SNDDST not working...

            >Not authorized to object. Object is &1

            If you do F1 against the message do you get anymore detail?

            When I look at the log for our QMSF job it goes through a number of object changes to objects in /QTCPTMM. I guess if a couple of these are failing it could be why you are having troubles?

            Does your log finish with "Data area QTMMTCP created in library QTEMP" ?

            And another thing? Are you sure you can specify an IP address in CHGSMTPA for the MAILROUTER? We have an entry in the TCP/IP host table (CFGTCP opt 10) and then reference that.

            Internet Host
            Opt Address Name

            99.9.9.99 MAILSERVER

            CHGSMTPA MAILROUTER('MAILSERVER')
            Last edited by Andrew K; December 20, 2007, 10:13 AM. Reason: can't spell

            Comment


            • #7
              Re: Email - SNDDST not working...

              When I look at the log for our QMSF job it goes through a number of object changes to objects in /QTCPTMM. I guess if a couple of these are failing it could be why you are having troubles?
              Agreed - this is one of the first things I would check too...

              The QTCPTMM folder needs Execute authority for the QMSF profile and *all* authorities for the QTCP profile. You can check this easily with OpsNav.

              Terry

              Comment


              • #8
                Re: Email - SNDDST not working...

                Hello and thanks for your support...
                Well... the issue that I have is that the folder /QTCPTMM is not present on my AS/400...
                I'm running V5R3... do I need to install some other lic pgms ???

                It was not included in TCPIP lic pgms ?

                Thanks one more time for your help.

                Regards,

                Comment


                • #9
                  Re: Email - SNDDST not working...

                  Do u have the gateway entries set up in WRKDIRE?

                  i.e. http://search400.techtarget.com/orig...968106,00.html
                  Last edited by kitvb1; December 21, 2007, 10:44 AM. Reason: added i.e.
                  Regards

                  Kit
                  http://www.ecofitonline.com
                  DeskfIT - ChangefIT - XrefIT
                  ___________________________________
                  There are only 3 kinds of people -
                  Those that can count and those that can't.

                  Comment


                  • #10
                    Re: Email - SNDDST not working...

                    > the issue that I have is that the folder /QTCPTMM is not present on my AS/400

                    I have no idea with what this folder gets installed. But there is not much to set up if you want to give it a try (manually). We're on V5R3.

                    There are the following folders under QTCPTMM

                    Code:
                    Opt   Object link            Type 
                          ATTABOX                DIR  
                          DSN                    DIR  
                          ENCODE                 DIR  
                          FTRFILES               DIR  
                          LOCKBOX                DIR  
                          MAIL                   DIR  
                          SMTPBOX                DIR  
                          TMP                    DIR
                    and underneath both LOCKBOX and MAIL there is a sub-folder 'QLOCKBOX'

                    /QTCPTMM/MAIL/qlockbox
                    /QTCPTMM/LOCKBOX/QLOCKBOX

                    All these folders have the following rights

                    Code:
                    *PUBLIC     *NONE        X     X     X     X 
                    QTCP        *RWX         X     X     X     X 
                    QMSF        *RWX
                    Good luck!
                    Last edited by Andrew K; December 24, 2007, 02:13 AM.

                    Comment


                    • #11
                      Re: Email - SNDDST not working...

                      Thanks for the infos...

                      Here is what I get when I dspf the QTCPTMM:

                      Directory: /qtcptmm
                      Position to : Record : 1 of 1
                      New File :
                      2=Edit 4=Delete File 5=Display 6=Path Size 9=Recursive Delete

                      Opt Name Size Owner Changed Used
                      MAIL *DIR QTCP 07/11/06 11:54 24/12/07 09:19


                      I don't have Operator Navigator installed... so I just have to use the TN5250 terminal...

                      Thanks for your help...

                      Comment


                      • #12
                        Re: Email - SNDDST not working...

                        You don't need Ops Nav to move around the IFS: just use the command WRKLNK (and then option 5 to move down each level).

                        CRTDIR will create the directories that you need and then use option 9 to check/amend the authorisation.

                        So you seem to have the root folder OK (QTCPTMM)

                        Create each each sub-folder (see complete list in my message above)

                        CRTDIR('/QTCPTMM/ATTABOX')
                        CRTDIR('/QTCPTMM/DSN')

                        etc

                        These folders must be just used as temporary storage areas, as there are actually no objects inside (only the folder structure I mentioned in my mesage above). And we use SNDDST and it works.

                        Keep on trying!
                        Last edited by Andrew K; December 24, 2007, 03:59 AM.

                        Comment


                        • #13
                          Re: Email - SNDDST not working...

                          Well...
                          First of all... Merry Xmas to everybody...

                          I've added all subfolders in the QTCPTMM and change all authorities... But it still didn't work...
                          Now, the message in the QMSF joblog that I have is as follow:

                          Job . . : QMSF User . . : QMSF Number . . . : 009448

                          Job 009448/QMSF/QMSF started on 28/12/07 at 10:19:34 in subsystem QSYSWRK
                          in QSYS. Job entered system on 28/12/07 at 10:19:34.
                          Job 009448/QMSF/QMSF submitted.
                          Check of QTCPTMM Directory Tree failed on /QTCPTMM/TMP
                          Check of QTCPTMM Directory Tree failed on /QTCPTMM/TMP

                          I double checked /QTCPTMM/TMP authorities, etc... and everything looks good...

                          Any ideas ?

                          Thanks.

                          Comment


                          • #14
                            Re: Email - SNDDST not working...

                            Originally posted by pollos_lg View Post
                            I double checked /QTCPTMM/TMP authorities, etc... and everything looks good...
                            Any ideas ?
                            A quick search on Google ("QTCPTMM" site:ibm.com) gave these PTF's regarding the /QTCPTMM folder:




                            Terry

                            Comment


                            • #15
                              Re: Email - SNDDST not working...

                              I found something that would not like to read...

                              We have Spoolmail installed and they troubleshooted this problem in their online manual.

                              Their solution is to reinstall TCP services: DLTLICPGM and then RSTLICPGM...

                              *yuck*
                              "What must be done, must be well done."
                              My father...

                              Comment

                              Working...
                              X