Code Comments
Programming Forum and web based access to our favorite programming groups.Hello, In my search for an email handler with complexities the likes of which Outlook Express does not have, it was suggested by a PHP person saying PHP could easily do the job. But I don't have the time to learn such. But he did ask if I knew a language that might suffice. Well, I know REXX reasonably well and use it extensively. But have never used it to talk to the outside world, specifically POP3 servers for incoming emails and SMTP servers for outgoing emails. So I am wondering if anyone in this group can give me some clues, pointers as to the feasibility of REXX capabilities in this respect. I have an XP Pro laptop permanently wireless connected to the Internet, in particular to my Outlook Express email program. Thereby I continuously receive emails without any intervention, they 'arrive' unbeckoned. To read and act thereon I have to intervene which is what I wish to avoid. In short I am endeavouring to automate a process on my computer whereby I can offer an unattended service. What I need is a 'REXX1 pgm' (which should poll my ISP's POP3 server every ten minutes), to receive 'n' emails, put them in separate files in a specified directory each with a unique filename being a unique number | the sender's email address e.g. c:\emailin\001jdoe@ink.ca). My REXX2 then polls this directory and acts on each file and prepares a text file to be sent back to 'jdoe'. REXX2 is within my skill range. REXX3 then needs to send the text file to jdoe@ink.ca as an attachment. Question is: are REXX1 and REXX3 impossible | difficult | easy to write, are there examples anywhere? Any help welcome and I thankyou in advance. Graham Example of a typical incoming email: ----------------------------------- From: John Doe Subject: CONRAD 4LW=clna 01 OLDFOR-RECORD-DESCRIPTION. 05 OLDFOR-REC. * 10 FILLER PIC X(480). 10 FILLER PIC X(528). 05 OLDFOR-FIREH-REC REDEFINES OLDFOR-REC. 10 OLDFOR-IN-SGMNT. 15 FILLER PIC X(02). A1 15 OLDFOR-IN-CUST PIC X(14). 15 OLDFOR-IN-INIT PIC X(12). 15 OLDFOR-IN-AMT PIC 9(8)V99. etc. possibly 1000 lines Example of an attachment to the response email: ---------------------------------------------- *``STEPL99 IDENTIFICATION DIVISION. PROGRAM-ID. STEPL99. DATE-WRITTEN. APR 1989. ENVIRONMENT DIVISION. CONFIGURATION SECTION. SOURCE-COMPUTER. IBM-370. OBJECT-COMPUTER. IBM-370. INPUT-OUTPUT SECTION. FILE-CONTROL. etc. possibly 5000+ lines -- Posted via a free Usenet account from http://www.teranews.com
Post Follow-up to this messageGraham Hobbs wrote: > Question is: are REXX1 and REXX3 impossible | difficult | easy to > write, are there examples anywhere? > > Any help welcome and I thankyou in advance. If you are willing to do some work it is not all that difficult to communicate with a pop server. The real work is what to do with the emails once you have them, like store them in some kind of database or file. It sounds like you have a plan for that so this ma be a Simple Matter of Programming (SMoP). While I don't have any code that communicates with a pop server I do have code that communicates with an SMTP server. The concepts are the same for both so you would just need to figure out the protocol and program it as desired. My SMTP code is a set of ooRexx classes that deal with Mime types, sockets and the SMTP server. You can find them at http://oorexx.svn.sourceforge.net/v...utils/internet/ They should give you some ideas about how to get started. As to the pop protocol, I would highly suggest a reference book like "TCP/IP Protocol Suite" by Forouzan (pub McGraw Hill). It is an expensive book but there is no way I would ever be able to survive the TCP/IP world without it. I wish you well in your endevor. David Ashley ooRexx Project Team
Post Follow-up to this messageGraham Hobbs <ghobbs@cdpwise.net> wrote: > > Hello, > > In my search for an email handler with complexities the likes of which > Outlook Express does not have, it was suggested by a PHP person saying > PHP could easily do the job. But I don't have the time to learn such. > But he did ask if I knew a language that might suffice. Python has this sort of thing built-in. Python can be written in a procedural way or using OO paradigms. As a long-term REXX user I'm not finding Python too hard to fiddle with, except that it has so much built-in that it's hard not to reinvent wheels. [The main reason I'm looking at Python at all is for cross-platform compatibility, plus a desire to stop my brain mouldering.] -- Jeremy C B Nicoll - my opinions are my own.
Post Follow-up to this messageOn Mar 19, 6:13 pm, David Ashley <dash...@us.ibm.com> wrote: > Graham Hobbs wrote: > > ... > While I don't have any code that communicates with a pop server ... > David Ashley > ooRexx Project Team For an idea of how to write a pop server in Rexx you could look at Toby Thurston's macros for X2. http://www.wildfire.dircon.co.uk/ hth Jon
Post Follow-up to this message> What I need is a 'REXX1 pgm' (which should poll my ISP's POP3 server > every ten minutes), to receive 'n' emails, put them in separate files > in a specified directory each with a unique filename Why does this part have to be written in 100% Rexx? Try e.g. SOUP instead, and save yourself some very avoidable troubles... ---
Post Follow-up to this messageOn 03/19/08 08:27 am, Graham Hobbs wrote: > > Well, I know REXX reasonably well and use it extensively. But have > never used it to talk to the outside world, specifically POP3 servers > for incoming emails and SMTP servers for outgoing emails. So I am > wondering if anyone in this group can give me some clues, pointers as > to the feasibility of REXX capabilities in this respect. > Rexxmail may work for you: <http://www.degeus.com/rexxmail/> -- jmm (hyphen) list (at) sohnen-moe (dot) com (Remove .AXSPAMGN for email)
Post Follow-up to this messageOK tell me more please? Googling tells me SOUP is thick and thin:-) On Thu, 20 Mar 2008 06:00:05 +0200, spamgate@hotmai1.com (ML) wrote: > > >Why does this part have to be written in 100% Rexx? Try e.g. SOUP >instead, and save yourself some very avoidable troubles... > > > >--- -- Posted via a free Usenet account from http://www.teranews.com
Post Follow-up to this messageI downloaded it but it only talks about OS/2 (which I dearly used to love). Cheers. On Thu, 20 Mar 2008 11:31:06 -0700, Jim Moe <jmm-list.AXSPAMGN@sohnen-moe.com> wrote: >On 03/19/08 08:27 am, Graham Hobbs wrote: > Rexxmail may work for you: ><http://www.degeus.com/rexxmail/> -- Posted via a free Usenet account from http://www.teranews.com
Post Follow-up to this message> OK tell me more please? > Googling tells me SOUP is thick and thin:-) S (Soup, Smtp) is Simple, and so is Rexx. No need to re-invent wheels, unless out of pure interest. Assuming DOS (/Win32): http://hobbes.nmsu.edu/pub/os2/apps...il/souper15.zip http://combee.techwood.org/old/soup12.html (a.o.) Don't go that nuts with the docs. It's probably far easier to download an e-mail with it ("souper95 -n"), and take a closer look at the files created. ---
Post Follow-up to this messageIn article <7HE6HlQNAxnJ090yn@hotmai1.com>, spamgate@hotmai1.com (ML) wrote: > >S (Soup, Smtp) is Simple, and so is Rexx. No need to re-invent wheels, >unless out of pure interest. ... I vote for SOUP, too. It was designed to be "wrapped" in a script (batch, Bash, REXX etc). I've been using VSOUP (multi-threaded SOUP for OS/2) for about 10 years. I have a complex environment (4 news servers, 2 mail servers). I use REXX to manage multiple invocations of VSOUP to download from all servers at once, and more REXX to filter the results on import into my news/mail reader (YARN). Yet more REXX parses the outgoing mail and sets a custom From: line for each destination, then manages the upload to multiple hosts. If you have any questions about SOUP usage and file formats etc, feel free to ask. -- Don Hills (dmhills at attglobaldotnet) Wellington, New Zealand "New interface closely resembles Presentation Manager, preparing you for the wonders of OS/2!" -- Advertisement on the box for Microsoft Windows 2.11 for 286
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.