[Zope-CMF] Re: Changing ownership / creator of a CMF document

Raphael Ritz r.ritz at biologie.hu-berlin.de
Fri Jun 11 04:06:08 EDT 2004


Kari-Hans Kommonen wrote:
> How should one change the ownership of a CMF document, or alternatively, 
> create a CMF document for some other user?
> 
> We receive mails with MailBoxer and want the "mail_handler" to create 
> CMF documents from the mails, so the script is run by "Anonymous user".
> 
> What is not clear to me is what actually determines the ownership of a 
> document, and what are all the things one needs to change, and what 
> conditions need to be fulfilled in order to be able to do it, and have 
> as the outcome a CMF document that is in all respects similar to one 
> that the user creates herself on the site.
> 

FYI:
On neuroinf.de we use (a slightly modified version of)
http://www.zope.org/Members/NIP/ZMailIn/
to get postings from selected mailinglists into the news section
of our portal.

The basic idea is to have the mail piped into a python script
that uses Python's urllib to pass it on to the Zope site where
it is "received" by the mailin tool which uses Python's
email module (that was my change to CMFMailIn which had
to use the RFC822 package because the email package was
not yet available at the time CMFMailIn was written) to
parse the mail message and turn it into something "useful",
so that you can than call, e.g., 'invokeFactory' and friends
to create and edit your document/news item.

That way, the user/owner is defined by the way in which
the Python script connects to the Zope server. In our case,
this is done (using qmail; pw changed, of course) the
following way:

[ritz at pitts neuroinf]$ more .qmail-news
| cat >> /home/neuroinf/ZMailInHistory.txt
| /home/neuroinf/CMFMailIn/sendMailToZope.py 
http://neuroinf-news:<secret>@www.neuroinf.de/portal_mailin

For this to work, we have a user called 'neuroinf-news'
(with domain restrictions for better security)
which becomes the owner of the news items created that
way. For later reference, we put the sender of the email in
the 'Contributers' meta data field.

HTH,

	Raphael


> TIA, kari-hans kommonen
> 
> _______________________________________________
> Zope-CMF maillist  -  Zope-CMF at zope.org
> http://mail.zope.org/mailman/listinfo/zope-cmf
> 
> See http://collector.zope.org/CMF for bug reports and feature requests
> 




More information about the Zope-CMF mailing list