View | Details | Raw Unified | Return to bug 441
Collapse All | Expand All

(-)lib/Mail/SpamAssassin/EvalTests.pm (-13 / +4 lines)
Lines 1198-1217 Link Here
1198
   my ($self) = @_;
1198
   my ($self) = @_;
1199
   my $subject = $self->get('Subject');
1199
   my $subject = $self->get('Subject');
1200
1200
1201
   return 0 if subject_missing($self);
1201
   $subject =~ s/^\s+//;
1202
1202
   $subject =~ s/\s+$//;
1203
   $subject =~ s/[^a-zA-Z]//;
1203
   return 0 if $subject !~ /\s/;	# don't match one word subjects
1204
1204
   $subject =~ s/[^a-zA-Z]//g;		# only look at letters
1205
   return 0 if $subject !~ / /; # Don't match one word subjects!
1206
1207
   return length($subject) && ($subject eq uc($subject));
1205
   return length($subject) && ($subject eq uc($subject));
1208
}
1209
1210
sub subject_missing {
1211
   my ($self) = @_;
1212
   my $subject = $self->get('Subject');
1213
   chomp($subject);
1214
   return length($subject) ? 0 : 1;
1215
}
1206
}
1216
1207
1217
###########################################################################
1208
###########################################################################
(-)rules/20_head_tests.cf (-2 / +2 lines)
Lines 56-63 Link Here
56
header SUBJ_ALL_CAPS		eval:subject_is_all_caps()
56
header SUBJ_ALL_CAPS		eval:subject_is_all_caps()
57
describe SUBJ_ALL_CAPS		Subject is all capitals
57
describe SUBJ_ALL_CAPS		Subject is all capitals
58
58
59
header SUBJ_MISSING            eval:subject_missing()
59
header SUBJ_MISSING		Subject !~ /\S/
60
describe SUBJ_MISSING          Subject: is empty or missing
60
describe SUBJ_MISSING		Subject: is empty or missing
61
61
62
# (allow this test to pass if there's no Message-Id header)
62
# (allow this test to pass if there's no Message-Id header)
63
header MSGID_HAS_NO_AT		Message-Id !~ /\@/ [if-unset: NO@MSGID]
63
header MSGID_HAS_NO_AT		Message-Id !~ /\@/ [if-unset: NO@MSGID]

Return to bug 441