[REBOL] Re: IMAP bug fix?
From: gscottjones:mchsi at: 13-Dec-2002 1:57
Hi, Graham,
From: "Graham Chiu"
> There's a bug with the IMAP protocol.
>
> If you try and open/close twice in the same session, it
> dies as it tries to open a non existent mailbox.
>
> Eg. first open INBOX, and close INBOX, then open INBOX
> again, and it actually tries to open INBOXINBOX instead ..
> which doesn't exist.
>
> This seems to fix it ... but perhaps others can test it
> out as well:
>
> In the open: function
>
> Change the line:
>
> if port/target [append path port/target]
>
> to
>
> if port/target [path: port/target]
As you know, I am currently a "have not" in the REBOL SDK world. :(
However, I can still poke around under the hood (bonnet) of REBOL/View. :)
In View 1.2.8, the pertinent code in open in imap is:
path: any [port/path ""]
if port/target [append path port/target]
and path is a local value, and presumably the value is not saved between
calls. This leads me to suspect that the "another" bug may lie elsewhere.
My "concern" with your patch is that information passed for some users
through port/path would be lost. A conceivably more durable approach
(albeit more wordy) may be:
if not parse path compose/deep [any [(port/path)] any [(port/target)]]
[append path port/target]
Assuming I wrote this correctly, it should check to see if the port/target
has previously been appended to path. If no one complains about your patch,
then no worries. However, if problems do arise when both port/path and
port/target infomation is needed, my suggestion may help.
I have no imap email accounts, so I have no way to further investigate nor
help debug. :)
--Scott Jones