From dbcc3d40b4e61100f475714077f6945e79559ff5 Mon Sep 17 00:00:00 2001 From: Matt Simerson Date: Wed, 24 Apr 2013 00:23:24 -0400 Subject: [PATCH] split is_immune into itself + is_naughty is_immune tests designates to plugins they should always skip processing. That's typical for naughty connections, but this change provides the ability to handly naughty connections differently than (whitelisted/relayclients/known good) senders. --- lib/Qpsmtpd/Plugin.pm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/Qpsmtpd/Plugin.pm b/lib/Qpsmtpd/Plugin.pm index 2d3537e..4e0226f 100644 --- a/lib/Qpsmtpd/Plugin.pm +++ b/lib/Qpsmtpd/Plugin.pm @@ -303,6 +303,12 @@ sub is_immune { $self->log(LOGINFO, "skip, whitelisted sender"); return 1; } + return; +} + +sub is_naughty { + my $self = shift; + if ($self->connection->notes('naughty')) { # see plugins/naughty @@ -323,7 +329,7 @@ sub adjust_karma { my $karma = $self->connection->notes('karma') || 0; $karma += $value; - $self->log(LOGDEBUG, "karma adjust: $value ($karma)"); + $self->log(LOGDEBUG, "karma $value ($karma)"); $self->connection->notes('karma', $karma); return $value; }