Published on System iNetwork (http://systeminetwork.com)
RPG POP3 Tool Available
By tzura
Created Feb 11 2007 - 08:00

By:
Scott Klement [1]

Q: I'd like to write an RPG program that receives and processes e-mail. In previous newsletters, you've discussed the format of e-mail messages and how to send e-mail using the SMTP protocol, and that has been very helpful. Do you plan to cover receiving e-mail from a Post Office Protocol Version 3 (POP3) server?

A: I've received several questions similar to yours, so it appears that quite a few people are interested in writing RPG programs that interact with a POP3 server. When time permits, I do plan to write an article that describes the POP3 protocol and how you use it to check e-mail, save e-mail in the mailbox, delete e-mail from the mailbox, and so forth. In the meantime, you might be interested in the POP3READ tool. It's an open-source utility, written in pure RPG, that was added recently to the Easy400.net website and that will soon be integrated into the already popular MIME & Mail (MMAIL) tool that Easy400 distributes.

Some Background

Easy400.net is a website run by Giovanni B. Perotti. Perotti originally started it when he worked for IBM Italy, and it was through his site at IBM that the CGIDEV2 toolkit became popular. When Perotti retired, IBM froze the original Easy400 site and started a separate site within their Client Technology Center. Around the same time, Perotti continued his work with open-source software on his own site at http://www.Easy400.net [2]

The POP3READ tool was written by Koen Decorte, a programmer from Belgium. In December 2006, there was a discussion on the Easy400 mailing list in which Giovanni Perotti asked for information about any free POP3 tools for i5/OS. Decorte graciously offered to donate his POP3 programs to the Easy400 project!

The POP3READ Tool

The tool itself works by reading a list of POP3 accounts and passwords from a physical file. For each account, it uses the socket APIs to connect to the POP3 server and download all the messages for that account. For each message received, it creates a stream file in the IFS. You can then access that stream file from your programs, either by utilizing the IFS APIs or by using a tool such as CPYFRMSTMF to convert the stream files to physical files.

For more documentation about the POP3READ tool and how it works, see the deliverables on the Easy400 website at the following link:
http://www.Easy400.net/pop3client [3]

To download the tool, go to the http://www.Easy400.net [4] home page and click the Downloads link on the left side of the page.

© 2010 Penton Media, Inc.

Source URL: http://systeminetwork.com/article/rpg-pop3-tool-available

Links:
[1] http://systeminetwork.com/author/scott-klement
[2] http://www.easy400.net
[3] http://www.easy400.net/pop3client
[4] http://www.easy400.net