Email Headers ?
[1/4] from: pwawood:mango:my at: 20-Feb-2004 18:57
I'm just starting to learn Rebol and would appreciate some advice on
where to look in the documentation to see how to get hold of email
message headers without downloading the message first. As I understand
it, import-email needs the message to be downloaded first.
Peter
[2/4] from: didec:tiscali at: 20-Feb-2004 13:32
Re: Email Headers ?
Hi Peter,
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
sizes: mb/locals/sizes
;--- 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 "
0"]
; 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
probe emails
Hope it helps
DideC
[3/4] from: cybarite::sympatico::ca at: 20-Feb-2004 18:13
Maybe just using Didier's email filter would be a good start.
[4/4] from: pwawood:mango:my at: 21-Feb-2004 7:27
Hi DideC
Your example not only answer my questions it will also help my learning
Rebol. Thank you very much.
Regards
Peter
On Friday, Feb 20, 2004, at 20:32 Asia/Kuala_Lumpur, Didec wrote: