https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6351

           Summary: Pyzor plugin fails with "check failed: no response"
                    even though pyzor seems to work okay
           Product: Spamassassin
           Version: 3.3.0
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: major
          Priority: P5
         Component: Plugins
        AssignedTo: [email protected]
        ReportedBy: [email protected]


I configured SpamAssassin with the Pyzor plugin, following the HOWTO's:

http://wiki.apache.org/spamassassin/UsingPyzor

When I test it, the Pyzor plugin doesn't seem to work however:

# echo hoi | su spamd -c 'spamassassin -D pyzor'
feb 25 23:42:46.297 [1653] dbg: pyzor: network tests on, attempting Pyzor
feb 25 23:42:49.447 [1653] dbg: pyzor: pyzor is available: /usr/bin/pyzor
feb 25 23:42:49.448 [1653] dbg: pyzor: opening pipe: /usr/bin/pyzor check <
/tmp/.spamassassin1653RDuT3etmp
feb 25 23:42:49.514 [1653] dbg: pyzor: [1654] finished: exit 1
feb 25 23:42:49.515 [1653] dbg: pyzor: check failed: no response

I added some extra debug statements to the perl module:

/usr/lib/perl5/vendor_perl/5.10.0/Mail/SpamAssassin/Plugin/Pyzor.pm

and traced this down to the pyzor_lookup function, where the pyzor binary is
actually called:

    $pid = Mail::SpamAssassin::Util::helper_app_pipe_open(*PYZOR,
        $tmpf, 1, $path, split(' ', $opts), "check");
    $pid or die "$!\n";

    # read+split avoids a Perl I/O bug (Bug 5985)
    my($inbuf,$nread,$resp); $resp = '';
    while ( $nread=read(PYZOR,$inbuf,8192) ) { $resp .= $inbuf }
    defined $nread  or die "error reading from pipe: $!";
    @response = split(/^/m, $resp, -1);  undef $resp;

In this code snippet, $resp actually stays empty, the while statement doesn't
execute its body even once. I tried reverting the fix for bug 5985 by replacing
the second part of this code to the original:

    $! = 0; @response = <PYZOR>;
    $!==0  or die "error reading from pipe: $!";

However also in this case @response stayed empty. Ofcourse I also looked up the
helper_app_pipe_open function in Util.pm (which is also used for the DCC
plugin), but that function is too complex for me to successfully debug.


Now I'm quite positive that Pyzor actually does work and in fact does return
output, because when ran separately, I get the following:

# su spamd -c '/usr/bin/pyzor check < /tmp/.spamassassin11143hdfCkYtmp'
public.pyzor.org:24441  (200, 'OK')     0       0

So you see that Pyzor is configured correctly, it has discovered its servers
and saved that in its homedirectory just fine. It is able to connect to the
server and it returns 200 OK and in this case a spam score of 0. I would expect
SA to receive output like this, but apparently that doesn't happen.

According to the SA debug output, Pyzor even returned an exit code of 1. By
running Pyzor manually I haven't been able to reproduce such an exit code. I
did notice that there is quite some perl code between the debug statement that
says what command it's going to execute and the part where that command is
actually executed. There's some fiddling with the command line arguments which
I haven't tried to understand just yet. I can imagine that the actual command
executed differs in some way from the command shown in the debug statement.

This is Fedora 12 x86_64, spamassassin-3.3.0-51.fc12.x86_64 (from Atrpms, but
spamassassin-3.3.0-5.fc12.x86_64 from Fedora itself has the same issue) and
pyzor-0.5.0-3.fc12.noarch.

-- 
Configure bugmail: 
https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

Reply via email to