[Mailman-Developers] Ideas for injecting test messages

Barry Warsaw barry at list.org
Wed Feb 25 17:06:54 CET 2015


On Feb 25, 2015, at 10:04 AM, Andrew Stuart wrote:

>I want to inject some test messages into Mailman to test moderation functions
>via the REST API.
>
>Any ideas on a simple way to do that?

I think you found the command line interface for injecting messages, but you
can also do it via the REST API.  Do a POST to <api>/queues/<queuename>
providing a list_id for the mailing list the message is targeting, and the
text of the message you want to inject.

>Ideally I need to be able to clear them out somehow too.

Do a GET on <api>/queues/<queuename> to get a list of all files in that
particular queue.  The `files` key will contain a list of "filebases" and you
can delete that file from the queue by DELETEing
<api>/queues/<queuename>/<filebase>.

You also get the filebase back in the Location header of the POST response.

Currently you cannot get the text or other information for a queue file
through the REST API.  I would welcome contributions for a GET on
<api>/queues/<queuename>/<filebase>.

Cheers,
-Barry


More information about the Mailman-Developers mailing list