home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 35 Internet
/
35-Internet.zip
/
namchang.zip
/
namchang.cmd
next >
Wrap
OS/2 REXX Batch file
|
1997-05-09
|
2KB
|
54 lines
/* apply to outgoing mail from msgutil to change the "From" and the sig */
/* */
/* based on code from William H. Geiger III */
/* whgiii@amaranth.com */
/* usage: 1. Edit the lines to reflect the changes you want to make
It changes the "From:" line in the header to what you set
"newfrom" to [be careful not to mismatch quotes here!]
and one line in the message (presumably in the sig)
which must match exactly the contents of oldsig;
this line will be changed to newsig.
To bypass this test set oldsig= ""
2. Edit msgutil.cmd (in the mr2ice directory) to have
an unused Ctrl-Fkey invoke this cmd file as follows:
call "namechang" filename
3. To use, when composing a message, press Ctrl and the
selected Fkey.
*/
/* edit these three lines to reflect the changes you want to make */
newfrom='From: "Mary Jane Thomas" <jt@epix.net>'
oldsig= " Julian Thomas (and/or if appropriate, Mary Jane Thomas)"
newsig=" Mary Jane Thomas"
/* you shouldn't need to edit anything after this */
parse arg msg_filename .
'@echo off'
blank=''
from="From:"
outfilename="namchang.tmp"
nxy=1
nxz=stream(outfilename,'c','open write')
nzz=stream(msg_filename,'c','open read')
do forever while (length(linein(msg_filename))>0) /* pull file header */
nxx=stream(msg_filename,'c','seek +0') /* get read pointer */
nxx_rs=stream(msg_filename,'c','seek =' nxy) /* reset read pointer */
lin=linein(msg_filename)
/* test to see if we change the FROM */
if pos(from,lin)=1 then lo=lineout(outfilename,newfrom)
else lo=lineout(outfilename,lin)
nxy=stream(msg_filename,'c','seek +0')
end
lo=lineout(outfilename,blank)
do forever while lines(msg_filename)
lin=linein(msg_filename)
if (lin=oldsig) & (oldsig<>"") then lo=lineout(outfilename,newsig)
else lo=lineout(outfilename,lin)
end
st1=stream(msg_filename,'c','close')
st3=stream(outfilename,'c','close')
'erase' msg_filename
'rename' outfilename msg_filename
exit