MailmanWiki

Sketch of a REST interface to Mailman

This interface isn't intended to be exposed to the Internet at large, so there's no mention of
access control. It would be used as a back-end, on top of which the existing Mailman interface,
or a fancy GUI application, or administrative scripts, could be built.

Resource Types

Use Cases

user

moderator

owner

Original Use Cases

Principles

We use JSON. Libraries are available for most relevant programming languages and it's reasonably human-readable.

Accept-Language

Also taking the recommendation of Leonard Richardson we will also honor the representation request in the Accept and Accept-Language headers.

Initial Considerations







URL Space

Unless otherwise specified, all these URLs return a data structure encoded as JSON.

URL
Action
/ List all top-level URLS
/sys List all children URLS
/sys/version Return Mailman and Python version (read-only)
/sys/plugins List all plugins (name, description, author, version)
/sys/plugins/<plugin>
Detailed info on a plugin
/stats/ List of statistics available below
/stats/site Show lists by activity (performance, tuning aspects)
/stats/domain Show comparison of lists activity within the same domain
/stats/lists list all lists within the domain
/stats/lists/<list-id> Show list activity (new messages per day, replies to new messages same day)
/stats/users/ * Top Ten Senders
  • Top Ten Contributers
  • Show a list of all users
/stats/users/<username> * Number of posts per site
  • Number of posts per domain
  • Number of posts per list
  • Bounces per mail-address
/users/ List of preferred email-addresses (e-Mail, Full name)
/users/<user-id> All information related to that person
/users/<user-id/<setting> Specific settings related with a person (identity, MIME-settings, Vacation, etc.)
/members/ A list of all members (address, mailinglist, role)
/members/... membership management (moderated, unsubscribe, etc.)
/addresses/ A list of all email-addresses the system knows about
/addresses/<address>
information on an address (when was it validated, link to the user associated with it, etc.)
/lists/ returns list of list-ids (mailing list name, URL, public/private flag) tuples.
/lists/<list-id> lists list homepage info
/list/<list-id>/<setting> Arbitrary <settings> that configure a list
/domains/ List all domains within the site (hostname, web hostname, description, contact address)
/domains/<domain-id>
Manage that domain
/messages/ List of all URLs below
/messages/ids/
A list of all message-ids
/messages/ids/<message-id> Message specific info: Sender, Recipient, Date, Subject, Size
/messages/hashes/
A list of all message-hashes
/messages/hashes/<message-hashes>
List of all message-hashes (see: Stable URLs)
/policies/
General policy for all lists on the site
/policies/domains/ List of domains whose policy differs from the general site policy
/policies/domains/<domain>
A domain specific policy
/policies/lists/
List of lists whose policy differs from the general site policy
/policies/lists/<list> A list specific policy

Initial URL design

Unresolved Questions

Unless the REST interface is designed to replace the Browser interface, it shouldn't expected a user can navigate without error by manufacturing urls, no? In either case /list/mailman-developers/ is preferable for seeing where your current location via the url. 123456 is uninformative. Unless there is some unfailing reason to disallow it there is no reason to disallow names like foo/bar would just be escaped to foo%2Fbar. Another option is to have a urlsafe name generator that replaced unsafe characters with a '-'. then the name 'foo-bar' could be used while preserving readability in the url



Comments

Cliff Ingham

I'm needing to build a standalone webservice for Mailman that our content manager can access. I'm most comfortable in PHP, so it's probably going to be PHP instead of Python.

But it will be needing to support authentication for usage. I'm planning on it just being a wrapper for the command line tools. If folks are interested, I could contribute our code as it goes. All our work here at the City of Bloomington is GPL. Either way, I'd be very interested in seeing a native RESTful interface come with Mailman

MailmanWiki: DEV/REST Interface (last edited 2009-04-01 19:31:03 by reedobrien)