[REBOL] Re: POP and SMTP servers for yahoo accounts?
From: deadzaphod:flyingparty at: 28-Aug-2001 6:22
I just took a look through the POP RFC (1725) to see how to deal with this.
Here's a couple of functions to help (there's another feature that could be
used for detected whether or not you already have a given message, but it
would be more complex to add)
; like 'first on a pop port, but only gets the specified number of lines
after the header
pop-top: func [ port lines ] [
insert port/sub-port rejoin [ "TOP " pick port/locals/msg-nums
port/state/index + 1 " " lines ]
net-utils/confirm port/sub-port [ none "+OK" ]
port/handler/read-til-dot port make string! 1024
]
; the same as [ length? first port ] for a pop port, but doesn't download
pop-size: func [ port ][
pick (extract next port/locals/sizes 2) port/state/index + 1
]