[Twisted-Python] mail and web server authentication: yet to come or already there?
Hello all, I am a new Twisted (and Python) user and first of all I would like to thank you for the great software. I love the architecture and I am sure I will learn a lot from looking at how it is implemented. I would like to use twisted as an integrated mail/web server, in order to do some stuff like what I've done here [1]. I think I need to develop some minor but useful stuff that I will then post here so you can all see how bad my python coding is :-) for example, I am working to make the POP3 server compatible with mozilla... One thing that is puzzling me is the twisted.cred stuff, even after reading all about it in the docs it is still not clear to my dummy self how to put it to use in order to restrict access on the twisted.web service (is HTTP basic auth implemented somewhere btw?) and also I don't understand why it is not used for access control to the twisted.mail services. Simply a matter of time or is it really meant for other types of authentication? Some more examples in this very sensitive area for people not using PB would help a lot.... One very small and probably already screwing-up-things contribution that I can do now is to the SMTP class, I include herewith my first attempt at using the diff utility: $ diff cvs/Twisted/twisted/protocols/smtp.py cvs/Twisted/twisted/protocols/smtp.py_orig 137c137 < to = rest[string.find(rest, "<")+1:-len(">")] ---
to = rest[len("TO:<"):-len(">")]
After modifying that, I was able to send mail using Blat [2]. I am unfortunately locked on a win$ platform for my development so many things are unnecessarily difficult, like getting C stuff to compile without having visual studio installed for instance. Is this dependancy on the m$ compiler anything unavoidable when doing python? Please forgive if that's a stupid question, I am new to this very cool language and had a very hard time getting SSL to work even though it was stated it would build with borland or cygwin compilers: I read somewhere in the twisted archives that some guy promised to write a walkthrough for that, did that ever happen :-) ? Oops the very last is this one: are ALL tests supposed to work out-of-the-box (apart from those needing the crypto lib)? When I run them the UI crashes... :-( Alright I'll stop my whining here for now and thank you very much for reading so far and providing this great framework, ciao ste p.s. aha here I go again: no way for me to access the IRC channel (lucky you :) as my provider seems to be blocking the identd stuff :-((( what happened to [3]? [1] http://webaccess.mozquito.com:8080/mail/schnitz/how-to/174073468805351802.xm... [2] http://www.interlog.com/~tcharron/blat.html [3] http://www.twistedmatrix.com/users/pb.twistd/
On Wed, Nov 20, 2002 at 09:42:08PM +0100, Stefano Debenedetti wrote:
One thing that is puzzling me is the twisted.cred stuff, even after reading all about it in the docs it is still not clear to my dummy self how to put it to use in order to restrict access on the twisted.web service (is HTTP basic auth implemented somewhere btw?) and also I don't understand why it
I *think* twisted.web.guard has this functionality... I've heard it's going to be overhauled at some point, it's not as nice as it could be.
is not used for access control to the twisted.mail services. Simply a matter of time or is it really meant for other types of authentication?
I'm even less of a twisted.mail expert than a twisted.web expert, but I think that twisted.mail's auth stuff predates twisted.cred, and we haven't had time to migrate it to twisted.cred yet.
Some more examples in this very sensitive area for people not using PB would help a lot....
Indeed. Our docs are slowly improving, but still quite lacking. If you or anyone can contribute any, that would be great!
One very small and probably already screwing-up-things contribution that I can do now is to the SMTP class, I include herewith my first attempt at using the diff utility:
$ diff cvs/Twisted/twisted/protocols/smtp.py
[We prefer "diff -u ...."; the output is much more readable.]
cvs/Twisted/twisted/protocols/smtp.py_orig 137c137 < to = rest[string.find(rest, "<")+1:-len(">")] ---
to = rest[len("TO:<"):-len(">")]
After modifying that, I was able to send mail using Blat [2].
Hmm. That looks like a dubious change to me. Wouldn't that fail for headers like: To: Mr. Example <dude@example.com> I'm not familiar with smtp.py though...
I am unfortunately locked on a win$ platform for my development so many things are unnecessarily difficult, like getting C stuff to compile without having visual studio installed for instance. Is this dependancy on the m$ compiler anything unavoidable when doing python? Please forgive if that's a
Well... 1. Twisted doesn't require any C modules to be compiled -- they're basically just optional speed-ups. In fact the only C module in Twisted that works on Windows is cBanana; cReactor and portmap don't apply to Windows because it doesn't have the relevant APIs. 2. I've heard it's possible to use the mingw port of gcc to compile python extensions... search comp.lang.python or google for details.
Oops the very last is this one: are ALL tests supposed to work out-of-the-box (apart from those needing the crypto lib)? When I run them the UI crashes... :-(
Eek. The UI shouldn't crash, but regardless usually I use "runtests -t", i.e. run in text mode. Unfortunately Win32 support isn't 100% -- which tests are failing for you?
Alright I'll stop my whining here for now and thank you very much for reading so far and providing this great framework, ciao
Thanks :) -Andrew.
participants (2)
-
Andrew Bennetts
-
Stefano Debenedetti