🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #217792

Command line email receive/response handlers

#217792
From: Graham Hobbs
Date: Sun, 16 Mar 2008 03:37
121 lines
5150 bytes
Hello,

I've been in msdos.batch and got some useful information about a
problem I have. As a result I did some reading about Pegasus,
Email2db, 40tude, BLAT and Getmail, etc email handlers. For an old
mainframer the reading was heavy and some confusion remains.

I have learned that BLAT would 'seem' to be appropriate for outgoing
emails but I am still not sure about incoming emails.

Because this post is so long I pose the questions immediately in case
you don't want to read further:-)

AND BEING: can any of the above mentioned softwares extract from an
incoming email the sender's email address, the contents of the subject
line and the contents of the body and stick them into a single
solitary text file where the first record would be the sender's email
address, second record the subject line, subsequent records would be
from the email's body, AND where the filename would be unique for each
arriving email?

Can anyone confirm my assessment that BLAT will do my response emails?

Might code examples exist somewhere? Maybe point me where to read.

I thankyou for your patience. My thanks in advance,

Graham Hobbs


... and here is what I am trying to accomplish:


Very short:
---------------
An email arrives, contents are processed, a text file is emailed back
in  < 10 minutes - no manual intervention. At the end of the day I can
look at my own process's logfiles and see the day's activities.

A bit longer:
------------------
I am endeavouring to automate a process on my computer whereby I can
offer an unattended service. The computer receives an email (will
always be text (see (A) below), creates a text file from the address,
subject and body (each file needing a different name), my own
constantly running software (a REXX) will then, a) for every file it
finds, b) invoke a process and produce a response file, c) the
response file is sent back to the emailer (this is what I think BLAT
will handle) - all a non -interruptive process. 

Structurally:
------------------
where filename uniquity (as used below) is achieved via the format:
1) todaysyyyymmdd | ascending_seqntl_number |
2) senders_email_address
e.g. 20080228001graham@chelsea.1st
       20080228002david@arsenal.2nd
     
.. and the process would be ..

1.
Do forever the email receiving handler
for any arriving email (see (A) below)
   extract the address, subject and body into a file 
   e.g.  c:\emailin\filename.cbl
endif
Enddo
i.e. as soon as an email arrives it becomes a .cbl file that my REXX
can detect.

2.
Do forever my own REXX looking for files in c:\emailin
if it finds a file
   the REXX invokes my software which uses filename.cbl as input 
   and creates a response file c:\emailout\filename.txt
endif
Enddo

3.
Do forever the email responder handler
when a c:\emailout\filename.txt file appears
   send an email to the original sender with the file attached
endwhen
Enddo
i.e whatever files I put in c:\emailout get sent immediately.
---------------------

Example (A) 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.
plus more, possibly 1000 lines  

Example (B) A 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.
much more, possibly 5000+ lines

-- 
Posted via a free Usenet account from http://www.teranews.com
Technical Details
Message-ID: <f73pt35eqsq5ak5p2rdmc9r4omfa55gte8@4ax.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newscon02.news.prodigy.net!prodigy.net!news.glorb.com!nntpserver.com!zeus.nntpserver.com!10.1.1.41.MISMATCH!pfilter-v0.1!not-for-mail

Show Full Headers
Complete Article Headers
Message-ID: <f73pt35eqsq5ak5p2rdmc9r4omfa55gte8@4ax.com>
Subject: Command line email receive/response handlers
Date: Sat, 15 Mar 2008 23:37:40 -0400
From: Graham Hobbs <ghobbs@cdpwise.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newscon02.news.prodigy.net!prodigy.net!news.glorb.com!nntpserver.com!zeus.nntpserver.com!10.1.1.41.MISMATCH!pfilter-v0.1!not-for-mail
Newsgroups: news.software.readers
X-Newsreader: Forte Free Agent 1.93/32.576 English (American)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 120
NNTP-Posting-Date: 16 Mar 2008 02:48:29 GMT
X-Complaints-To: abuse@teranews.com
X-Original-Lines: 117