[REBOL] pop question Re:
Actually, neither will happen they way you have specified it. This is because you have called REMOVE which will only remove the first element (use CLEAR). But to answer the real question: bag: open pop://user:[EMAIL PROTECTED] length? bag == 5 and DO NOT close it while my program runs for, say, 10 minutes. If the server receives 3 more messages for me during that time and I then do: CLEAR bag ; !! note, CLEAR removes all items, REMOVE does one close bag All 5 items will be removed and the next time you check your mail you will have the 3 new messages. It's easy to check since you can mail yourself some messages while you have the port open and I strongly suggest you do this for two reasons. One, understanding usually comes better through doing than hearing and two, you will prove that is DOES work like this and will not worry that you got the wrong info from somebody else (like me). And I don't want to responsible for lost email in case the server you access is totally weird. :) Sterling For you email gurus out there: I open an email port like this: bag: open pop://user:[EMAIL PROTECTED] length? bag == 5 and DO NOT close it while my program runs for, say, 10 minutes. If the server receives 3 more messages for me during that time and I then do: remove bag close bag Will only the original 5 messages be removed from the server or, since the port was left open, will all 8 of the messages be removed from the server. (with me never knowing about the last 3.) Greg Coughlan
[REBOL] pop question Re:(3)
No problem. If I understand you last question correctly, it means something like this: How doe the server insure that the client only deals with the currently delivered emails while it has the box open? If that's the question, the answer is that I don't know all the specifics. However, from messing around with the POP protocol and watching my mailbox at the same time, I've noticed that the server does not deliver new messages to you mailbox (a simple file) until the mailbox is closed. It keeps the incoming mail in it's spool, a temp file, or some such place until it is safe to deliver. It also, as I recall, removes the mailbox file while you have it open. so when you open the mailbox and then go look for the file on the server, it actually appears empty on the server though you are reading a bunch of messages on the client side. I figure this is to protect the system from mailbox edits while the box is open... could royally mess things up. If I'm incorrect anywhere here or somebody knows all the nifty details, feel free to correct and/or add. Sterling Thanks Sterling, I will perform the suggested testing -- I wouldn't want to turn something loose that mucks around in someone's mailbox until I was sure it was bulletproof AND that I understood exactly how it worked. I went back and checked the docs on "remove" and "clear"-- you're right (of course!), I remembered them wrong. Thanks for "clearing "things up. (;-) If you know, does the server somehow flag an individual message as to whether the client has been informed of its presence in the mailbox; and not allow its deletion until it (the server) is sure the client knows about it? [That's one hellacious sentence!] (;-) Greg - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, September 28, 2000 4:49 PM Subject: [REBOL] pop question Re: Actually, neither will happen they way you have specified it. This is because you have called REMOVE which will only remove the first element (use CLEAR). But to answer the real question: bag: open pop://user:[EMAIL PROTECTED] length? bag == 5 and DO NOT close it while my program runs for, say, 10 minutes. If the server receives 3 more messages for me during that time and I then do: CLEAR bag ; !! note, CLEAR removes all items, REMOVE does one close bag All 5 items will be removed and the next time you check your mail you will have the 3 new messages. It's easy to check since you can mail yourself some messages while you have the port open and I strongly suggest you do this for two reasons. One, understanding usually comes better through doing than hearing and two, you will prove that is DOES work like this and will not worry that you got the wrong info from somebody else (like me). And I don't want to responsible for lost email in case the server you access is totally weird. :) Sterling For you email gurus out there: I open an email port like this: bag: open pop://user:[EMAIL PROTECTED] length? bag == 5 and DO NOT close it while my program runs for, say, 10 minutes. If the server receives 3 more messages for me during that time and I then do: remove bag close bag Will only the original 5 messages be removed from the server or, since the port was left open, will all 8 of the messages be removed from the server. (with me never knowing about the last 3.) Greg Coughlan
[REBOL] pop question Re:(4)
Yep, that was the question. Your explanation makes a whole lot more sense and appears to be a lot simpler to implement than what my question proposed. Good, clear explanations of details like this are hard to come by. I guess that not too many of us would be fooling around in that area without Rebol providing tools that make it relatively easy. (I'm supposed to be a Tech Writer -- maybe I'll write about it when I learn more.) (;-) I'm trying to adapt some of Carl's FAQ code into a View email reader. I've had some success, but am now hung up trying to decypher his "Slider" implementation. (It says I'm trying to "divide by zero" -- I'll ask some questions about it when I understand it well enough to formulate them.) Thanks, Greg Coughlan - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, September 28, 2000 6:49 PM Subject: [REBOL] pop question Re:(3) No problem. If I understand you last question correctly, it means something like this: How doe the server insure that the client only deals with the currently delivered emails while it has the box open? If that's the question, the answer is that I don't know all the specifics. However, from messing around with the POP protocol and watching my mailbox at the same time, I've noticed that the server does not deliver new messages to you mailbox (a simple file) until the mailbox is closed. It keeps the incoming mail in it's spool, a temp file, or some such place until it is safe to deliver. It also, as I recall, removes the mailbox file while you have it open. so when you open the mailbox and then go look for the file on the server, it actually appears empty on the server though you are reading a bunch of messages on the client side. I figure this is to protect the system from mailbox edits while the box is open... could royally mess things up. If I'm incorrect anywhere here or somebody knows all the nifty details, feel free to correct and/or add. Sterling Thanks Sterling, I will perform the suggested testing -- I wouldn't want to turn something loose that mucks around in someone's mailbox until I was sure it was bulletproof AND that I understood exactly how it worked. I went back and checked the docs on "remove" and "clear"-- you're right (of course!), I remembered them wrong. Thanks for "clearing "things up. (;-) If you know, does the server somehow flag an individual message as to whether the client has been informed of its presence in the mailbox; and not allow its deletion until it (the server) is sure the client knows about it? [That's one hellacious sentence!] (;-) Greg - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, September 28, 2000 4:49 PM Subject: [REBOL] pop question Re: Actually, neither will happen they way you have specified it. This is because you have called REMOVE which will only remove the first element (use CLEAR). But to answer the real question: bag: open pop://user:[EMAIL PROTECTED] length? bag == 5 and DO NOT close it while my program runs for, say, 10 minutes. If the server receives 3 more messages for me during that time and I then do: CLEAR bag ; !! note, CLEAR removes all items, REMOVE does one close bag All 5 items will be removed and the next time you check your mail you will have the 3 new messages. It's easy to check since you can mail yourself some messages while you have the port open and I strongly suggest you do this for two reasons. One, understanding usually comes better through doing than hearing and two, you will prove that is DOES work like this and will not worry that you got the wrong info from somebody else (like me). And I don't want to responsible for lost email in case the server you access is totally weird. :) Sterling For you email gurus out there: I open an email port like this: bag: open pop://user:[EMAIL PROTECTED] length? bag == 5 and DO NOT close it while my program runs for, say, 10 minutes. If the server receives 3 more messages for me during that time and I then do: remove bag close bag Will only the original 5 messages be removed from the server or, since the port was left open, will all 8 of the messages be removed from the server. (with me never knowing about the last 3.) Greg Coughlan