REBOL [Title: "Remote Email Agent"] users: [[email protected] [email protected]] password: "pass-email" stop-time: now + 12:00 prior-len: 0 do-ops: func [ops user mailbox /local action] [ foreach [op arg] ops [ action: select [ forward [ if string? arg [ foreach mail mailbox [ if find mail arg [send user mail] ] ] if email? arg [ foreach mail mailbox [ msg: import-email mail if arg = first msg/from [send user mail] ] ] ] list [send user read arg] send [send user read arg] delete [delete arg] quit [quit] ] op either action [do action][ send user join "bad op: " op ] ] ] while [now < stop-time] [ mailbox: read pop://user:[email protected] foreach msg skip mailbox prior-len [ msg: import-email msg from: first msg/from if all [ find users from msg/subject = password ][ ops: try [load msg/content] either error? ops [ send from join "Error: " msg/content ][ do-ops ops from mailbox ] ] ] prior-len: length? mailbox wait 0:10 ]
Script Junkie | REBOL Bots
Over the past two decades, my search for the perfect scripting language led me to work with companies such as HP, Amiga, and Apple. In that time, I investigated more than 50 different languages, from Ada to C, from Pascal to Lisp. I wanted a language that was very simple and readable with almost no syntax, yet very flexible with a wide degree of expressive freedom.Related Reading
More Insights
INFO-LINK
To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy. | |