Replying to myself in case anyone is interested in the answer to my problems... Tim Hicks said:
Nope, I don't have a reference to a persistent object. I'm looking at the code in smtpserver.SMTPServer and trying to figure out what I need to adjust. As far as I can tell, the only point in that code at which a 'link' to zope/zodb objects is made is in the following call in SMTPChannel.process_message:
handle(self.server.module, request, response)
My immediate problem is that I don't understand how the result of this call gets dealt with. It just seems to get discarded in the smtpserver code. If this is the way to interact with the publisher, how do I get hold of the return value?
I'm assuming that by adjusting the REQUEST['PATH_INFO'] value before calling handle(), I can affect which ZODB object/method gets called, but I want to know the result of this call.
The REQUEST['PATH_INFO'] part is correct: that is how you determine which method gets traversed to and called. I discovered that you get hold of the return value from this method by passing a callback method into the response constructor. This gives you access to whatever arguments you arrange to have the callback called with *plus* the response object, which you can use to have a look at status codes etc. cheers, tim