[REBOL] Re: help with trivial emailgetter
From: gscottjones:mchsi at: 31-Oct-2002 10:20
From: "bryan"
> Can you tell me the syntactical error I am making which keeps my
> messages from being removed from my server, the line I am assuming
> should remove the message is "remove first messages" :
>
> REBOL[Title "emailgetter"]
>
> mailbox: [
> scheme: 'pop
> host: "hostname"
> user: "username"
> pass: "password"
> ]
>
> messages: read mailbox
> num-messages: length? messages
> while [not tail? messages] [
> msg: import-email first messages
> filename: rejoin[ trim msg/subject num-messages ".txt"]
> write to-file filename msg/content
> remove first messages
> num-messages: num-messages - 1
> messages: next messages
> ]
Hi, Bryan,
If I am reading your code correctly, you have created a copy of all your
messages in the pop server and assigned the word messages to that
information. 'read on the pop protocol (all, actually) open and coses the
connection. You are no longer connected to the server. The 'remove action
will only be performed on the block that contains these messages. The
server remains untouched. To remove messages from the server, one "opens"
the servers, gets the goods, then "removes" on the srver port, then closes.
Since I rarely use pop from REBOL, it will be safer to refer you to the
documentation. More can be found at:
http://www.rebol.com/docs/core23/rebolcore-13.html#sect10.
Hope that helps. If it doesn't, feel free to reask.
--Scott Jones