[REBOL] Re: catching the error with 'import-email?
From: mario:cassani:icl at: 4-Dec-2001 14:28
Hi Pekr,
> commenting myself :-) Once I write data manually to mailbox
> file, and then read it
> back using 'pop protocol, 'import-email works. What is the
> difference? Looking at
> pop scheme, I can't find out, what is the difference, as we
> are talking the same
> string :-)
>
> Well, as Rebol doesn't support locking files, it is very
> dangerous for me to work
> directly with mailbox file, as 'remove on pop port could
> corrupt the file, if
> another Rebol process would try to append new email at the
> end ... or so I think
> ...
I am actually working on a mailer and, to test without
nagging the pop3 server, I use:
fake-email: import-email read %message####.txt
where message####.txt is a file used to "store" the full
mail message as it was on the pop3 server:
box: open pop://user:[passwd--pop--server--net]
msgnumb: 1
while [not tail? box] [
msgfull: first box
; ****** You don't need this
; msg: import-email msgfull
write to-file rejoin ["message" msgnumb ".txt"] msgfull
box: next box
msgnumb: msgnumb + 1
]
or, even better, you can copy the mailbox in its actual
state
(untested):
box: open pop://user:[passwd--pop--server--net]
while [not tail? box] [
msgfull: first box
write/append %mailbox.txt msgfull
box: next box
]
Hope this helps
Mario Cassani