This is is adapted from an article I wrote that appeared in the October, 1997 issue of extended attributes, the monthly publication of POSSI (The Phoenix OS/2 Society). You can request a free sample copy and get membership information at their web site.
MR2/ICE (or mr2i) is my mailer (and newsreader) of choice for a number of good reasons. One of these is its powerful filtering mechanism which allows a variety of processing of incoming (and/or outgoing messages as well as news headers). In this article, I will attempt an introduction to some of the capabilities of filters, using the filters and auxiliary programs I wrote to manage a POSSI group buy of PMVIEW.
When you select filter maintenance and then New (to create a new filter) there are three filter definition screens:
Here's the Filter Interchange File listing for this filter:
---------- Filter 16 FIF-level 1.35nf1 ----------
"Enabled" f1.1 1 +
"Filter description" f1.2 * POSSI listserv
"Filter alias" f2 * possi
"Search modes:: To " f3 # 2
"Search text" f4 * <MEMBERS@POSSI.ORG>
"Folder for copy :: F055 " f6 * possi
"Filter type:: Inbound " f13.1 1 I
"Search type:: Simple " f13.2 1 S
"Match type:: Match " f13.3 1 M
"Copy to folder" f13.7 1 Y
"Disposition:: Delete NOW " f13.13 1 Y
Now let's look at the group buy and how I used a filter (and an associated REXX program) to automate the process. As you may remember, those wishing to sign up for the buy were requested to send me email with a specific subject, which I used as the Criteria for my filter, as shown here:
Here is the FIF listing for this filter, followed by the POSSIPMV.CMD
listing:
---------- Filter 14 FIF-level 1.35nf1 ----------
"Not enabled" f1.1 1 -
"Filter description" f1.2 * possi pmview buyer
"Filter alias" f2 * pmviewbuy
"Search modes:: Subject " f3 # 4
"Search expression" f4 *
{S} "POSSI PMVIEW BUYER" & !{S} "RE: POSSI PMVIEW BUYER" & ! {F} "MEMBER
S@POSSI.ORG"
"Folder for copy :: F056 " f6 * pmview buyers
"Auto reply template" f7 * possipmview
"Rexx cmd to call on match" f10 * possipmv.cmd
"Filter type:: Inbound " f13.1 1 I
"Search type:: Freeform " f13.2 1 F
"Match type:: Match " f13.3 1 M
"Copy to folder" f13.7 1 Y
"Autoreply" f13.8 1 Y
"Link to Rexx" f13.12 1 Y
"Disposition:: Delete NOW " f13.13 1 Y
/* mr2i filter aid to capture pmview buy addresses */
/* Julian Thomas 1997 */
outfil="possipmv.lst"
parse arg msgfil .
'@echo off'
z=stream(outfil,'c','open write')
z=stream(outfil,'c','seek <0')
z=stream(msgfil,'c','open read')
lin=linein(msgfil)
do until (length(lin)=0)
/* process header */
f=''
rt=''
lin=linein(msgfil)
linx=translate(lin)
/* test to see if we found it */
if pos("From:",lin)=1 then f=lin
if pos("REPLY-TO:",linx)=1 then rt=lin
end
if rt>'' then parse var rt xx user
else parse var f xx user
lo=lineout(outfil,user)
s=stream(msgfil,'c','close')
s=stream(outfil,'c','close')
exit
mr2i passes the filename of the message file to the Rexx program as an argument [in this case the file is only read, but it is possible to modify the file by a program as well]. The program opens the message file and a list file [seeking to the end of the latter], and then reads the header, looking for a Reply-to or a From line, which is parsed to extract the email address of the originator of the message. The Disposition for this filter is the same as for the other example (i.e. no futher processing). Note that this makes the sequence in which the filters are processed critical, and in fact the main filter definition screen provides for controlling this sequence. The possipmv.lst file contains the list of all who have sent the magic message, although I actually maintained the list in another file, and periodically imported the new entries from possipmv.lst into my master list, where I distinguished between those whose checks had been received and the others. By copying sections of my master list into other .LST files, I was able to use the mr2i address group facility to send out mailings, initially with the information on the final price and where to send the checks; subsequently either acknowledging checks or sending reminders/warnings.
Julian Thomas is a retired IBM engineer and programmer who uses OS2 for
almost everything; he, his wife Mary Jane, and Matinicus [a red Maine
Coon cat] now live in the beautiful Finger Lakes Wine Country of New
York State.
![]() |
![]() |