Ruby Ezmlm

This module provides a programmatic interface to ezmlm-idx lists, their archives, and the command line utilities that interact with them.

High-Level Features

The library is intended to provide two sets of functionality: the management and setup of lists, and programmatic access to the message archive.

Manage Lists

  • create/delete a list
  • configure list
    • options
    • owner
    • templates
  • subscribers
  • moderators
  • .qmail file config (?)
  • extra flags for ezmlm binaries (?)

Message Archive

  • Fetch a list of subject
  • Fetch a list of threads
  • Fetch a list of authors
  • Fetch message bodies by message id
  • Fetch message headers by message id
  • Fetch various items of archive metadata
    • last post date
    • last post author
    • last post subject
    • message count
  • message searching/full-text indexing

Design Ideas

I would anticipate using this like so:

require 'pathname'

LISTSDIR = Pathname.new( '/var/qmail/alias/lists' )

Ezmlm.each_list( LISTSDIR ) do |list|
end

# Create an object that will provide the interface to the 'announcements' list
announcelist = Ezmlm::List.new( LISTSDIR + 'announcements' )

# Create a mailing list and modify the configuration for it
announcelist = Ezmlm::List.create( LISTSDIR + 'announcements' ) do |config|
    config.archived = true
    config.blocked  = true
    config.guard    = true
    config.kill     = true
    config.prefix   = 'ANNOUNCEMENT! '
end

# Fetch the list of subscribers to the list
subscribers = announcelist.subscribers

# Fetch the list of moderators to the list
moderators = announcelist.moderators

# Fetch the list of the subjects of all posts to the list
subject_idx = announcelist.subject_index
subjects = announcelist.subjects

# Fetch the Hash of message threads and their corresponding messages from the archive
thread_idx = announcelist.thread_index
threads = announcelist.threads

# Fetch the list of every author that has posted to the list and the messages that they've posted
author_index = announcelist.author_index
authors = announcelist.authors

# Fetch a message body by message id
message = announcelist[ 'ppbhckhnjglcocfaaocc' ]
message = announcelist.fetch( 'ppbhckhnjglcocfaaocc' )

# Fetch a message's header by message id
message = announcelist.fetch_header( 'ppbhckhnjglcocfaaocc' )

# Fetch different bits of archive metadata
announcelist.last_post_date
announcelist.last_post_author
announcelist.last_post_subject
announcelist.message_count