"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "lib/Mail/SpamAssassin/Plugin/Pyzor.pm" between
Mail-SpamAssassin-3.4.4.tar.bz2 and Mail-SpamAssassin-3.4.5.tar.bz2

About: SpamAssassin is a mail filter that uses a wide range of heuristic tests on mail headers and body text to identify "spam" (also known as unsolicited commercial email) incl. Bayesian (statistical) spam filter and several internet-based realtime blacklists.

Pyzor.pm  (Mail-SpamAssassin-3.4.4.tar.bz2):Pyzor.pm  (Mail-SpamAssassin-3.4.5.tar.bz2)
skipping to change at line 152 skipping to change at line 152
push (@cmds, { push (@cmds, {
setting => 'pyzor_timeout', setting => 'pyzor_timeout',
is_admin => 1, is_admin => 1,
default => 3.5, default => 3.5,
type => $Mail::SpamAssassin::Conf::CONF_TYPE_DURATION type => $Mail::SpamAssassin::Conf::CONF_TYPE_DURATION
}); });
=item pyzor_options options =item pyzor_options options
Specify additional options to the pyzor(1) command. Please note that only Specify additional options to the pyzor(1) command. Please note that only
characters in the range [0-9A-Za-z ,._/-] are allowed for security reasons. characters in the range [0-9A-Za-z =,._/-] are allowed for security reasons.
=cut =cut
push (@cmds, { push (@cmds, {
setting => 'pyzor_options', setting => 'pyzor_options',
is_admin => 1, is_admin => 1,
default => '', default => '',
type => $Mail::SpamAssassin::Conf::CONF_TYPE_STRING, type => $Mail::SpamAssassin::Conf::CONF_TYPE_STRING,
code => sub { code => sub {
my ($self, $key, $value, $line) = @_; my ($self, $key, $value, $line) = @_;
if ($value !~ m{^([0-9A-Za-z ,._/-]+)$}) { if ($value !~ m{^([0-9A-Za-z =,._/-]+)$}) {
return $Mail::SpamAssassin::Conf::INVALID_VALUE; return $Mail::SpamAssassin::Conf::INVALID_VALUE;
} }
$self->{pyzor_options} = $1; $self->{pyzor_options} = $1;
} }
}); });
=item pyzor_path STRING =item pyzor_path STRING
This option tells SpamAssassin specifically where to find the C<pyzor> This option tells SpamAssassin specifically where to find the C<pyzor>
client instead of relying on SpamAssassin to find it in the current client instead of relying on SpamAssassin to find it in the current
skipping to change at line 306 skipping to change at line 306
} else { } else {
info("pyzor: [%s] error: %s", $pid, exit_status_str($?,$errno)); info("pyzor: [%s] error: %s", $pid, exit_status_str($?,$errno));
} }
if (!@response) { if (!@response) {
# this exact string is needed below # this exact string is needed below
warn("no response\n"); # yes, this is possible warn("no response\n"); # yes, this is possible
return; return;
} }
chomp for @response; chomp for @response;
dbg("pyzor: got response: " . join("\\n", @response));
if ($response[0] =~ /^Traceback/) { if ($response[0] =~ /^Traceback/) {
warn("internal error, python traceback seen in response\n"); warn("internal error, python traceback seen in response: ".
join("\\n", @response));
} else {
dbg("pyzor: got response: ".join("\\n", @response));
} }
}); });
if (defined(fileno(*PYZOR))) { # still open if (defined(fileno(*PYZOR))) { # still open
if ($pid) { if ($pid) {
if (kill('TERM',$pid)) { dbg("pyzor: killed stale helper [$pid]") } if (kill('TERM',$pid)) { dbg("pyzor: killed stale helper [$pid]") }
else { dbg("pyzor: killing helper application [$pid] failed: $!") } else { dbg("pyzor: killing helper application [$pid] failed: $!") }
} }
my $errno = 0; close PYZOR or $errno = $!; my $errno = 0; close PYZOR or $errno = $!;
 End of changes. 4 change blocks. 
4 lines changed or deleted 6 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)