+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 16

Thread: Where does incoming email go in AS/400 and how it is handled?

  1. #1
    Guest.Visitor Guest

    Default Where does incoming email go in AS/400 and how it is handled?

    I try to create a system for our own use where I can handle incoming email in AS/400. Example: We have a customer who sends orders by email (order data will be in attachment files). I want to receive these in AS/400 and programmatically handle them in AS/400 (with CL and RPG programs). Questions about checking incoming mail in AS/400: A) Is this possible with QRYDST and RCVDST commands? B) If A) is not possible then how it should be done? (an example please) C) What are these exit points and exit point programs for mail? So far I'm able to SEND email from AS/400 with attachments by SNDDST command. I just found out that incoming email messages are in IFS folder and attachments are converted as part of the message. I've also searched this forum and read a lot of threads, but I haven't found an answer. Our AS/400 is in V4R4. AS/400 is not our email server. As a mail server we have a Linux box. That box redirects incoming mail to our AS/400 for the particular user that I'm using for this purpose only. TIA, Hannu

  2. #2
    Guest.Visitor Guest

    Default Where does incoming email go in AS/400 and how it is handled?

    This should be possible with QRYDST and RCVDST. I have programs on our AS400 (v4.3) that both send & receive mail however our AS400 is our mail server. This is how I did it: Create a directory entry for the mail account. Do this via WRKDIRE and use option 1 for add. 'User profile' must match a valid profile on your system. Enter the name of your AS400 in 'System name'. Leave 'System Group' blank. Mail service level = 1. Preferred address = 1. Press F19, 'SMTP user ID' = fred, 'SMTP domain' = acme.com where the acount's address is fred@acme.com. SMTP domain may need to be network name of your AS400. The mail account is then ready to receive mail. Check for mail with QRYDST. Receive mail with RCVDST. Granting yourself the authority to receive mail via the new account is hairy stuff and a topic in itself.

  3. #3
    Guest.Visitor Guest

    Default Where does incoming email go in AS/400 and how it is handled?

    Thank you! QRYDST and RCVDST work now, but... more questions. When I run RCVDST to an outfile there is a 500 characters long field called RCVDTA in that file. The message data including attachment file data is in this field. If I have a large message or attachment file they split to several records in this file. It seems that ASCII CRs and LFs are included in this data. Question: How do you produce the original message as seen on the PC mail program screen before you sent it? Do you have somewhat complicated program to concatenate the data from different records? Other problem I found was the conversion of our special characters, but if you don't have those, so forget that. Regards, Hannu

  4. #4
    Guest.Visitor Guest

    Default Where does incoming email go in AS/400 and how it is handled?

    I've asked this also from IBM and... They said that according our support agreement they can answer that I should use some HFS APIs (like QHFCPYSF, QHFOPNSF and QHFRDSF) and read some manuals. Also there are many other ways to solve my problem, but they didn't tell me what they were. They have also build some solutions to other customers (I think), but they are too expensive in this case they told me. Anyway, I may sound bitter, but this seems to me like building a house and somebody advices me to cut some trees for it or I can use also other materials. AS/400 may be a good computer for some purposes, but I think in some cases it lacks features it should've had for years.

  5. #5
    Guest.Visitor Guest

    Default Where does incoming email go in AS/400 and how it is handled?

    To understand where mail goes and what you can do with it, review the AnyMail/400 Mail Server Framework Support manual in the online library. You will also want to review the AnyMail/400 Mail Server Framework APIs that are documented in the System API Reference. Please note that the above may very well provide more information than you ever really wanted to know on how mail moves through the iSeries 400.

  6. #6
    Guest.Visitor Guest

    Default Where does incoming email go in AS/400 and how it is handled?

    Vincent, to assign permission to receive mail for the user, couldn't you just use the GRTUSRPMN command? Works for me. Let me know.

  7. #7
    Guest.Visitor Guest

    Default Where does incoming email go in AS/400 and how it is handled?

    Glad to see I'm not the only one willing to torture myself with this stuff. Receive the thing into a document rather than into a file. This seems to take care of ASCII-AS400talk conversion. Then copy the doc into a file. The command to receive the mail into a doc may look something like: RCVDST DSTID('My distributionID') USRID(USERID ADDR) DOC(MYDOC) FLR(MYFOLDER) OUTDTATYP(*DOC) DSTIDEXN(1) The command to copy the doc into a file: CPYFRMPCD FROMFLR(MYFOLDER) TOFILE(*LIBL/MYFILE) FROMDOC(MYDOC)

  8. #8
    Guest.Visitor Guest

    Default Where does incoming email go in AS/400 and how it is handled?

    Yes GRTUSRPMN will assign permission to receive mail. However if you receive the mail into a QDLS document (see my response to Hannu) then you will also need authority to the folder that the doc lives in. Here's how I achieved it: WRKFLR Type option 14=Authority next to your folder. Public authority ought to be *EXCLUDE for my way of thinking. Press F6=Add new users and give the user *ALL authority. I guess this isn't such a hairy topic but I ran out of time to explain it before.

  9. #9
    Guest.Visitor Guest

    Default Where does incoming email go in AS/400 and how it is handled?

    Yes, I've read those manuals. I'm just a simple RPG programmer and these APIs etc. seem to me that if I'd like to create some sort of more complicated mail server application then I'd use these. So far: I've found out that messages go to IFS directory called '/QTCPTMM/MAIL/' and in there to subdirectories per mail user. This is the case when I've configured the value of 'Mail service level' = 2 (System message store) and 'Preferred address' = 3 (SMTP name) for the user in system directory. According to IBM this directory is the mailbox for POP3 mail server of AS/400. The message contains the attachment also, but I think that I can extract it from other message text. About special characters: The messages in that directory are in ASCII format except our scandinavian special chars (ÅÄÖ etc. (or whatever you can see)). I can also read these messages with a POP3 client (ie. Netscape Navigator) and there I see all chars Ok. Special chars are converted to three byte strings ie. 'Ä' (A with dots) is '=C4' when I use ASCII ISO8859, Latin 1 (code page 819). I've written a small RPG program that converts these backwards after I've copied the message file with CPYFRMSTMF command to AS/400 DB file. Hannu

  10. #10
    Guest.Visitor Guest

    Default Where does incoming email go in AS/400 and how it is handled?

    Yes, I think that there must be quite many people who have figured this problem somehow, but for some reason there are no answers...? I tried what you suggested, but the file created contains only one record and it's just a mess (not ASCII text). CPYFRMPCD sent also a message where it was said that file in the folder isn't a PC file (message ID: IWS16BF). Then I tried CPYFRMSTMF and with that I got it nearly right. Special chars didn't convert and attachment is included in the message, but there is no indication where it begins and ends and that is what I need (or separate attachment file). I have to admit that with APIs I could get it separated from the message, but it seems to me too difficult way to manage this problem. Please look what I responded to Bruce. There I explain what I've done so far. Thanks, Hannu

+ Reply to Thread
Page 1 of 2 1 2 LastLast

Similar Threads

  1. Email from RPG
    By olgag@cbpmail.net in forum RPG
    Replies: 7
    Last Post: 10-01-2003, 09:01 AM
  2. AS/400 Email
    By nycsusan@hotmail.com in forum CL
    Replies: 5
    Last Post: 05-20-2002, 11:49 AM
  3. Email IFS files as attachment using AS400 email function
    By wwelton@uastpa.com in forum IBM i (OS/400, i5/OS)
    Replies: 1
    Last Post: 01-05-2002, 02:56 AM
  4. Incoming Remote Command
    By Guest.Visitor in forum Programming
    Replies: 2
    Last Post: 04-07-2000, 08:20 AM
  5. Monitor IP address of incoming Telnet
    By Guest.Visitor in forum Internet
    Replies: 0
    Last Post: 01-01-1995, 02:00 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts