× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.




To recap the problem at hand, we have a customer for whom the JavaMail front-end I wrote as part of one of our applications (the only server-side Java we have anywhere) isn't working. The whole purpose of that JavaMail front-end is to allow the server of our application to programmatically generate email (No, NOT for spamming!) without the need to go through the AS/400's own MTA, or even have it running.

You could do that with JavaMail, or with a simple sockets program. SMTP is a very simple protocol, so writing code that works like QtmmSendMail (but allows you to specify the address of the MTA) would be trivial for someone who is familiar with sockets programming.

and, since I know you've written a 5250 emulator, I assume that you're familiar with sockets.


This client does, however, have AS/400 MTA running on the same box that will be running the application's server, and we already know that QtmmSendMail works fine on that box. So the plan is to ultimately have our email generator use the QtmmSendMail if the MTA is running, or fall back on the Java program (which is rather slow, and probably much slower than QtmmSendMail) if it isn't.

Can't you just have JavaMail connect to 127.0.0.1 if you want to use the local MTA, or a different address if you don't? Why do you need to use QtmmSendMail?

But we've never used the AS/400 MTA. We've never brought SMTP up on any of our AS/400s, and we use an entirely separate box to run our mail server. And without OS/400 SMTP running, we can't test the new QtmmSendMail-based email generator.

Is there anything in particular I need to know, in order to bring up OS/400 SMTP, and have it work, and talk to the outside world, without interfering with our regular mail server?

Our shop was the same way. So I configured the SMTP server on the iSeries (which is the MTA) to simply forward any mail it receives to our main SMTP server. To do that:

 CHGSMTPA MAILROUTER('your.primary.mta') FIREWALL(*YES)

Now, it doesn't really make sense, but for some reason the mail server on the iSeries will, by default, split e-mails up into multiple messages if they too long. And, even more strangely, this setting is changed in the configuration of the POP3 server, even if you're not using POP.

 CHGPOPA MSGSPLIT(*NOMAX)

I also recommend running the next two commands to allow the older e-mail stuff to route e-mail through SMTP as well as the old SNA-based method:

 ADDDIRE USRID(INTERNET GATEWAY)
         USRD('Context switching entry') +
         SYSNAME(INTERNET) +
         TEXT('Sending e-mail to Internet') +
         MSFSRVLVL(*USRIDX) +
         PREFADR(NETUSRID *IBM ATCONTXT)

 CHGDSTA SMTPRTE(INTERNET GATEWAY)

Then you can start the SMTP server:

 STRTCPSVR *SMTP


And by the way, at least as of the last time I checked, even after plugging in the correct DNS addresses, I couldn't even PING to the outside world by URL from the development AS/400 we'd be using for this. When I tried to PING the URL of my own ISP ("www.hb.quik.com"), it sat there for several minutes, using up 90+% CPU, then came back with a message telling me it couldn't find it. Do I need to restart TCP in order for the DNS changes to take effect? Am I missing something else? Is it some sort of firewall problem in our router (it shouldn't be: the same DNS addresses work fine on a WinDoze box on the same LAN).

Hard to say. Look at the settings under CHGTCPDMN. Do they point to the same DNS server that the Windoze box does?

I'm not sure whether you need to restart TCP, since I haven't changed mine in many years. I'm sure that some of the other members of the list (presumably those that configure iSeries systems for a living) would be able to answer that question better than I.

The real question, though, is can you ping the e-mail server that you'd like to forward your mail through? Or, better yet, can you connect to it on port 25?


Oh, and is there an RPG prototype available somewhere for QtmmSendMail? And what do I need to link in, to make it work? (I remember having all kinds of trouble finding that sort of info for the SQL CLI!) I'm just about to check the RPG "Wizard" Redbook.

I have no clue whether that's in the redbook. I have a copy book that I use for QtmmSendMail() in my RPG programs that contains the definitions that I use. Here's that copybook:

      /if defined(SENDMAIL_H)
      /eof
      /endif
      /define SENDMAIL_H

     D QtmmSendMail    PR                  ExtProc('QtmmSendMail')
     D   FileName                   255A   const options(*varsize)
     D   FileNameLen                 10I 0 const
     D   MsgFrom                    256A   const options(*varsize)
     D   MsgFromLen                  10I 0 const
     D   RecipBuf                          likeds(ADDTO0100)
     D                                     dim(32767)
     D                                     options(*varsize)
     D   NumRecips                   10I 0 const
     D   ErrorCode                 8000A   options(*varsize)

     D ADDTO0100       ds                  qualified
     D                                     based(Template)
     D   NextOffset                  10I 0
     D   AddrLen                     10I 0
     D   AddrFormat                   8A
     D   DistType                    10I 0
     D   Reserved                    10I 0
     D   SmtpAddr                   256A

     D ADDR_NORMAL     C                   CONST(0)
     D ADDR_CC         C                   CONST(1)
     D ADDR_BCC        C                   CONST(2)

Good luck.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.