package Siesta::Plugin::OwnerOnly; use strict; use Siesta::Plugin; use base 'Siesta::Plugin'; sub description { "reject posts from everyone except list owner"; } sub process { my $self = shift; my $mail = shift; my $list = $self->list; return if $mail->from eq $list->owner->email; return if grep { $mail->from eq $_ } split ' ', $self->pref('allowed_posters'); $mail->reply( to => $list->owner->email, from => $list->return_path, body => Siesta->bake('owner_only_dropped', list => $list, mail => $mail) ); return 1 unless $self->pref('tell_user'); my $extra = ''; $mail->reply( from => $list->return_path, body => Siesta->bake('owner_only_held', extra => $extra ) ); return 1; } sub options { +{ 'tell_user' => { description => "should we tell the user if their post is rejected/delayed", type => "boolean", default => 0, }, 'allowed_posters' => { description => "people allowed to post who aren't on the system", type => "string", default => "", }, }; } 1;