#!/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 "$@" ReaderofRevlists 1 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 Z U Lucida Grande U ms sans serif cREVGeneral scriptChecksum Ra?m`ۨ5 debugObjects lstack "ReaderofRevlists" stack "ReaderofRevlists" button id 1003 of card id 1002 of stack "ReaderofRevlists"handlerList makeEntrybreakPoints scriptSelection char 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 blocking Ep 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 scriptChecksum q}|:fΊPhandlerList mouseUp FinishedbreakPoints scriptSelection char 49 to 48revUniqueID 1059693304485 bookmarks tempScript prevHandler connectedscripton 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 Password Ep mon mouseUp ask password clear "Enter your password please:" set the myPassword of me to it end mouseUp <