Siesta, some assembly required

Bits and pieces

Whiteboard

So what is it?

MLM

In Perl

Yes, that's a bad idea.

Defining features

Modular

Dependencies up the wazoo

 my $build = Siesta::Build
   ->new( module_name => "Siesta",
          license     => 'perl',
          scripts     => [ 'bin/tequila', 'bin/nacho' ],
          requires    => { 'Test::More' => 0,
                           'Test::MockObject' => 0,
                           'Class::Accessor::Fast' => 0,
                           'Mail::Address' => 0,
                           'Email::Simple' => '1.4',
                           'Email::LocalDelivery' => '0.02',
                           'DBD::mysql' => 0,
                           'Class::DBI::BaseDSN' => 0,
                           'Class::DBI::mysql' => 0, # for live
                           'Class::DBI::SQLite' => 0, # for test
                           'File::Path' => 0,
                           'File::Basename' => 0,
                           'File::Find::Rule' => 0,
                           'UNIVERSAL::require' => 0,
                           'Template' => 0,
                           'Digest::MD5' => 0,
                           # Module::Build 0.18 is the first release with
                           # working scripts shebang rewriting
                           'Module::Build' => '0.18',
                           'Tie::IxHash' => 0,
                           'Storable' => 0,
                           'Log::LogLite' => 0.
                         },
          dynamic_config => 1,
          sign => 1,
        );

But that's okay, because CPANPLUS loves that kind of thing.

Plugin based

Modular

Siesta comprises twenty-nine modules, and two scripts

tequila

inject the mail into the system

nacho

lots of little bits. commands line control tool

webfrontend

TT + Template::Plugin::Siesta

How it works

mail arrives at the system, and gets funelled into the system with standard MTA juju.

 siesta-dev:       "|/usr/local/bin/tequila post siesta-dev"

cat /usr/local/bin/tequila

 #!/usr/bin/perl -w
 use strict;
 use Siesta;
 
 use constant debug => 1;
 
 eval {
     Siesta->new->process( action => $ARGV[0], 
                           list   => $ARGV[1], 
                           mail   => \*STDIN );
 };
 
 if ($@) {
     # let the MTA know we're deferring.
     print $@ if debug;
     exit 20;
 }
 __END__
 =head1 NAME
 ...

That's all folks

That's all folks

Okay, there might be something more to it that that.

The Pipeline

Siesta::process is this:

 sub process {
     my $self   = shift;
     my %args   = @_;
     my $action = $args{action} || 'post';
     my $mail   = Siesta::Message->new( $args{mail} );
     my $list   = Siesta::List->load( $args{list} );
     $self->log("processing $action", 1);
     for my $plugin ( $list->plugins($action) ) {
         # SIESTA_NON_STOP is used by 20fullsend.t to ensure
         # excercising of everything. it means "run the next plugin,
         # even if the last one said to stop"
 
         return if $plugin->process($mail) && !$ENV{SIESTA_NON_STOP};
     }
 }

Plugin::SubjectTag

 package Siesta::Plugin::SubjectTag;
 use strict;
 use Siesta::Plugin;
 use base 'Siesta::Plugin';
 sub description {
     'add [list.id] to subject lines';
 }
 sub process {
     my $self = shift;
     my $mail = shift;
     my $subject = $mail->subject || 'no subject';
     my $list_name = $self->list->name;
     $mail->subject("[$list_name] $subject")
       unless $subject =~ /\[$list_name\]/;
     return;
 }
 1;
 __END__

We already have many plugins

MembersOnly

Reject/defer non-member posts

ListHeaders

Adds RFC2919 and RFC2396 headers

Archive

Saves messages to a maildir

SimpleSig

Rejects mails with overly long signatures

ReplyTo

Munges the Reply-To header to be the list address

Send

Dispatches the mail to subscribers

ReplyTo

We know Reply-To munging is an issue dear to all your hearts.

So much so that Simon wrote this into version 1.0 of the plugin.

 # see :
 #   http://www.unicom.com/pw/reply-to-harmful.html
 #   http://www.metasystema.org/essays/reply-to-useful.mhtml
 #   http://thegestalt.org/simon/replytorant.html
 #   http://www.deez.info/sengelha/writings/considered-harmful/
 # for various for and against arguments thrashed out by the great
 # and the good and for why I don't care. Feel free to argue about
 # this to your hearts content - the monkeys dance for my pleasure.
 #
 # DANCE MONKEYS! DANCE!

And it's still there now.

Per-user per-list configuration

wuh?

Yes, that's what we used to call it, and I was always like wuh? And it was like bleep bleep bleep.

Personalisation Pipeline

The Send plugin is special

It actually likes and listens to you (if your admin lets it)

If there's a personalisation pipeline configured for the list, it will happily run all the Plugins in it.

Just for you.

You know what that means

Big American Party!

That's what you get when you google for "Big American Party!"

Per-user Reply-To munging.

Unseen

I'm not showing you a bunch of stuff today.

nacho

It's a command line interface, it's not overly exciting

webfrontend

TT + Plugin. unfinished. just call on methods in the other classes

configuration

storage

Don't worry, that's what the next slide is for:

Questions?

How many roads must a man walk down, before you can call him a man?

Sweet. What does mine say?

Why do things always come in threes?