=meta link_base /~richardc/talks/siesta

# 100 while writing, 1 when released

=meta consider_old 100

=head1 Siesta, some assembly required

=head2 Bits and pieces

=over

=item

L<image:Whiteboard|whiteboard.jpeg>

=back

=head2 So what is it?

=over

=item

MLM

=item

In Perl

=item

Yes, that's a bad idea.

=back

=head2 Defining features

=over

=item

Modular

=item

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,
        );

=item

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

=item

Plugin based

=back

=head2 Modular

=over

=item

Siesta comprises twenty-nine modules, and two scripts

=item tequila

inject the mail into the system

=item nacho

lots of little bits.  commands line control tool

=item webfrontend

TT + Template::Plugin::Siesta

=back

=head2 How it works

=over

=item

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

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

=item 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
 ...

=back

=head2 That's all folks

=over

=item

L<image:That's all folks|porky.jpg>

=item

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

=back

=head2 The Pipeline

=over

=item

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};
     }
 }

=back

=head2 Plugin::SubjectTag

=over

=item

 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__

=back

=head2 We already have many plugins

=over

=item MembersOnly

Reject/defer non-member posts

=item ListHeaders

Adds RFC2919 and RFC2396 headers

=item Archive

Saves messages to a maildir

=item SimpleSig

Rejects mails with overly long signatures

=item ReplyTo

Munges the Reply-To header to be the list address

=item Send

Dispatches the mail to subscribers

=back

=head2 ReplyTo

=over

=item

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

=item

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.

=back

=head2 Per-user per-list configuration

=over

=item

L<image:wuh?|ellen.jpeg>

=item

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

=back

=head2 Personalisation Pipeline

=over

=item

The Send plugin is special

=item

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

=item

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

Just for you.

=back

=head2 You know what that means 

=over

=item

L<image:Big American Party!|discodude.jpg>

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

=item

Per-user Reply-To munging.

=back

=head2 Unseen

=over

=item

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

=item nacho

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

=item webfrontend

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

=item configuration

=item storage

=item

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

=back

=head2 Questions?

=over

=item

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

=item

Sweet.  What does mine say?

=item

Why do things always come in threes?

=back

=head1 Footer

Siesta, some assembly required.  E<copy> 2003 Richard Clamp
