view MoinMoin/xmlrpc/ @ 1004:7828d27399d4

whitespace-only cleanup and minor style changes
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sat, 22 Jul 2006 13:43:06 +0200
parents f158c4e8fea2
children bb2e053067fb
line wrap: on
line source
# -*- coding: iso-8859-1 -*-
    MoinMoin - This plugin is used for multi-tier mail processing

    @copyright: 2006 by 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")