git://git.jankratochvil.net
/
PerlMail.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3c73b74
)
razor2 -> spamassassin
author
short
<>
Tue, 27 Jul 2004 06:59:09 +0000
(06:59 +0000)
committer
short
<>
Tue, 27 Jul 2004 06:59:09 +0000
(06:59 +0000)
PerlMail/Config.pm
patch
|
blob
|
history
perlmail-accept
patch
|
blob
|
history
diff --git
a/PerlMail/Config.pm
b/PerlMail/Config.pm
index
dc9f756
..
9735762
100644
(file)
--- a/
PerlMail/Config.pm
+++ b/
PerlMail/Config.pm
@@
-43,7
+43,7
@@
require Mail::Alias;
BEGIN {
for (qw(headerhas store headeris did dnsbl store_muttrc_alternates Received_for parts_linear mime_type
BEGIN {
for (qw(headerhas store headeris did dnsbl store_muttrc_alternates Received_for parts_linear mime_type
- body_first mimehead
razor2
header_remap)) {
+ body_first mimehead
spamassassin
header_remap)) {
eval 'sub '.$_.' { return ::'.$_.'(@_); }';
}
}
eval 'sub '.$_.' { return ::'.$_.'(@_); }';
}
}
@@
-206,7
+206,7
@@
sub audit
# Do not local $store_file as it is our-imported
$store_profile="silent";
local $_;
# Do not local $store_file as it is our-imported
$store_profile="silent";
local $_;
- store "=spam".($_ eq 1 ? "" : ";$_") if $_=
razor2
();
+ store "=spam".($_ eq 1 ? "" : ";$_") if $_=
spamassassin
();
};
$store_profile=undef();
return if did sub {
};
$store_profile=undef();
return if did sub {
diff --git
a/perlmail-accept
b/perlmail-accept
index
dad2bd3
..
c4fa61e
100755
(executable)
--- a/
perlmail-accept
+++ b/
perlmail-accept
@@
-487,32
+487,22
@@
my($message)=@_;
# utility functions:
# return: true (error-message or "1") if is spam
# utility functions:
# return: true (error-message or "1") if is spam
-sub
razor2
+sub
spamassassin
{
{
- #
razor-check has exit code 1 if NOT spam, code 0 if IS
spam
+ #
spamassassin has exit code 1 if IS spam, code 0 if NOT
spam
local *CHILD;
local *CHILD;
- local $SIG{"PIPE"}=sub { warn "
razor2
gave me SIGPIPE: broken pipe"; };
+ local $SIG{"PIPE"}=sub { warn "
spamassassin
gave me SIGPIPE: broken pipe"; };
# prevent Razor2's: Can't call method "log" on unblessed reference at Razor2/Client/Agent.pm line 212.
local $ENV{"HOME"}=$HOME;
# prevent Razor2's: Can't call method "log" on unblessed reference at Razor2/Client/Agent.pm line 212.
local $ENV{"HOME"}=$HOME;
- open CHILD,'|'
- .'('.'(razor-check 2>&1;echo >&3 $?)'
- .'|sed "s/^/razor-check: /"'
- .'|logger -t "perlmail['.$$.']" -p mail.crit'
- .') 3>&1'
- .'|exit `cat`'
+ open CHILD,'|spamassassin --exit-code --mbox >/dev/null'
or return 0;
print CHILD $Message;
or return 0;
print CHILD $Message;
- my $return;
- {
- local $/=undef();
- $return=<CHILD> || 1;
- }
- close CHILD;
+ my $return=close CHILD;
return undef() if !WIFEXITED($?);
return undef() if WIFSIGNALED($?);
return undef() if WIFSTOPPED($?);
return undef() if !WIFEXITED($?);
return undef() if WIFSIGNALED($?);
return undef() if WIFSTOPPED($?);
- return
undef() if WEXITSTATUS($?);
- return
$return; # is
-spam
+ return
1 if WEXITSTATUS($?); # is-spam
+ return
0; # not
-spam
}
# NOTE: returns undef() if !wantarray and the first header is unrecognized
}
# NOTE: returns undef() if !wantarray and the first header is unrecognized