[REBOL] Re: Email Headers ?
From: didec:tiscali at: 20-Feb-2004 13:32
Re: Email Headers ?
Unfortunately, you will not find this in the doc, as Rebol standard POP protocol doesn't
handle reading part of a message.
But here is a simple code than show you how to do it by yourself.
;--- Will receive the header objects
emails: copy 
;--- open your mailbox
mb: open pop://user:[pass--pop--server-name]
;--- point on [message-num size-of-message] pairs
;--- for each message-num and size
foreach [mesg-num size] sizes [
;--- Here we insert "manually" the command not handled by the standard pop:// protocol
; First send the request
insert mb/sub-port rejoin ["TOP " pick mb/locals/msg-nums mb/state/index + mesg-num "
; second, wait for the correct answer
net-utils/confirm mb/sub-port [ none "+OK" ]
; then pick in the answer received the message header without the content
headers: mb/handler/read-til-dot mb make string! 1024
;--- Append to the msg block the email object obtained from the string header form
append emails import-email headers
;--- The result
Hope it helps