You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by fe...@apache.org on 2005/12/05 05:46:46 UTC
svn commit: r353986 -
/spamassassin/rules/trunk/sandbox/felicity/sandbox-felicity.pm
Author: felicity
Date: Sun Dec 4 20:46:43 2005
New Revision: 353986
URL: http://svn.apache.org/viewcvs?rev=353986&view=rev
Log:
when evaltests move to plugins, the object reference is not what it once was
Modified:
spamassassin/rules/trunk/sandbox/felicity/sandbox-felicity.pm
Modified: spamassassin/rules/trunk/sandbox/felicity/sandbox-felicity.pm
URL: http://svn.apache.org/viewcvs/spamassassin/rules/trunk/sandbox/felicity/sandbox-felicity.pm?rev=353986&r1=353985&r2=353986&view=diff
==============================================================================
--- spamassassin/rules/trunk/sandbox/felicity/sandbox-felicity.pm (original)
+++ spamassassin/rules/trunk/sandbox/felicity/sandbox-felicity.pm Sun Dec 4 20:46:43 2005
@@ -44,9 +44,9 @@
}
sub check_iframe_src {
- my ($self) = @_;
+ my ($self, $pms) = @_;
- while (my($k,$v) = each %{$self->{html}->{uri_detail}}) {
+ while (my($k,$v) = each %{$pms->{html}->{uri_detail}}) {
return 1 if $v->{types}->{iframe};
}
@@ -54,12 +54,12 @@
}
sub check_from_format {
- my ($self) = @_;
+ my ($self, $pms) = @_;
- my $name = $self->get('From:name') || return;
+ my $name = $pms->get('From:name') || return;
return if ($name !~ m/^[A-Z][a-z]+\.[A-Z][a-z]+\@/);
- my $addr = $self->get('From:addr') || return;
+ my $addr = $pms->get('From:addr') || return;
return if ($addr !~ m/^[A-Z][a-z]+\.[A-Z][a-z]+\@/);
return if ($name eq $addr);
@@ -67,16 +67,16 @@
}
sub subject_length {
- my ($self, $min, $max) = @_;
- my $len = length($self->get('Subject'));
+ my ($self, $pms, $min, $max) = @_;
+ my $len = length($pms->get('Subject'));
return($len < $max && $len >= $min);
}
sub check_html_uri_only {
- my ($self) = @_;
+ my ($self, $pms) = @_;
# Find out if there are any multipart/alternative parts in the message
- my @ma = $self->{msg}->find_parts(qr@^multipart/alternative\b@i);
+ my @ma = $pms->{msg}->find_parts(qr@^multipart/alternative\b@i);
# If there are no multipart/alternative sections, skip this test.
return if (!@ma);
@@ -84,7 +84,7 @@
# At this point, we're not actually checking the alternates, just the entire
# message.
my $return = 0;
- while (my($k,$v) = each %{$self->{html}->{uri_detail}}) {
+ while (my($k,$v) = each %{$pms->{html}->{uri_detail}}) {
$return = 1; # make sure there's at least 1 URI
return 0 if ($v->{types}->{parsed});
}
Re: svn commit: r353986 - /spamassassin/rules/trunk/sandbox/felicity/sandbox-felicity.pm
Posted by Theo Van Dinter <fe...@apache.org>.
On Mon, Dec 05, 2005 at 11:06:50AM -0800, Justin Mason wrote:
> >when evaltests move to plugins, the object reference is not what it once was
>
> oh crap. This may be a bad thing.
>
> Should we define a new API for plugins to define eval tests that uses the
> old, EvalTests-compatible argument order?
I'm not really worried about it. Part of me would like to see us getting
rid of EvalTests and moving all to plugins. I haven't thought enough
about it to figure out if that's good or bad.
--
Randomly Generated Tagline:
A closed mind gathers no intelligence.