Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

pop question

 [1/4] from: gregco:pressroom at: 28-Sep-2000 15:06


For you email gurus out there: I open an email port like this: bag: open pop://user:[pass--email--com] 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

 [2/4] from: sterling::rebol::com at: 28-Sep-2000 13:49


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:[pass--email--com] 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

 [3/4] from: gregco:pressroom at: 28-Sep-2000 18:35


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

 [4/4] from: sterling:rebol at: 28-Sep-2000 15:49


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