    if( ~show( 'l', "rexxsupport.library" ) ) then do
if( ~addlib( "rexxsupport.library", 0, -30, 0 ) )then do
say "Could not open rexxsupport.library"
exit 10
end
end
if( ~show( 'l', "rexxdossupport.library" ) ) then do
if( ~addlib( "rexxdossupport.library", 0, -30, 0 ) )then do
say "Could not open rexxdossupport.library"
exit 10
end
end
if( ~show( 'l', "rexxtricks.library" ) ) then do
if( ~addlib( "rexxtricks.library", 0, -30, 0 ) )then do
say "Could not open rexxtricks.library"
exit 10
end
end
Options Results
IF ~show('ports', "YAM") THEN DO
ADDRESS command 'run <nil: >nil: YAM:YAM'
ADDRESS command 'waitforport YAM'
end
Version = 'YaMGate 1.0'
Address YAM
i = 0
n = 0
OUTPATH = 'Mail:Outbound'
if ~exists('S:YamGate.Cfg') then do
Say '** YaMGate Error! ** File YamGate.cfg not found in S: :('
exit
end
Open('CFG','S:YaMGate.cfg','R')
do until EOF(CFG)
Gator=readln(CFG)
Start    = word(Gator,1)
if start = #OUTPATH then do
OUTPATH  = Word(Gator, 2)
end
if Start = #NODE then do
FloNode  = word(Gator,2)
Inet     = word(Gator,3)
Subject  = word(Gator,4)
Node = Translate(FloNode, '..', ':/')
if exists(OUTPATH'/'Node'.FLO') then do
Open(Fish,OUTPATH'/'Node'.FLO','R')
do until EOF(FISH)
Line = readln(FISH)
FiPath = strip(Line, 'L', '^')
Ext  = Upper( Right( FiPath, 3 ) )
if FiPath ~= ' ' then do
if ext ~= HLO then do
NodeLen = Length( FiPath )
DotPos = LastPos( '.', FiPath )
if DotPos > 0 then do
Ext  = Upper( Right( FiPath, NodeLen - DotPos ) )
end
D = d2x(date('S'))
S = d2x(time('S'))
Nice = right(d||S||n,8)
HexBundle = ''Nice'.'Ext''
Match = MatchPattern('(MO#?|TU#?|WE#?|TH#?|FR#?|SA#?|SU#?)', Ext)
if match = 1 then do
Call Rename(FiPath, OUTPATH'/'HexBundle)
FiPath = OUTPATH'/'HexBundle
end
Say 'Gating Mail for 'FloNode' to 'Inet''
call YamWrite
i = i + 1
n = n + 1
end
end
end
call close(Fish)
call Delete(OUTPATH'/'Node'.FLO')
end
end
end
exit
YamWrite:
call Open(Header, 'T:YamHeader.txt', 'W')
call Writeln(Header, ' ')
call Writeln(Header, ' UUEncoded Mail for :- 'FloNode'')
call Writeln(Header, ' ')
call close(Header)
call Open(Footer, 'T:YamFooter.txt', 'W')
call Writeln(Footer, ' ')
call Writeln(Footer, ' 'Version' by Dave Naylor (knocker@frost3.demon.co.uk)')
call close(Footer)
call UUENCODE(FiPath,'t:FoXTemp.uaa')
Address Command 'Join T:YamHeader.txt T:FoXTemp.uaa T:YamFooter.txt to t:Encoded.txt'
writemailto  '"'Inet'"'
writesubject '"'Subject'"'
writeletter  'T:Encoded.txt'
writequeue
call delay(200)
call Delete('T:YamHeader.txt')
call Delete('T:YamFooter.txt')
call Delete('T:Encoded.txt')
call Delete(FiPath)
call Delete('T:FoXTemp.uaa')
return

