say ' <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=1 WIDTH="100%">'
say ' <TR ALIGN="center">'
say ' <TD BGCOLOR="#336699"><A HREF="yam.rexx?Compose"><B>Compose</B></A></TD>'
say ' <TD BGCOLOR="#336699"><A HREF="yam.rexx?Folder='folder'&Message='message'&Check"><B>Get mail</B></A></TD>'
say ' <TD BGCOLOR="#336699"><A HREF="yam.rexx?Folder='folder'"><B>'cfi.NAME'</B></A></TD>'
say ' <TD BGCOLOR="#336699"><A HREF="yam.rexx"><B>Folders</B></A></TD>'
say ' <TD BGCOLOR="#336699"><A HREF="yam.rexx?List"><B>Folders (full)</B></A></TD>'
say ' <TD BGCOLOR="#336699"><A HREF="yam.rexx?Config"><B>Config</B></A></TD>'
say ' <TD BGCOLOR="#336699"><A HREF="yam.rexx?Help"><B>Help</B></A></TD>'
say ' </TR>'
say ' </TABLE>'
MAILEXPORT 'T:YAM-TextMode.tmp'
if exists(Cfg.UMPath) = 1 then address command Cfg.UMPath || ' MAIL=T:YAM-TextMode.tmp'
say ' <PRE>'
call open(fh, 'T:YAM-TextMode.tmp', 'R')
do while ~eof(fh)
line = readln(fh)
if line = '-- ' then say '<HR>'
else do
line = Replace(line, '<', '<')
line = Replace(line, '>', '>')
say LinkURL(line)
end
end
call close(fh)
say ' </PRE>'
address command 'Delete >NIL: T:YAM-TextMode.tmp'
MAILINFO STEM sel.
if sel.STATUS = 'N' | sel.STATUS = 'U' then MAILSTATUS 'O'
APPNOBUSY
say ' <FORM NAME="WebYAM" ACTION="yam.rexx">'
say ' <INPUT TYPE="hidden" NAME="Folder" VALUE="'folder'">'
say ' <INPUT TYPE="hidden" NAME="Message" VALUE="'message'">'
call ParseFolders
call MakeMoveTo(folder)
say ' </FORM'
return
GetMail: PROCEDURE
MAILCHECK
return
ComposeMail: PROCEDURE EXPOSE Arg.
say ' <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=1 WIDTH="100%">'
say ' <TR ALIGN="center">'
say ' <TD BGCOLOR="#cccc99"><A HREF="yam.rexx?Compose"><B>Compose</B></A></TD>'
say ' <TD BGCOLOR="#336699"><A HREF="yam.rexx?Compose&Check"><B>Get mail</B></A></TD>'
say ' <TD BGCOLOR="#336699"><A HREF="yam.rexx"><B>Folders</B></A></TD>'
say ' <TD BGCOLOR="#336699"><A HREF="yam.rexx?List"><B>Folders (full)</B></A></TD>'
say ' <TD BGCOLOR="#336699"><A HREF="yam.rexx?Config"><B>Config</B></A></TD>'
say ' <TD BGCOLOR="#336699"><A HREF="yam.rexx?Help"><B>Help</B></A></TD>'
say ' </TR>'
say ' </TABLE>'
say ' <FORM NAME="composeform" ACTION="yam.rexx">'
say ' <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0>'
say ' <TR VALIGN="top">'
say ' <TD COLSPAN=2 ALIGN="center">'
say ' <INPUT TYPE="submit" NAME="Send" VALUE="Send">'
say ' <INPUT TYPE="submit" NAME="Cancel" VALUE="Cancel">'
if Arg.Advanced = 0 then
say ' <A HREF="yam.rexx?Compose&Advanced">Advanced</A>'
else
say ' <A HREF="yam.rexx?Compose">Simple</A>'
say ' </TD>'
say ' </TR>'
if Arg.Advanced = 1 then do
say ' <TR>'
say ' <TD ALIGN="right" NOWRAP><B>From:</B></TD>'
say ' <TD ALIGN="left"><INPUT TYPE="text" NAME="From" VALUE="" SIZE=65 MAXLENGTH=1000</TD>'
say ' </TR>'
say ' <TR>'
say ' <TD ALIGN="right" NOWRAP><B>Reply-To:</B></TD>'
say ' <TD ALIGN="left"><INPUT TYPE="text" NAME="ReplyTo" VALUE="" SIZE=65 MAXLENGTH=1000</TD>'
say ' </TR>'
end
say ' <TR>'
say ' <TD ALIGN="right" NOWRAP><B>To:</B></TD>'
say ' <TD ALIGN="left"><INPUT TYPE="text" NAME="To" VALUE="" SIZE=65 MAXLENGTH=1000</TD>'
say ' </TR>'
say ' <TR>'
say ' <TD ALIGN="right" NOWRAP><B>Cc:</B></TD>'
say ' <TD ALIGN="left"><INPUT TYPE="text" NAME="Cc" VALUE="" SIZE=65 MAXLENGTH=1000</TD>'
say ' </TR>'
if Arg.Advanced = 1 then do
say ' <TR>'
say ' <TD ALIGN="right" NOWRAP><B>Bcc:</B></TD>'
say ' <TD ALIGN="left"><INPUT TYPE="text" NAME="Bcc" VALUE="" SIZE=65 MAXLENGTH=1000</TD>'
say ' </TR>'
end
say ' <TR>'
say ' <TD ALIGN="right" NOWRAP><B>Subject:</B></TD>'
say ' <TD ALIGN="left"><INPUT TYPE="text" NAME="Subject" VALUE="" SIZE=65 MAXLENGTH=80</TD>'
say ' </TR>'
say ' <TR>'
say ' <TD></TD>'
say ' <TD HEIGHT=30 VALIGN="middle">'
say ' <INPUT TYPE="checkbox" NAME="Signature" VALUE="on">Add signature'
say ' <INPUT TYPE="checkbox" NAME="Keep" VALUE="off">Delete when sent'
say ' </TD>'
say ' </TR>'
say ' </TABLE>'
say ' <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0>'
say ' <TR>'
say ' <TD ALIGN="center">'
say ' <TEXTAREA NAME="Body" ROWS=30 COLS=74 WRAP="soft"></TEXTAREA>'
say ' </TD>'
say ' </TR>'
say ' </TABLE>'
say ' </FORM>'
return
SendMail: PROCEDURE EXPOSE Arg.
call open(fh, 'T:WebYAM-write.tmp', 'W')
call writeln(fh, Arg.body)
call close(fh)
call GoBusy
'MAILWRITE QUIET'
WRITETO '"'Arg.Recipient'"'
if Arg.From ~= '' then WRITEFROM '"'Arg.From'"'
if Arg.ReplyTo ~= '' then WRITEREPLYTO '"'Arg.ReplyTo'"'
if Arg.Cc ~= '' then WRITECC '"'Arg.Cc'"'
if Arg.Bcc ~= '' then WRITEBCC '"'Arg.Bcc'"'
WRITESUBJECT '"'Arg.Subject'"'
if Arg.Signature = 0 then WRITELETTER 'T:WebYAM-write.tmp' NOSIG
else WRITELETTER 'T:WebYAM-write.tmp'
if Arg.Keep = 0 then 'WRITEOPTIONS DELETE'
else WRITEOPTIONS
WRITESEND
APPNOBUSY
address command 'Delete >NIL: T:WebYAM-write.tmp'
say ' <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=1 WIDTH="100%">'
say ' <TR ALIGN="center">'
say ' <TD BGCOLOR="#336699"><A HREF="yam.rexx?Compose"><B>Compose</B></A></TD>'
say ' <TD BGCOLOR="#336699"><A HREF="yam.rexx?Check"><B>Get mail</B></A></TD>'
say ' <TD BGCOLOR="#336699"><A HREF="yam.rexx"><B>Folders</B></A></TD>'
say ' <TD BGCOLOR="#336699"><A HREF="yam.rexx?List"><B>Folders (full)</B></A></TD>'
say ' <TD BGCOLOR="#336699"><A HREF="yam.rexx?Config"><B>Config</B></A></TD>'
say ' <TD BGCOLOR="#336699"><A HREF="yam.rexx?Help"><B>Help</B></A></TD>'
say ' </TR>'
say ' </TABLE>'
say ' <BR>'
say ' <H2>Your mail was succesfully sent.</H2>'
return
Help: PROCEDURE
say ' <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=1 WIDTH="100%">'
say ' <TR ALIGN="center">'
say ' <TD BGCOLOR="#336699"><A HREF="yam.rexx?Compose"><B>Compose</B></A></TD>'
say ' <TD BGCOLOR="#336699"><A HREF="yam.rexx?Help&Check"><B>Get mail</B></A></TD>'
say ' <TD BGCOLOR="#336699"><A HREF="yam.rexx"><B>Folders</B></A></TD>'
say ' <TD BGCOLOR="#336699"><A HREF="yam.rexx?List"><B>Folders (full)</B></A></TD>'
say ' <TD BGCOLOR="#336699"><A HREF="yam.rexx?Config"><B>Config</B></A></TD>'
say ' <TD BGCOLOR="#cccc99"><A HREF="yam.rexx?Help"><B>Help</B></A></TD>'
say ' </TR>'
say ' </TABLE>'
say ' <BR>'
say ' <H1>WebYAM 1.3 by Jacob Laursen</H1>'; say
say ' <P>Browse your YAM folders through the World Wide Web.</P>'
say ' <P>'
say ' Author''s e-mail address: <A HREF="mailto:laursen@myself.com">laursen@myself.com</A><BR>'
say ' WebYAM homepage: <A HREF="http://home.worldonline.dk/~jlaur/amiga/webyam/">http://home.worldonline.dk/~jlaur/amiga/webyam/</A><BR>'
say ' Status icons by Ash Thomas'
say ' </P>'; say
say ' <H1>YAM information</H1>'; say
say ' <UL>'
INFO 'AUTHOR'
say ' <LI>Author: 'RESULT
INFO 'VERSION'
parse var RESULT '$VER: YAM ' ver .
say ' <LI>Version (running on this server): 'ver
say ' <LI>Website: <A HREF="http://www.yam.ch/">http://www.yam.ch</A>'
say ' <LI>Development team: Emmanuel Lesueur, Jörg Strohmayer, Jacob Laursen, Marcel Beck, Matthias Bethke, Peter Hans van den Muijzenberg, Nico Schottelius'
say ' <LI>Development homepage: <A HREF="http://www.sourceforge.net/projects/yamos/">http://yamos.sourceforge.net</A>'
say ' </UL>'
return
Convert: PROCEDURE
parse arg dummy
dummy = translate(dummy, ' ', '+')
do until pos=0
pos=index(dummy,'%')
if pos>0 then do
hex=substr(dummy,pos+1,2)
char=x2c(hex)
if pos=1 then dummy=char||substr(dummy,pos+3)
if pos>1 & pos<length(dummy)-2 then dummy=left(dummy,pos-1)||char||substr(dummy,pos+3)
if pos=length(dummy)-2 then dummy=left(dummy,pos-1)||char
end
end
return dummy
GoBusy: PROCEDURE
APPBUSY 'TEXT="WebYAM is working, please wait..."'
return
MakeMoveTo: PROCEDURE EXPOSE Cfg.
parse arg folder
say ' <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0>'
say ' <TR>'
say ' <TD ALIGN="center"><INPUT TYPE="submit" NAME="Option" VALUE="Move to"></TD>'
say ' <TD ALIGN="left" COLSPAN=2><SELECT NAME="DestFolder">'
do loop = 0 to Cfg.FolderName.COUNT-1
if loop = folder then iterate
if left(Cfg.FolderName.loop, 2) = 'F:' then say ' <OPTION VALUE="'loop'">'right(Cfg.FolderName.loop,length(Cfg.FolderName.loop)-2)
end
say ' </SELECT></TD>'
say ' </TR>'
say ' <TR>'
say ' <TD ALIGN="center"><INPUT TYPE="submit" NAME="Option" VALUE="Delete"></TD>'
say ' </TR>'
say ' </TABLE>'
return
Replace: PROCEDURE
parse arg String,Old,New
do while index(String,Old) ~= 0
interpret "parse var String left '"Old"' right"
String = left || New || right
end
return String
LinkURL: PROCEDURE
parse arg line
p = index(line, 'http://')
q = index(line, 'www')
if p ~= 0 | q ~= 0 then do
if p = 0 | (p > q & q > 0) then p = q
len = length(line)
l = left(line, p-1)
/* URL start position: len-p+1 */
url = right(line, len-p+1)
/* This is the URL followed by the rest of the line */
parse var url url .
/* Cut what we know for sure is not a part of the URL */
i = length(url)
c = substr(url, i, 1)
do while ~datatype(c, 'ALPHANUMERIC') & c ~= '/' & i > 1
i = i - 1
c = substr(url, i, 1)
end
if i > 1 then url = left(url, i)
else url = ''
r = right(line, length(line)-length(url)-p+1)
if left(url, 7) ~= 'http://' then ref = 'http://' || url