home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 35 Internet
/
35-Internet.zip
/
popcl221.zip
/
lamailer.cmd
< prev
next >
Wrap
OS/2 REXX Batch file
|
1994-09-16
|
2KB
|
73 lines
/* LaMailer.cmd - Mail Delivery Agent for LaMail */
/* Copyright - Anonymous Software */
/* J.Poltorak@bradford.ac.uk */
/* Modified by Claudio Fahey for popclient for OS/2 */
/* e-mail: claudio@uclink.berkeley.edu */
call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
call SysLoadFuncs
parse arg '-dest ' maildir ' -to ' to
date = date('o')
time = time()
mailbox = maildir
inbox = mailbox'\inbox.ndx'
parse value date time with 2 yy'/'mon'/'dd hh':'+1 m +1 mm':'ss
msg = mailbox'\'mon || dd || yy || hh || m'.'mm || ss
header_state = 1
subject = ''
do while lines() \= 0
line=linein()
if (header_state) then do
if word(line,1) = 'From:' then do
parse value subword(line,2) with fullname '<' from '>'
if from = '' then do
from = word(fullname,1)
fullname = ''
end
end
if word(line,1) = 'Subject:' then
subject = subword(line,2)
if line = '' then header_state = 0
end
call lineout msg, line
end
call index
call lineout msg
exit
index:
nickname = copies(' ',8)
fullname = strip(fullname)
from = strip(from)
parse value from with userid '@' nodename '.'
size = copies(' ',12)
f1 = copies(' ',8)
seen = ' '
from_to = ' '
f2 = ' '
call lineout inbox, nickname,
left(userid,8),
left(nodename,8),
translate(filespec('n',msg),' ','.'),
size,
date,
substr(time,1,5),
f1,
seen,
from_to,
f2,
fullname'01'x ||subject'0101'x ||from
return