#!/bin/sh # MetaCard 2.4 stack # The following is not ASCII text, # so now would be a good time to q out of more exec mc $0 "$@" ReaderofRevlists1on makeEntry theMessage, theHash put the short name of the defaultstack into olddefaultstack set the defaultstack to "database" new card put theHash into field "Hash" set the HashList of stack "ReaderofRevLists" to the HashList of stack "ReaderofRevLists" & "," & theHash put theMessage into field "whole" repeat for each line theLine in theMessage if body = true then put theLine & return after field "message" else if char 1 to 8 of theLine = "Subject:" then if char 10 to 12 of theLine = "re:" then put char 13 to -1 of theLine into field "Subject" else put char 10 to -1 of theLine into field "Subject" end if else if char 1 to 5 of theLine = "From:" then put char 7 to -1 of theLine into field "From" else if theline = numtochar(13) then put true into body put "turette" end if end repeat replace crlf with return in field "message" set the defaultstack to olddefaultstack end makeEntry Z  ULucida Grande Ums sans serif cREVGeneral scriptChecksumRa?m`ۨ5 debugObjectslstack "ReaderofRevlists" stack "ReaderofRevlists" button id 1003 of card id 1002 of stack "ReaderofRevlists" handlerList makeEntry breakPointsscriptSelectionchar 935 to 934 bookmarks tempScript prevHandler makeEntryscript .

on makeEntry theMessage, theHash

put the short name of the defaultstack into olddefaultstack

set the defaultstack to "database"

new card

put theHash into field "Hash"

set the HashList of stack "ReaderofRevLists" to the HashList of stack "ReaderofRevLists" & "," & theHash

put theMessage into field "whole"

repeat for each line theLine in theMessage

if body = true then

put theLine & return after field "message"

else if char 1 to 8 of theLine = "Subject:" then

if char 10 to 12 of theLine = "re:" then

put char 13 to -1 of theLine into field "Subject"

else

put char 10 to -1 of theLine into field "Subject"

end if

else if char 1 to 5 of theLine = "From:" then

put char 7 to -1 of theLine into field "From"

else if theline = numtochar(13) then

put true into body

put "turette"

end if

end repeat

replace crlf with return in field "message"

set the defaultstack to olddefaultstack

end makeEntry

 @connect blockingEp on mouseUp --110 = pop3 port hide field "help" lock screen put empty into theList put field "Server" into server put field "User" into user put the myPassword of button "password" into passw open socket to server & ":110" read from socket server & ":110" until crlf unlock screen put it into field 1 write ( "USER" && user & crlf ) to socket server & ":110" read from socket server & ":110" until crlf put return & it after field 1 if it contains "-ERR" then finished answer "Error: no such user" exit mouseUp else write ( "PASS" && passw & crlf ) to socket server & ":110" read from socket server & ":110" until crlf end if put return & it after field 1 if it contains "-ERR" then finished answer "Error: wrong password" exit mouseUp end if write ( "STAT" & crlf ) to socket server & ":110" read from socket server & ":110" until crlf if it contains "-ERR" then finished answer "command: 'STAT' not supported or recognized, please retry" exit mouseUp end if put return & it & return & return after field 1 put the second word of it into theCount repeat with theRecord = 1 to theCount put theRecord into the last line of field 1 write ( "TOP" && theRecord && "0" & crlf ) to socket server & ":110" read from socket server & ":110" until crlf & "." & crlf if it contains "Reply-To: use-revolution@lists.runrev.com" then put theRecord & ", " after theList end if end repeat put item 1 to -2 of theList into theList put return & "Mails:" & theList & return after field 1 --checkUIDL repeat for each item theItem in theList write ( "UIDL" && theItem & crlf ) to socket server & ":110" read from socket server & ":110" until crlf put word 3 to -1 of it into theHash put theHash & return after field 1 if thehash is not among the items of the hashList of this stack then write ( "RETR" && theItem & crlf ) to socket server & ":110" read from socket server & ":110" until crlf & "." & crlf makeEntry it, theHash --in the stack's script end if end repeat finished end mouseUp on Finished write ( "QUIT" & crlf ) to socket server & ":110" read from socket server & ":110" until crlf put return & it && "quit" after field 1 end Finished f cREVGeneral scriptChecksumq}|:fΊP handlerListmouseUp Finished breakPointsscriptSelection char 49 to 48 revUniqueID 1059693304485 bookmarks tempScript prevHandler connectedscript

on mouseUp --110 = pop3 port

hide field "help"

lock screen

put empty into theList

put field "Server" into server

put field "User" into user

put the myPassword of button "password" into passw

open socket to server & ":110"

read from socket server & ":110" until crlf

unlock screen

put it into field 1

write ( "USER" && user & crlf ) to socket server & ":110"

read from socket server & ":110" until crlf

put return & it after field 1

if it contains "-ERR" then

finished

answer "Error: no such user"

exit mouseUp

else

write ( "PASS" && passw & crlf ) to socket server & ":110"

read from socket server & ":110" until crlf

end if

put return & it after field 1

if it contains "-ERR" then

finished

answer "Error: wrong password"

exit mouseUp

end if

write ( "STAT" & crlf ) to socket server & ":110"

read from socket server & ":110" until crlf

if it contains "-ERR" then

finished

answer "command: 'STAT' not supported or recognized, please retry"

exit mouseUp

end if

put return & it & return & return after field 1

put the second word of it into theCount

repeat with theRecord = 1 to theCount

put theRecord into the last line of field 1

write ( "TOP" && theRecord && "0" & crlf ) to socket server & ":110"

read from socket server & ":110" until crlf & "." & crlf

if it contains "Reply-To: use-revolution@lists.runrev.com" then

put theRecord & ", " after theList

end if

end repeat

put item 1 to -2 of theList into theList

put return & "Mails:" & theList & return after field 1

--checkUIDL

repeat for each item theItem in theList

write ( "UIDL" && theItem & crlf ) to socket server & ":110"

read from socket server & ":110" until crlf

put word 3 to -1 of it into theHash

put theHash & return after field 1

if thehash is not among the items of the hashList of this stack then

write ( "RETR" && theItem & crlf ) to socket server & ":110"

read from socket server & ":110" until crlf & "." & crlf

makeEntry it, theHash --in the stack's script

end if

end repeat

finished

end mouseUp

on Finished

write ( "QUIT" & crlf ) to socket server & ":110"

read from socket server & ":110" until crlf

put return & it && "quit" after field 1

end Finished

Field 1)` v cREVGeneral revUniqueID 1059693323521   `@{w Server)` cREVGeneral revUniqueID 1059699101384  User)`  cREVGeneral revUniqueID 1059699112434   PasswordEpmon mouseUp ask password clear "Enter your password please:" set the myPassword of me to it end mouseUp < myPasswordempty cREVGeneralscriptChecksum8|X/6 revUniqueID 1059699164996 bookmarks handlerListmouseUp tempScript prevHandlermouseUpscriptSelection char 17 to 16script5

on mouseUp

ask password clear "Enter your password please:"

set the myPassword of me to it

end mouseUp

 DatabaseEp.on mouseUp go stack "database" end mouseUp ^<R cREVGeneralscriptChecksumUD뤉 ;4U4% revUniqueID 1059701813216 bookmarks handlerListmouseUp tempScript prevHandlermouseUpscriptSelection char 24 to 23script{

on mouseUp

go stack "database"

end mouseUp

ViewerEpon mouseUp lock screen put the Subjects of stack "Viewer" into theSubjects put the links of stack "Viewer" into theLinks repeat for the number of cards of stack "Database" times add one to cardNumber put field "subject" of card cardNumber of stack "Database" into subject if subject is among the lines of theSubjects then put lineOffset(subject, theSubjects) into theLineNumber if cardnumber is not among the items of line theLineNumber of theLinks then put line theLineNumber of theLinks , cardNumber into line theLineNumber of theLinks end if else put return & subject after theSubjects put return & cardNumber after theLinks end if end repeat put line 2 to -1 of theSubjects into field "subjects" of stack "viewer" set the Subjects of stack "viewer" to thesubjects set the links of stack "viewer" to theLinks go stack "viewer" end mouseUp <R cREVGeneralscriptChecksum7rP$c .Xg6 bookmarks revUniqueID 1059746201331 handlerListmouseUpscriptSelectionchar 590 to 589 prevHandlermouseUp tempScriptscript

on mouseUp

lock screen

put the Subjects of stack "Viewer" into theSubjects

put the links of stack "Viewer" into theLinks

repeat for the number of cards of stack "Database" times

add one to cardNumber

put field "subject" of card cardNumber of stack "Database" into subject

if subject is among the lines of theSubjects then

put lineOffset(subject, theSubjects) into theLineNumber

if cardnumber is not among the items of line theLineNumber of theLinks then

put line theLineNumber of theLinks , cardNumber into line theLineNumber of theLinks

end if

else

put return & subject after theSubjects

put return & cardNumber after theLinks

end if

end repeat

put line 2 to -1 of theSubjects into field "subjects" of stack "viewer"

set the Subjects of stack "viewer" to thesubjects

set the links of stack "viewer" to theLinks

go stack "viewer"

end mouseUp

connect nonblockingEp Xlocal server, user, passw, theList, theHash, theCount, theRecord on mouseUp --110 = pop3 port put empty into theList put field "Server" into server put field "User" into user put the myPassword of button "password" into passw open socket to server & ":110" read from socket server & ":110" until crlf with message "connected" end mouseUp on connected theID theData put theData into field 1 write ( "USER" && user & crlf ) to socket server & ":110" read from socket server & ":110" until crlf with message "login" end connected on login theID theData put return & theData after field 1 if theData contains "-ERR" then finished answer "Error: no such user" else write ( "PASS" && passw & crlf ) to socket server & ":110" read from socket server & ":110" until crlf with message "login2" end if end login on login2 theID theData put return & theData after field 1 if theData contains "-ERR" then finished answer "Error: wrong password" else write ( "STAT" & crlf ) to socket server & ":110" read from socket server & ":110" until crlf with message "Status" end if end login2 on Status theID theData put return & theData after field 1 put the second word of theData into theCount put 1 into theRecord querryheader end status on querryHeader write ( "TOP" && theRecord && "0" & crlf ) to socket server & ":110" read from socket server & ":110" until crlf & "." & crlf with message "processHeader" end querryHeader on processHeader theID theMessage if theRecord <= theCount then if theMessage contains "Reply-To: use-revolution@lists.runrev.com" then put theRecord & "," after theList end if add 1 to theRecord querryHeader put theList exit processHeader end if put "messages from RunRev:" & theList after field 1 --checkUIDL repeat for each item theItem in theList write ( "UIDL" && theItem & crlf ) to socket server & ":110" read from socket server & ":110" until crlf put word 2 to -1 of it into theHash put theHash & return after field 1 -- if thehash is not among the items of the hashList of this stack then -- write ( "RETR" && theItem & crlf ) to socket server & ":110" -- read from socket server & ":110" until crlf & "." & crlf -- makeEntry it, theHash --in the stack's script -- end if end repeat finished end processHeader on Finished theID theData put return & theData after field 1 write ( "QUIT" & crlf ) to socket server & ":110" read from socket server & ":110" until crlf put return & it && "quit" after field 1 end Finished "d cREVGeneral scriptChecksumT.}rB*cJ" breakPoints handlerListImouseUp connected login login2 Status querryHeader processHeader FinishedscriptSelectionchar 1886 to 1885 bookmarks revUniqueID 1059766998239 prevHandler connected tempScriptscriptB

local server, user, passw, theList, theHash, theCount, theRecord

on mouseUp --110 = pop3 port

put empty into theList

put field "Server" into server

put field "User" into user

put the myPassword of button "password" into passw

open socket to server & ":110"

read from socket server & ":110" until crlf with message "connected"

end mouseUp

on connected theID theData

put theData into field 1

write ( "USER" && user & crlf ) to socket server & ":110"

read from socket server & ":110" until crlf with message "login"

end connected

on login theID theData

put return & theData after field 1

if theData contains "-ERR" then

finished

answer "Error: no such user"

else

write ( "PASS" && passw & crlf ) to socket server & ":110"

read from socket server & ":110" until crlf with message "login2"

end if

end login

on login2 theID theData

put return & theData after field 1

if theData contains "-ERR" then

finished

answer "Error: wrong password"

else

write ( "STAT" & crlf ) to socket server & ":110"

read from socket server & ":110" until crlf with message "Status"

end if

end login2

on Status theID theData

put return & theData after field 1

put the second word of theData into theCount

put 1 into theRecord

querryheader

end status

on querryHeader

write ( "TOP" && theRecord && "0" & crlf ) to socket server & ":110"

read from socket server & ":110" until crlf & "." & crlf with message "processHeader"

end querryHeader

on processHeader theID theMessage

if theRecord <= theCount then

if theMessage contains "Reply-To: use-revolution@lists.runrev.com" then

put theRecord & "," after theList

end if

add 1 to theRecord

querryHeader

put theList

exit processHeader

end if

put "messages from RunRev:" & theList after field 1

--checkUIDL

repeat for each item theItem in theList

write ( "UIDL" && theItem & crlf ) to socket server & ":110"

read from socket server & ":110" until crlf

put word 2 to -1 of it into theHash

put theHash & return after field 1

-- if thehash is not among the items of the hashList of this stack then

-- write ( "RETR" && theItem & crlf ) to socket server & ":110"

-- read from socket server & ":110" until crlf & "." & crlf

-- makeEntry it, theHash --in the stack's script

-- end if

end repeat

finished

end processHeader

on Finished theID theData

put return & theData after field 1

write ( "QUIT" & crlf ) to socket server & ":110"

read from socket server & ":110" until crlf

put return & it && "quit" after field 1

end Finished

Field 2 p D cREVGeneral revUniqueID 1059770921169 Server Field 2 p"D cREVGeneral revUniqueID 1059770955091 User Field 2 `l cREVGeneral revUniqueID 1059770965723 Log:show/hide HelpEp`on mouseUp set the visible of field "help" to (not the visible of field "Help") end mouseUp *X` cREVGeneralscriptChecksum[)&rfGE revUniqueID 1059771060099 bookmarks handlerListmouseUp tempScript prevHandlerscriptSelection char 83 to 82script

on mouseUp

set the visible of field "help" to (not the visible of field "Help")

end mouseUp

Help)` v cREVGeneral revUniqueID 1059771089504  This stack was made and bulished within 24 hours. The autor (Bjrnke von Gierke) did also attend a Party (4 h), he eat (1/2h) and slept (10h) during that time. *The stack is a simple hirarchically viewer for the use-revolution mailing list. To use it, enter your pop server and your login information. Then click the "Connect blocking" button and wait while all relevant messages get downloaded. it takes ca. half a minute for 20 messages. All messages will remain on your server for later download from your normal mail client. After downloading you may click the "viewer" button to see the mails listed in the order you recieved them. Also check out the database to see what information is stored for each mail. Inspect the scripts too and if you make improvements to the stack PLEASE mail me a copy, so that I can upload it to let others benefit too! (bvg AT mac.com). I originally intended to make this non-blocking, but I never got it to work corrrectly in that manner. WARNING: if you have lots of mail on your pop account (for example if you leave all messages always stored on the server) then connecting will use lots and lots of time. `@{w Database1z  @ backgroundi cREVGeneral revUniqueID 1059702967326 From)` cREVGeneral revUniqueID 1059701239492  Message)`R cREVGeneral revUniqueID 1059701271930  `@|S Hash)` cREVGeneral revUniqueID 1059701726879  <<Ep'on mouseUp go prev card end mouseUp pR cREVGeneralscriptChecksum!.[|m1`) revUniqueID 1059701750537 bookmarks handlerListmouseUp tempScript prevHandlermouseUpscriptSelection char 21 to 20script

on mouseUp

go prev card

end mouseUp

>>Ep'on mouseUp go next card end mouseUp (pR cREVGeneralscriptChecksume) Μ~} revUniqueID 1059701759695 bookmarks handlerListmouseUp tempScript prevHandlerscriptSelection char 26 to 25scriptt

on mouseUp

go next card

end mouseUp

Subject)`8 cREVGeneral revUniqueID 1059702904354  whole)` cREVGeneral revUniqueID 1059739334622  `@{viewer1a  Ums sans serifcREVGeometryCachestackID1008 @cREVGeometryCacheIDs105974594177510051059745979013100710597458938661003cREVGeometrycacheorder*1059745893866 1059745941775 1059745979013 total3  Subjects)pqon mouseUp lock screen put "" into field "Entries" put "" into theEntries put line lineOffset((the selectedtext of me),the subjects of this stack) of the links of this stack into theEntries repeat for each item theItem in theEntries put theItem && field "From" of card theItem of stack "Database" & return after field "Entries" end repeat end mouseUp  cREVGeometryMaster,scaleBottomObjectSideBottomMaster,movehDistancefalseMaster,scaleBottomscaleBottomtrueMaster,scaleRightscaleBottomtrueMastertrueMaster,scaleTopObjectRefcardMaster,scaleLeftObjectRefcardMaster,scaleBottomObjectRefcardMaster,scaleBottomAbsolutefalseMaster,scaleBottomtrueMaster,scaleTopObjectSideTopMaster,scaleLeftObjectSideLeftMaster,movevDistancefalseMaster,scalebottomDistance -0.559113Master,expectedRect 0,0,282,171Master,scaleRightAbsolutefalseMaster,scaleRightfalseMaster,scalerightDistance -0.331754Master,scaleTopAbsolutetrueMaster,scaleLeftAbsolutetrueMaster,scaleRightObjectSideRightMaster,scaleRightObjectRefcardMaster,scaleToptrueMaster,scaleLefttrueMaster,cardRanking3Master,scaletopDistance0Master,scaleleftDistance0 cREVGeneralscriptChecksumBGht'"U bookmarks revUniqueID 1059745893866 handlerListmouseUpscriptSelectionchar 141 to 140 prevHandlermouseUp tempScriptscriptP

on mouseUp

lock screen

put "" into field "Entries"

put "" into theEntries

put line lineOffset((the selectedtext of me),the subjects of this stack) of the links of this stack into theEntries

repeat for each item theItem in theEntries

put theItem && field "From" of card theItem of stack "Database" & return after field "Entries"

end repeat

end mouseUp

 `@  Entries)pon mouseUp put field "Message" of card (the first word of the selectedText of me) of stack "Database" into field "text" end mouseUp  cREVGeometryMaster,scaleBottomObjectSideBottomMaster,movehDistancefalseMaster,scaleBottomscaleBottomtrueMastertrueMaster,scaleleftObjectRef 1059745893866Master,scaleTopObjectRefcardMaster,scaleBottomObjectRefcardMaster,scaleBottomAbsolutefalseMaster,scaleBottomtrueMaster,scaleleftObjectSiderightMaster,scaleTopObjectSideTopMaster,movevDistancefalseMaster,scalebottomDistance-0.53202Master,expectedRect 282,0,422,190Master,scaleRightAbsolutetrueMaster,scaleRighttrueMaster,scalerightDistance0Master,scaleRightObjectRefcardMaster,scaleRightObjectSideRightMaster,scaleleftAbsolutetrueMaster,scaleTopAbsolutetrueMaster,scalelefttrueMaster,scaleToptrueMaster,cardRanking3Master,scaletopDistance0Master,scaleleftDistance0 cREVGeneralscriptChecksum OI)aNw bookmarks revUniqueID 1059745941775 handlerListmouseUpscriptSelectionchar 135 to 134 prevHandlermouseUp tempScriptscriptI

on mouseUp

put field "Message" of card (the first word of the selectedText of me) of stack "Database" into field "text"

end mouseUp

 `@ Text)` cREVGeometryMaster,scaleBottomObjectSideBottomMaster,movehDistancefalseMastertrueMaster,scaletopObjectRef 1059745893866Master,scaleLeftObjectRefcardMaster,scaleBottomObjectRefcardMaster,scaleBottomAbsolutetrueMaster,scaleBottomtrueMaster,scaletopObjectSidebottomMaster,scaleLeftObjectSideLeftMaster,movevDistancefalseMaster,scalebottomDistance-15Master,expectedRect 0,176,416,370Master,scaleRightAbsolutetrueMaster,scaleRighttrueMaster,scalerightDistance0Master,scaleRightObjectRefcardMaster,scaleRightObjectSideRightMaster,scaletopAbsolutetrueMaster,scaleLeftAbsolutetrueMaster,scaletoptrueMaster,scaleLefttrueMaster,cardRanking3Master,scaletopDistance-1Master,scaleleftDistance0 cREVGeneral revUniqueID 1059745979013  `@