r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[!REBOL3 Schemes] Implementors guide

Graham
16-Jan-2010
[1603]
sounds like grandiose ideation !  :)
Maxim
16-Jan-2010
[1604x4]
no its how every other platform does it.
using tools like SWIG.
I want to do it using REBOL end-to-end.
and since the C analyser has a programable emitter, you will be able 
to customize what it does.
Graham
16-Jan-2010
[1608]
What's the ETA for this?  Knowing that you start university this 
week ...
Maxim
16-Jan-2010
[1609x2]
honestly I don't know, but its a funded project overall, so it is 
my current job.  which means it will happen for sure.


I would love to have some usefull OpenGL stuff working in february.
one reason I'm doing Sea (the C converter) is that for each new improvement 
of extensions, we will be able to update our tools with a single 
rebuild of the extension. for large libs this is going to be a big 
deal.
Graham
16-Jan-2010
[1611]
is the funding contingent on delivery ? :)
Maxim
16-Jan-2010
[1612]
well, usually, you get paid to get things done.  but this is an ongoing 
project.  It also has other libraries I must import which I can't 
talk about right now, but which might be very interesting for the 
community.
Graham
17-Jan-2010
[1613x3]
As I said above I don't use imap, and am not familiar with the protocol. 
 All this does is login using auth=login and grabs the first mail 
in the Inbox
http://rebol.wik.is/Rebol3/Schemes/Imap4
I don't parse any of the message flags etc.
Ok, what do we need for imap?  ( although I suspect doing all these 
email schemes is a waste of time without ssl ) ...
Andreas
17-Jan-2010
[1616]
for developing, stunnel will help with immediate ssl issues
Maxim
17-Jan-2010
[1617]
ssl AFAIK is under the protocol, so even with an SSL module, the 
schema should not really change.
Graham
17-Jan-2010
[1618x3]
stunnel adds transparency ... I guess
anyone got a how to on using stunnel ?
The r2 imap protocol is pretty basic ... so I don't see that we need 
do more than that ....except perhaps allow users to pass custom commands 
to the server.
Andreas
17-Jan-2010
[1621]
stunnel -cf -P '' -d sourceport -r targethost:targetport
Graham
17-Jan-2010
[1622]
thanks
Andreas
17-Jan-2010
[1623x3]
-c is for client mode, i.e. so that stunnel will connect to a server

-f is so that stunnel stays in the foreground (and you see debug 
output)

-P '' is to avoid creating a pid file (dunno if that is necessary 
on win32 stunnels)
-d sourceport tells stunnel to listen on sourceport
-r targethost:targetport to forward data to this target
re imap: i don't think that much of anything is necessary for imap 
atm. once i'm satisfied with the pop protocol, adapting it to imap 
will be quick and easy
the more interesting questions would be about a satisfying user interface. 
mostly how to wrap imap folders nicely in something that feels natural 
in rebol
Graham
17-Jan-2010
[1626]
at present I think you have to specify the folder you want to open 
in the url for r2
Graham
18-Jan-2010
[1627]
Since FTP, andIMAP have folder structures, I propose that we use 
cd, ls, pwd etc for those schemes that support this.  This is no 
different to the lookup that is done by read, write, length? etc
BrianH
18-Jan-2010
[1628x2]
Won't work without native changes to CHANGE-DIR, which calls the 
OS change directory function in the host code. In R3 the current 
directory is real on platforms that have a current directory (i.e. 
not WinCE), not faked like on R2.
Such changes to CHANGE-DIR could break R3 rather thoroughly.
Graham
18-Jan-2010
[1630x2]
Why?  All it does is check the port type first ...
and if it's not a file!, then check the scheme to see if there is 
an actor defined.
BrianH
18-Jan-2010
[1632]
Um, no, ports aren';t supported at all, just file! types. You can't 
even use file:// urls.
Graham
18-Jan-2010
[1633]
well, still can't see that the issue is not insurmountable .. but 
we can define 'cd, 'pwd, 'ls, 'rm etc to what needs to be done.
BrianH
18-Jan-2010
[1634x3]
You could redefine the file and dir schemes in the host code to a 
virtual file system. It would be easier to have the operating system 
mount the urls to the filesystem, at least on Windows, OS X and *nix.
The trick is that the file and dir schemes are defined to be relative 
to the OS current directory, so you can't separate the two.
It would break CALL too.
Graham
18-Jan-2010
[1637]
cd: func [ d [file! port!]
[
	either file? d [
		change-dir d
	][
		; look if supported cd method in actors, and execute it
	]
]
BrianH
18-Jan-2010
[1638]
It doesn't matter, since the only thing about CD that matters is 
changing PWD, and PWD has to be the OS current directory for R3 to 
work. However, what "the OS current directory" means is defined in 
the host code.
Graham
18-Jan-2010
[1639]
rebol doesn't seem to have a concept of a currernt directory as in 
windows ... where you can keep a directory for each volume mounted
BrianH
18-Jan-2010
[1640x3]
You are thinking R2. R3 does have a current directory.
The only thing about PWD that matters at all is relative filenames, 
and those are handled by native code, not mezzanine. But most of 
that native code is in the host since it's platform-specific.
Afaik, the R3 current directory is process-specific and is only one, 
not one per drive.
Graham
18-Jan-2010
[1643x3]
http://rebol.wik.is/Rebol3/Schemes/Imap4
Updated to version 0.0.2 
Logs into Imap server using cram-md5 if available
Switches to inbox
gets inbox status for unseen messages
Retrieves the first 3 messages
As Andreas notes, a write to the port inside the awake handler is 
fine .. but outside the handler, you have to do a wait on the port 
to do anything.

Also i found that without using a timeout value, it doesn't work 
for me 

So, I removed the 'read cmdport from write-cmdport function, and 
put the wait instead in the actor 'read ...
with a timeout
Graham
19-Jan-2010
[1646x7]
I've got the imap protocol to the point where
1. can authenticate using cram-md5 ( reused r2 code )

2. can select different mailboxes ( unlike r2 where you have to select 
at time of opening the port )
3. length? 
4. Pick messages

However, I don't like this timeout which is there ..
2010.01.19 22:43:38 LOG5[4624:1256]: stunnel 4.29 on x86-pc-mingw32-gnu 
with OpenSSL 0.9.8l 5 Nov 2009

2010.01.19 22:43:38 LOG5[4624:1256]: Threading:WIN32 SSL:ENGINE Sockets:SELECT,IPv6

2010.01.19 22:43:38 LOG5[4624:5260]: No limit detected for the number 
of clients

2010.01.19 22:43:38 LOG3[4624:5260]: Error binding imaps to 0.0.0.0:993

2010.01.19 22:43:38 LOG3[4624:5260]: bind: Permission denied (WSAEACCES) 
(10013)

2010.01.19 22:43:38 LOG3[4624:5260]: Server is down
using run as admin
time to read the manual :(
I thought yahoo had free imap service .. but can't find it now :(
Nope ... not free.
Looks like AIM still has free IMAP ... signing up again!