said:
>REXX Exit (Background) - When the filter is applied, this REXX script
>will be executed in the background. The full path and filename of the
>script must be entered in the entry field to the right of the action.
>The REXX script will be passed one argument, the full path and filename
>of the file containing the full message being filtered.
Typically, background processing means that the invoking application (i.e.
PMMail) will not wait for the REXX script to finish before proceeding.
This is definitely not what you want for an outbound filter. You want
PMMail to wait for you to finish rewriting the file before trying to send
it.
Generally background execution is the same a asynchronous execution.
>The Message Send REXX hook is called right before PMMail sends the
>message to your mail server. This way, you can use this exit to reformat
>the actual message file to include any other information you may want, or
>to remove any part of the message.
I would expect this filter to run synchronously. That is it will wait for
your script to exit before continuing to send the email to the server.
>You will find the original file size remains the same and some of the
>original text is moved down. The syntax is forward 12345.msg. It is a
>bit cobbled up as I've added and removed routines trying to make it work.
>Plus my lack of knowledge makes it kinda rough.
You can simplify the code you use to get the the command line argument
with:
parse arg invocation
invocation = strip(invocation)
>I wouldn't be surprised if it is a logical error, but it sure escapes me.
It doesn't look quite right. I can imagine why you need 2 work files.
However, I've got to finish some stuff up before looking at it in detail.
I seems more complicated than need be. I would recommend rewriting it as:
call sysfiledelete 'tmp.msg'
/* Copy selected header lines */
do while lines(invocation) <> 0
line = linein(invocation)
/* Stop scan at end of header */
if line = '' then do
call lineout 'tmp.msg', line
leave
end
if this header line is to be kept
call lineout 'tmp.msg', line
end
/* Copy rest of message body */
do while lines(invocation) <> 0
line = linein(invocation)
call lineout 'tmp.msg', line
end
call lineout 'tmp.msg'
call stream invocation, 'c', 'close'
'copy tmp.msg' invocation
This assumes that the file is not empty, but that should be OK.
Steven
--
----------------------------------------------------------------------
"Steven Levine" MR2/ICE 2.60b #10183 Warp4/FP15/14.093c_W4
www.scoug.com irc.fyrelizard.com #scoug (Wed 7pm PST)
----------------------------------------------------------------------
=====================================================
To unsubscribe from this list, send an email message
to "steward@scoug.com". In the body of the message,
put the command "unsubscribe scoug-help".
For problems, contact the list owner at
"rollin@scoug.com".
=====================================================
<< Previous Message <<
>> Next Message >>
Return to [ 04 |
November |
2004 ]
The Southern California OS/2 User Group
P.O. Box 26904
Santa Ana, CA 92799-6904, USA
Copyright 2001 the Southern California OS/2 User Group. ALL RIGHTS
RESERVED.
SCOUG, Warp Expo West, and Warpfest are trademarks of the Southern California OS/2 User Group.
OS/2, Workplace Shell, and IBM are registered trademarks of International
Business Machines Corporation.
All other trademarks remain the property of their respective owners.