[Zope-dev] connecting server code to the ZODB
fg at nuxeo.com
Fri Nov 5 09:34:06 EST 2004
In article <218.104.22.168.74.1098977827.squirrel at 22.214.171.124> you write:
> I'm trying to figure out how to adjust Nikolay Kim's smtpserver code
> <http://cvs.sourceforge.net/viewcvs.py/collective/smtpserver/> so that
> objects within the ZODB can affect the way that messages are received
> (i.e. veto messages based on certain criteria in the first instance).
> My problem is that I don't quite know how to get hold of the ZODB objects.
> As far as I can tell, Nikolay's
> smtpserver.SMTPServer.SMTPChannel.process_message method uses
> ZServer.PubCore.handle to make the connection, but I don't really
> understand how this all works.
> What I really want to be able to do from the server code is something like::
> root = magic_that_gets_me_zodb_root()
That magic is basically (from memory):
root = Zope.app()
But note that starting up a zope is slow, so you don't want to do that
> account_manager = root['Control_Panel']['AccountManager']
> I want calls like that to checkAccepts(msg) to be made a several points in
> the SMTP session - say after each of the SMTP commands RCPT, MAIL, DATA,
> etc. I only mention that in case there are implications for some
> transaction jiggery-pokery (although I don't expect any of the
> checkAccepts() type calls to need to write to the ZODB).
> Any pointers much appreciated.
> Zope-Dev maillist - Zope-Dev at zope.org
> ** No cross posts or HTML encoding! **
> (Related lists -
> http://mail.zope.org/mailman/listinfo/zope )
Florent Guillaume, Nuxeo (Paris, France) CTO, Director of R&D
+33 1 40 33 71 59 http://nuxeo.com fg at nuxeo.com
More information about the Zope-Dev