view MoinMoin/xmlrpc/ @ 2374:629dea07759f

do not parse single-quoted page names as quoted fixes bugs with ['text_html'] being a link
author Johannes Berg <johannes AT sipsolutions DOT net>
date Thu, 12 Jul 2007 14:40:06 +0200
parents bb2e053067fb
children ea5383222f2f
line wrap: on
line source
# -*- coding: iso-8859-1 -*-
    MoinMoin - This plugin is used for multi-tier mail processing

    @copyright: 2006 MoinMoin:AlexanderSchremmer
    @license: GNU GPL, see COPYING for details.

from MoinMoin.mail import mailimport

def execute(xmlrpcobj, secret, mail):
    request = xmlrpcobj.request
    secret = xmlrpcobj._instr(secret)
    mail = str(mail)

    if not request.cfg.mail_import_secret:
        return u"No password set"

    if request.cfg.mail_import_secret != secret:
        return u"Invalid password"

        mailimport.import_mail_from_string(request, mail)
    except mailimport.ProcessingError, e:
        err = u"An error occured while processing the message: " + str(e.args)
        return xmlrpcobj._outstr(err)
    return xmlrpcobj._outstr(u"OK")