view MoinMoin/xmlrpc/ @ 5298:d57b74bc4cbd

formatter: text_html comment moved to docstring
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Fri, 20 Nov 2009 09:49:05 +0100
parents e5a9570d3001
children b397401dda7f
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 import log
logging = log.getLogger(__name__)

from MoinMoin.mail import mailimport

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

    if request.cfg.secrets['xmlrpc/ProcessMail'] != 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")