I haven't tried your Exim config (but I may well have a play later), but
here's a better perl script, short enough perhaps to be inlined in Exim
(I'm assumming the "pipe" method returns 0 if things are OK--correct me if
I'm wrong):
#!/usr/bin/perl -w
#
# take message in from Exim and check to see
# if it is spam as determined by razor.
#
# Mail::Audit module from
#
http://search.cpan.org/search?module=Mail::Audit
#
http://simon-cozens.org/writings/mail-audit.html
use Mail::Audit qw(Razor);
# read mail in on STDIN and create new mail audit object
my $incoming = Mail::Audit->new;
# check if mail is spam
$incoming->put_header("X-Razor-Check",
$incoming->is_spam ? "SPAM" : "OK");
$cmd = "/usr/local/sbin/exim -oMr razor_checked -f '$ENV{SENDER}' '$ENV{RECIPIENT}'";
exit $incoming->pipe($cmd);
At 01:12 +0100 j2 wrote:
>I tried to implement vipuls Razor
>(http://prdownloads.sourceforge.net/razor/razor-agents-1.19.tar.gz)
>
>and did the following
>
>a transport:
>
>razor_check_pipe:
> driver = pipe
> command = /home/razor/razor-check.pl
> user = razor
> group = mail
> environment = "RECIPIENT=$local_part@$domain"
> prefix =
> suffix =
>
>as my first director
>
>razor_check:
> driver = smartuser
> transport = razor_check_pipe
> condition = ${if eq {$received_protocol}{razor_checked}{no}{yes}}
>
>and then the (slightly modified) razor-check.pl
[snip]