summaryrefslogtreecommitdiff
path: root/fml/lib/FML
diff options
context:
space:
mode:
authorfukachan <fukachan>2006-05-09 12:30:05 +0000
committerfukachan <fukachan>2006-05-09 12:30:05 +0000
commitd2d8b1cbfd80b3c2c0964adf59c11f4126a31594 (patch)
tree8319c104e4a02f008c31e1a1f3c8396e24d25855 /fml/lib/FML
parent6122082ca70b12ea08614d96fd106fb203557f93 (diff)
downloadfml8-d2d8b1cbfd80b3c2c0964adf59c11f4126a31594.tar.gz
fml8-d2d8b1cbfd80b3c2c0964adf59c11f4126a31594.tar.bz2
fml8-d2d8b1cbfd80b3c2c0964adf59c11f4126a31594.zip
implement reject_spammer_maps()
Diffstat (limited to 'fml/lib/FML')
-rw-r--r--fml/lib/FML/Restriction/Post.pm25
1 files changed, 24 insertions, 1 deletions
diff --git a/fml/lib/FML/Restriction/Post.pm b/fml/lib/FML/Restriction/Post.pm
index a016d51d..a0bb71c7 100644
--- a/fml/lib/FML/Restriction/Post.pm
+++ b/fml/lib/FML/Restriction/Post.pm
@@ -4,7 +4,7 @@
# All rights reserved. This program is free software; you can
# redistribute it and/or modify it under the same terms as Perl itself.
#
-# $FML: Post.pm,v 1.25 2006/01/09 14:00:55 fukachan Exp $
+# $FML: Post.pm,v 1.26 2006/04/10 13:08:52 fukachan Exp $
#
package FML::Restriction::Post;
@@ -76,6 +76,29 @@ sub reject_system_accounts
}
+# Descriptions: reject if $sender matches a spammer.
+# Arguments: OBJ($self) STR($rule) STR($sender)
+# Side Effects: none
+# Return Value: ARRAY(STR, STR)
+sub reject_spammer_maps
+{
+ my ($self, $rule, $sender) = @_;
+ my $curproc = $self->{ _curproc };
+ my $cred = $curproc->credential();
+ my $match = $cred->is_spammer($sender);
+
+ if ($match) {
+ $curproc->log("${rule}: $match matches sender address");
+ unless ($curproc->restriction_state_get_deny_reason()) {
+ $curproc->restriction_state_set_deny_reason($rule);
+ }
+ return("matched", "deny");
+ }
+
+ return(0, undef);
+}
+
+
# Descriptions: permit irrespective of $sender :)
# Arguments: OBJ($self) STR($rule) STR($sender)
# Side Effects: none