[prev] [thread] [next] [lurker] [Date index for 2002/09/10]
Update of /cvsroot/siesta/siesta/lib/Siesta/Plugin In directory usw-pr-cvs1:/tmp/cvs-serv19714/Siesta/Plugin Modified Files: Archive.pm CheckUser.pm Debounce.pm ListHeaders.pm MembersOnly.pm ReplyTo.pm Send.pm SimpleSig.pm SpamAssassin.pm SubjectTag.pm Subscribe.pm UnSubscribe.pm Log Message: perltidy Index: Archive.pm =================================================================== RCS file: /cvsroot/siesta/siesta/lib/Siesta/Plugin/Archive.pm,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Archive.pm 23 Aug 2002 14:26:38 -0000 1.4 +++ Archive.pm 10 Sep 2002 18:23:57 -0000 1.5 @@ -10,15 +10,18 @@ use File::Path; my $sequence = 0; + sub process { my $self = shift; my $mail = shift; my $path = $Siesta::Config::ARCHIVE_PATH . "/" . $mail->list->id; - eval { mkpath( [ map { "$path/$_" } qw( cur new tmp ) ], 0, 0777 ) }; + eval { + mkpath( [ map { "$path/$_" } qw( cur new tmp ) ], 0, 0777 ); + }; my $now = time; $sequence++; - my $file = "$now.$$.$sequence"; + my $file = "$now.$$.$sequence"; my $tmpfile = "$path/tmp/$file"; my $newfile = "$path/new/$file"; Index: CheckUser.pm =================================================================== RCS file: /cvsroot/siesta/siesta/lib/Siesta/Plugin/CheckUser.pm,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- CheckUser.pm 23 Aug 2002 14:26:38 -0000 1.4 +++ CheckUser.pm 10 Sep 2002 18:24:03 -0000 1.5 @@ -1,5 +1,6 @@ # $Id$ package Siesta::Plugin::CheckUser; + # standard includes use strict; use Siesta::Plugin; @@ -13,7 +14,7 @@ address using the heuristics in Mail::CheckUser. Drops the mail if it isn't."; -sub process { +sub process { my $self = shift; my $mail = shift; Index: Debounce.pm =================================================================== RCS file: /cvsroot/siesta/siesta/lib/Siesta/Plugin/Debounce.pm,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Debounce.pm 23 Aug 2002 17:17:35 -0000 1.4 +++ Debounce.pm 10 Sep 2002 18:24:05 -0000 1.5 @@ -10,13 +10,14 @@ my $mail = shift; my $post = $mail->list->post_address; - for my $been ($mail->head->get('X-Been-There')) { + for my $been ( $mail->head->get('X-Been-There') ) { chomp $been; + # have we been here before? return 1 if $been eq $post; } - $mail->head->add('X-Been-There', $post); + $mail->head->add( 'X-Been-There', $post ); return; } Index: ListHeaders.pm =================================================================== RCS file: /cvsroot/siesta/siesta/lib/Siesta/Plugin/ListHeaders.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ListHeaders.pm 23 Aug 2002 17:24:26 -0000 1.2 +++ ListHeaders.pm 10 Sep 2002 18:24:07 -0000 1.3 @@ -9,12 +9,12 @@ my $self = shift; my $mail = shift; - my $list = $mail->list; + my $list = $mail->list; my $list_name = $list->id; my $address = $list->post_address; $address =~ s/@/./; - $mail->head->add('List-Id', "$list_name <$address>"); + $mail->head->add( 'List-Id', "$list_name <$address>" ); return; } Index: MembersOnly.pm =================================================================== RCS file: /cvsroot/siesta/siesta/lib/Siesta/Plugin/MembersOnly.pm,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- MembersOnly.pm 26 Aug 2002 17:34:52 -0000 1.9 +++ MembersOnly.pm 10 Sep 2002 18:24:08 -0000 1.10 @@ -11,8 +11,9 @@ my $mail = shift; return if $mail->list->is_member( $mail->from ); + # I'm not even supposed to be here today. - $mail->reply(body => <<END); + $mail->reply( body => <<END); Hi, Non-member posting is disabled for this list, and you don't @@ -23,6 +24,5 @@ return 1; } - 1; Index: ReplyTo.pm =================================================================== RCS file: /cvsroot/siesta/siesta/lib/Siesta/Plugin/ReplyTo.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- ReplyTo.pm 9 Sep 2002 11:17:08 -0000 1.3 +++ ReplyTo.pm 10 Sep 2002 18:24:10 -0000 1.4 @@ -3,7 +3,8 @@ use Siesta::Plugin; use base 'Siesta::Plugin'; use vars qw/ $DESCRIPTION /; -$DESCRIPTION = "Munges the Reply-To header to the list address, not the person who sent it"; +$DESCRIPTION = + "Munges the Reply-To header to the list address, not the person who sent it"; # see : # http://www.unicom.com/pw/reply-to-harmful.html @@ -16,36 +17,34 @@ # # DANCE MONKEYS! DANCE! - sub process { my $self = shift; my $mail = shift; my $list = $mail->list || undef; + my $post_address = ( defined $list ) ? $mail->list->post_address : undef; + my $munge = $self->config( $mail, 'munge' ) + || $self->options->{munge}->{default}; - my $post_address = (defined $list)? $mail->list->post_address : undef; - my $munge = $self->config($mail,'munge') || $self->options->{munge}->{default}; - - $munge = (defined $post_address)? $munge : 0; + $munge = ( defined $post_address ) ? $munge : 0; - $mail->head->replace('Reply-To', $post_address) if $munge; + $mail->head->replace( 'Reply-To', $post_address ) if $munge; return; } -sub options -{ - return { - 'munge' => { 'description' => 'should we munge the reply-to address of the message to be the list post', - 'type' => 'boolean', - 'default' => 1, - 'widget' => 'checkbox', - } - - }; +sub options { + return { + 'munge' => { + 'description' => + 'should we munge the reply-to address of the message to be the list post', + 'type' => 'boolean', + 'default' => 1, + 'widget' => 'checkbox', + } + }; } - 1; Index: Send.pm =================================================================== RCS file: /cvsroot/siesta/siesta/lib/Siesta/Plugin/Send.pm,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- Send.pm 23 Aug 2002 17:23:20 -0000 1.22 +++ Send.pm 10 Sep 2002 18:24:12 -0000 1.23 @@ -12,12 +12,13 @@ my $mail = shift; my $list = $mail->list; - for my $user ($list->members) { + for my $user ( $list->members ) { my $address = $user->id; print "spamming $address up their stupid ass\n" if debug; local *SENDMAIL; - open SENDMAIL, "|/usr/sbin/sendmail -oi -f ".$list->return_path." $address" + open SENDMAIL, + "|/usr/sbin/sendmail -oi -f " . $list->return_path . " $address" or die "couldn't fork sendmail $!"; $mail->print( \*SENDMAIL ); close SENDMAIL Index: SimpleSig.pm =================================================================== RCS file: /cvsroot/siesta/siesta/lib/Siesta/Plugin/SimpleSig.pm,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- SimpleSig.pm 9 Sep 2002 11:17:08 -0000 1.12 +++ SimpleSig.pm 10 Sep 2002 18:24:13 -0000 1.13 @@ -5,7 +5,8 @@ use vars qw( $DESCRIPTION ); -$DESCRIPTION = 'This is a very simple sig plugin, its probably more useful for testing'; +$DESCRIPTION = + 'This is a very simple sig plugin, its probably more useful for testing'; sub process { my $self = shift; @@ -15,17 +16,18 @@ # some sort of configuration lookup based on list and this plugin name, # however lets just say 5 instead - my $maxlines = $self->config($mail,'maxlines') || $self->options->{maxlines}->{default}; + my $maxlines = $self->config( $mail, 'maxlines' ) + || $self->options->{maxlines}->{default}; my $body = join '', @{ $mail->body() }; - my (undef,$sig) = split /-- \n/, $body, 2; + my ( undef, $sig ) = split /-- \n/, $body, 2; # no point going on if there's no sig. Sob. Goodbye, cruel world. return 0 unless defined $sig; my (@lines) = split /\n/, $sig; - if (scalar(@lines) > $maxlines + 1) { - $mail->reply(body => <<END); + if ( scalar(@lines) > $maxlines + 1 ) { + $mail->reply( body => <<END); Hi, ${ \( $list->owner ) } has set this list to have a maximum .sig length of $maxlines lines, hence your mail has been rejected, @@ -38,17 +40,16 @@ return 0; } - -sub options -{ - return { - 'maxlines' => { - 'description' => 'the maximum number of lines we shoudl allow in the sig before chomping', - 'type' => 'num', - 'default' => 5, - 'widget' => 'textbox', - }, - } +sub options { + return { + 'maxlines' => { + 'description' => + 'the maximum number of lines we shoudl allow in the sig before chomping', + 'type' => 'num', + 'default' => 5, + 'widget' => 'textbox', + }, + }; } 1; Index: SpamAssassin.pm =================================================================== RCS file: /cvsroot/siesta/siesta/lib/Siesta/Plugin/SpamAssassin.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- SpamAssassin.pm 23 Aug 2002 14:26:38 -0000 1.3 +++ SpamAssassin.pm 10 Sep 2002 18:24:17 -0000 1.4 @@ -1,5 +1,6 @@ # $Id$ package Siesta::Plugin::SpamAssassin; + # standard includes use strict; use Siesta::Plugin; @@ -18,7 +19,7 @@ my $mail = shift; my $spamtest = Mail::SpamAssassin->new(); - my $status = $spamtest->check($mail); + my $status = $spamtest->check($mail); # Naughty person. return 1 if $status->is_spam(); Index: SubjectTag.pm =================================================================== RCS file: /cvsroot/siesta/siesta/lib/Siesta/Plugin/SubjectTag.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- SubjectTag.pm 23 Aug 2002 18:45:19 -0000 1.3 +++ SubjectTag.pm 10 Sep 2002 18:24:20 -0000 1.4 @@ -9,7 +9,7 @@ my $self = shift; my $mail = shift; - my $subject = $mail->subject || 'no subject'; + my $subject = $mail->subject || 'no subject'; my $list_name = $mail->list->id; $mail->subject("[$list_name] $subject") unless $subject =~ /\[$list_name\]/; Index: Subscribe.pm =================================================================== RCS file: /cvsroot/siesta/siesta/lib/Siesta/Plugin/Subscribe.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Subscribe.pm 26 Aug 2002 17:34:52 -0000 1.3 +++ Subscribe.pm 10 Sep 2002 18:24:21 -0000 1.4 @@ -12,8 +12,8 @@ my $mail = shift; my $list = $mail->list; - if ($list->add_member($mail->from)) { - $mail->reply(body => <<END); + if ( $list->add_member( $mail->from ) ) { + $mail->reply( body => <<END); Hi, You have been successfully subscribed to ${ \( $list->id ) } @@ -22,7 +22,7 @@ END } else { - $mail->reply(body => <<END); + $mail->reply( body => <<END); Hi, You could not be subscribed to ${ \( $list->id ) }. @@ -37,11 +37,11 @@ } sub list_config { - return 'Nothing to configure for this plugin.'; + return 'Nothing to configure for this plugin.'; } sub user_config { - return 'Nothing to configure for this plugin.'; + return 'Nothing to configure for this plugin.'; } 1; Index: UnSubscribe.pm =================================================================== RCS file: /cvsroot/siesta/siesta/lib/Siesta/Plugin/UnSubscribe.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- UnSubscribe.pm 26 Aug 2002 17:34:52 -0000 1.3 +++ UnSubscribe.pm 10 Sep 2002 18:24:22 -0000 1.4 @@ -12,8 +12,8 @@ my $mail = shift; my $list = $mail->list; - if ($list->remove_member($mail->from)) { - $mail->reply(body => <<END); + if ( $list->remove_member( $mail->from ) ) { + $mail->reply( body => <<END); Hi, You have been sucessfully unsubscribed from ${ \( $list->id ) } @@ -22,7 +22,7 @@ END } else { - $mail->reply(body => <<END); + $mail->reply( body => <<END); Hi, You could not be unsubscribed from ${ \( $list->id ) } @@ -37,11 +37,11 @@ } sub list_config { - return 'Nothing to configure for this plugin'; + return 'Nothing to configure for this plugin'; } sub user_config { - return 'Nothing to configure for this plugin'; + return 'Nothing to configure for this plugin'; } 1;
Generated at 13:57 on 01 Jul 2004 by mariachi 0.52