view MoinMoin/script/xmlrpc/ @ 5829:a744f573fe30

advancedsearch: fix problem with non-ascii chars breaking up words for OR and NOT terms
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sat, 04 Feb 2012 16:52:24 +0100
parents a20de9383481
line wrap: on
line source
# -*- coding: iso-8859-1 -*-
MoinMoin - MailImport script

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

import sys
import xmlrpclib

from MoinMoin.script import MoinScript, fatal

input = sys.stdin

class PluginScript(MoinScript):
This tool allows you to import mail into the wiki.

Detailed Instructions:
General syntax: moin [options] maint mailimport [mailimport-options]

[options] usually should be:
    --config-dir=/path/to/my/cfg/ --wiki-url=

[mailimport-options] see below:
    0. Verify that you have a configuration file.

    1. To import mail from the file '/mymail'
       moin ... xmlrpc mailimport << /mymail
       cat /mymail | moin ... xmlrpc mailimport

    def __init__(self, argv, def_values):
        MoinScript.__init__(self, argv, def_values)

    def mainloop(self):
            import mailimportconf
        except ImportError:
            fatal("Could not find the file Maybe you want to use the --config-dir=... option?")

        secret = mailimportconf.mail_import_secret
        url = mailimportconf.mail_import_url

        s = xmlrpclib.ServerProxy(url)

        result = s.ProcessMail(secret, xmlrpclib.Binary(

        if result != "OK":
            print >> sys.stderr, result