On Sat, 6 Oct 2012, Arthur Dent wrote:

On Sat, 2012-10-06 at 10:51 -0700, John Hardin wrote:
On Sat, 6 Oct 2012, Arthur Dent wrote:

On Sat, 2012-10-06 at 09:01 -0700, John Hardin wrote:
On Sat, 6 Oct 2012, Arthur Dent wrote:

OK - I don't know what the output means though!...
============================8<=======================================
$ pyzor -d --homedir /home/mark/.pyzor check < spam1.txt

sending: 'User: anonymous\nTime: 1349530888\nSig: 
011dffafd6c01568e1ebdc453bf9feae2bb000e9\n\nOp: check\nOp-Digest: 
6da5a18b2eda6b5db73a8747932e84436d653cd5\nThread: 31045\nPV: 2.0\n\n'
received: 'Code: 200\nDiag: OK\nPV: 2.1\nThread: 31045\nCount: 0\nWL-Count: 
0\n\n'
public.pyzor.org:24441  (200, 'OK')     0       0
============================8<=======================================

Immediately after running the above command interactively, run "echo $?"
to report the exit code it returned:

   pyzor -d --homedir /home/mark/.pyzor check < spam1.txt ; echo $?

$ pyzor -d --homedir /home/mark/.pyzor check < spam1.txt ; echo $?
sending: 'User: anonymous\nTime: 1349543386\nSig: 
c44c64b14afb3cdbf522bde672d087d8c8109101\n\nOp: check\nOp-Digest: 
6da5a18b2eda6b5db73a8747932e84436d653cd5\nThread: 25600\nPV: 2.0\n\n'
received: 'Code: 200\nDiag: OK\nPV: 2.1\nThread: 25600\nCount: 0\nWL-Count: 
0\n\n'
public.pyzor.org:24441  (200, 'OK')     0       0
1

Does that tell you anything?

I was assuming a nonzero exit code indicated an error, but Pyzor doesn't
follow that convention.

The "dbg: pyzor: check failed: no response" means that for some reason the
Pyzor SA plugin couldn't read the output that the pyzor program is
generating. But a different error message should have been generated if
that was happening.

I can add some more debugging output statements if you're willing to
temporarily try some modified code.


Hi John,

I'm happy to try anything - especially if it helps to refine open source
software. However, before we go down that route can we just check that
it is not my lack of knowledge that is the problem here.

To test pyzor I ran the command suggested on the Wiki [1]:
echo "test" | spamassassin -D pyzor 2>&1 | less

This, it seems to me, just pipes the word test into SA and looks at the
pyzor output.

Correct.

Wondering if that was the problem I tried this:
cat spam1.txt | spamassassin -D pyzor 2>&1 | less
where spam1.txt is a real email (spammy - but I don't know if it should
trigger pyzor or not).

Both tests give the exit code 1. However, the first one produces a
"failed: no response" message, whereas the second one produces a "got
response" message. Viz:

$ echo "test" | spamassassin -D pyzor 2>&1 | less
Oct  6 19:33:01.540 [14853] dbg: pyzor: network tests on, attempting Pyzor
Oct  6 19:33:05.329 [14853] dbg: pyzor: pyzor is available: /bin/pyzor
Oct  6 19:33:05.335 [14853] dbg: pyzor: opening pipe: /bin/pyzor --homedir 
/home/mark/.pyzor check < /tmp/.spamassassin14853Tu0tM9tmp
Oct  6 19:33:05.495 [14853] dbg: pyzor: [14860] finished: exit 1
Oct  6 19:33:05.496 [14853] dbg: pyzor: check failed: no response

$ cat spam1.txt | spamassassin -D pyzor 2>&1 | less
Oct  6 19:34:05.896 [14864] dbg: pyzor: network tests on, attempting Pyzor
Oct  6 19:34:10.940 [14864] dbg: pyzor: pyzor is available: /bin/pyzor
Oct  6 19:34:10.942 [14864] dbg: pyzor: opening pipe: /bin/pyzor --homedir 
/home/mark/.pyzor check < /tmp/.spamassassin14864qX2Rmwtmp
Oct  6 19:34:11.248 [14864] dbg: pyzor: [14866] finished: exit 1
Oct  6 19:34:11.248 [14864] dbg: pyzor: got response: public.pyzor.org:24441 
(200, 'OK') 0 0

Is it simply that neither "input" (the word "test" or a real email)
happen to trigger pyzor?

Ah. That looks a lot better. "test" isn't a valid email so it's not surprising that pyzor doesn't return a response. The second test, using a valid email, shows that everything is (or at least should be) working properly. SA _is_ seeing a response from Pyzor, indicating that message is not in the database and is also not whitelisted.

I apologize that I didn't look closely enough at your original post to see that you were sending "test" through it rather than a properly-formatted email message. I've updated the wiki to address this more clearly.

I think you're good to go.

--
 John Hardin KA7OHZ                    http://www.impsec.org/~jhardin/
 jhar...@impsec.org    FALaholic #11174     pgpk -a jhar...@impsec.org
 key: 0xB8732E79 -- 2D8C 34F4 6411 F507 136C  AF76 D822 E6E6 B873 2E79
-----------------------------------------------------------------------
  ...wind turbines are not meant to actually be an efficient way to
  supply the power grid, rather they're prayer wheels for New Age
  iBuddhists, their whirring blades drawing white guilt from the
  atmosphere and pumping it safely underground.                -- Tam
-----------------------------------------------------------------------
 Tomorrow: the first private ISS resupply mission (SpaceX/Dragon)

Reply via email to