Discussion:
Pyzor not working within MS, fine from command line
Stef Morrell
2014-04-04 14:54:19 UTC
Permalink
I wonder if any of you can shed any light on this:

I've got:

This is CentOS release 6.5 (Final)
This is Perl version 5.010001 (5.10.1)
This is MailScanner version 4.84.6
3.004000 Mail::SpamAssassin

And Pyzor refuses work correctly, this output from running MS with both debug and debug SA turned on:

15:16:58 Apr 4 15:16:58.529 [3554] dbg: plugin: loading Mail::SpamAssassin::Plugin::Pyzor from @INC
15:16:58 Apr 4 15:16:58.531 [3554] dbg: pyzor: network tests on, attempting Pyzor
15:16:58 Apr 4 15:16:58.804 [3554] dbg: config: fixed relative path: /var/lib/spamassassin/3.004000/updates_spamassassin_org/25_pyzor.cf
15:16:58 Apr 4 15:16:58.804 [3554] dbg: config: using "/var/lib/spamassassin/3.004000/updates_spamassassin_org/25_pyzor.cf" for included file
15:16:58 Apr 4 15:16:58.804 [3554] dbg: config: read file /var/lib/spamassassin/3.004000/updates_spamassassin_org/25_pyzor.cf
15:17:00 Apr 4 15:17:00.409 [3554] dbg: pyzor: pyzor is available: /usr/bin/pyzor
15:17:00 Apr 4 15:17:00.410 [3554] dbg: pyzor: opening pipe: /usr/bin/pyzor --homedir /var/spool/postfix/.pyzor check < /var/spool/MailScanner/incoming/SpamAssassin-Temp/.spamassassin3554JjLLoPtmp
15:17:00 Apr 4 15:17:00.414 [3554] info: pyzor: [3574] error: exit 6
15:17:00 Apr 4 15:17:00.414 [3554] dbg: pyzor: check failed: no response
15:17:30 Apr 4 15:17:30.711 [3591] dbg: pyzor: pyzor is available: /usr/bin/pyzor
15:17:30 Apr 4 15:17:30.712 [3591] dbg: pyzor: opening pipe: /usr/bin/pyzor --homedir /var/spool/postfix/.pyzor check < /var/spool/MailScanner/incoming/SpamAssassin-Temp/.spamassassin3591ncweDTtmp
15:17:30 Apr 4 15:17:30.716 [3591] info: pyzor: [3594] error: exit 6
15:17:30 Apr 4 15:17:30.716 [3591] dbg: pyzor: check failed: no response

Initially postfix couldn't pyzor ping, so I wondered about permissions and created a .pyzor in /var/spool/postfix and as you can see from the log above specified that path. Still no luck, though postfix can now run pyzor happily from command line.

[root at fedecks mailscanner]# su - postfix -s /bin/bash
-bash-4.1$ pyzor ping
public.pyzor.org:24441 (200, 'OK')
-bash-4.1$ cd /var/spool/postfix/hold/
-bash-4.1$ pyzor check < 4FCB5E0406
public.pyzor.org:24441 (200, 'OK') 0 0
-bash-4.1$ logout

Which isn't ruling out permissions, but puts it beyond me :)

Has anyone any bright ideas?
Mark Sapiro
2014-04-04 15:48:04 UTC
Permalink
Post by Stef Morrell
Initially postfix couldn't pyzor ping, so I wondered about permissions and created a .pyzor in /var/spool/postfix and as you can see from the log above specified that path. Still no luck, though postfix can now run pyzor happily from command line.
Try

cp -a ~postfix/.pyzor/* /var/spool/postfix/.pyzor/
--
Mark Sapiro <mark at msapiro.net> The highway is for gamblers,
San Francisco Bay Area, California better use your sense - B. Dylan
Stef Morrell
2014-04-04 16:06:31 UTC
Permalink
Post by Stef Morrell
Post by Stef Morrell
Initially postfix couldn't pyzor ping, so I wondered about permissions
and created a .pyzor in /var/spool/postfix and as you can see from the log
above specified that path. Still no luck, though postfix can now run pyzor
happily from command line.
Try
cp -a ~postfix/.pyzor/* /var/spool/postfix/.pyzor/
Pointless as:

postfix:x:89:89::/var/spool/postfix:/sbin/nologin

~postfix == /var/spool/postfix
Dudi Goldenberg
2014-04-04 17:45:57 UTC
Permalink
Post by Stef Morrell
Post by Mark Sapiro
Try
cp -a ~postfix/.pyzor/* /var/spool/postfix/.pyzor/
postfix:x:89:89::/var/spool/postfix:/sbin/nologin
~postfix == /var/spool/postfix
This is not pointless if postfix is chrooted.

D.
Glenn Steen
2014-04-08 09:22:28 UTC
Permalink
No Dudi, Stef is quite right... It'd expand to cp -a
/var/spool/postfix/.pyzor /var/spool/postfix/.pyzor ...;-)

So, to the problem... When you (Stef) do a discove/ping, does it take ... a
long while? ISTR there being some settings in SA and/or MS for timeouts
that are ... Very optimistic. Upping them significantly used to be a given
(and still am!) for things like huge bayes files etc, so that they don't
get ... rudely interrupted:-). The returncode might lead in that
direction...

Cheers!
--
-- Glenn
Post by Dudi Goldenberg
Post by Stef Morrell
Post by Mark Sapiro
Try
cp -a ~postfix/.pyzor/* /var/spool/postfix/.pyzor/
postfix:x:89:89::/var/spool/postfix:/sbin/nologin
~postfix == /var/spool/postfix
This is not pointless if postfix is chrooted.
D.
--
MailScanner mailing list
mailscanner at lists.mailscanner.info
http://lists.mailscanner.info/mailman/listinfo/mailscanner
Before posting, read http://wiki.mailscanner.info/posting
Support MailScanner development - buy the book off the website!
--
-- Glenn
email: glenn < dot > steen < at > gmail < dot > com
work: glenn < dot > steen < at > ap1 < dot > se
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.mailscanner.info/pipermail/mailscanner/attachments/20140408/fa2adee7/attachment.html
Stef Morrell
2014-04-08 10:25:17 UTC
Permalink
Hi Glenn,
Post by Glenn Steen
So, to the problem... When you (Stef) do a discove/ping, does
it take ... a long while? ISTR there being some settings in
SA and/or MS for timeouts that are ... Very optimistic.
Upping them significantly used to be a given (and still am!)
for things like huge bayes files etc, so that they don't get
... rudely interrupted:-). The returncode might lead in that
direction...
No, from command line (as postfix, or indeed as root) it's
pretty much instant. SA is reporting Pyzor as giving exit 6,
however my Google-fu fails me on getting any useful information
about that (or any!) return code.

Also if you look at the log fragment I posted it's less than a
second for it to fail when running MS with debug.

15:17:00 Apr 4 15:17:00.409 [3554] dbg: pyzor: pyzor is available: /usr/bin/pyzor
15:17:00 Apr 4 15:17:00.410 [3554] dbg: pyzor: opening pipe: /usr/bin/pyzor --homedir /var/spool/postfix/.pyzor check < /var/spool/MailScanner/incoming/SpamAssassin-Temp/.spamassassin3554JjLLoPtmp
15:17:00 Apr 4 15:17:00.414 [3554] info: pyzor: [3574] error: exit 6
15:17:00 Apr 4 15:17:00.414 [3554] dbg: pyzor: check failed: no response
Glenn Steen
2014-04-08 13:10:46 UTC
Permalink
True, it does look that way... I was more thinking the whole SA run, not
the individual subcommand, but that'd likely look different...
Return 6 in the OS sense is "no such device or address" ... And looking at
the code for pyzor, that seems pretty much to be it (... Not the strongest
python coder there is, so I might well be wrong.). Question then becomes
why, when it works from a "su - postfix -s /bin/bash" (or similar). If the
host was wrong, it'd be an exit code of 2, likely, if it was a stranght
FW/routing problem, likely a normal timeout. Hmmm.

Sorry, I'm out of ideas.
--
-- Glenn
Post by Stef Morrell
Hi Glenn,
Post by Glenn Steen
So, to the problem... When you (Stef) do a discove/ping, does
it take ... a long while? ISTR there being some settings in
SA and/or MS for timeouts that are ... Very optimistic.
Upping them significantly used to be a given (and still am!)
for things like huge bayes files etc, so that they don't get
... rudely interrupted:-). The returncode might lead in that
direction...
No, from command line (as postfix, or indeed as root) it's
pretty much instant. SA is reporting Pyzor as giving exit 6,
however my Google-fu fails me on getting any useful information
about that (or any!) return code.
Also if you look at the log fragment I posted it's less than a
second for it to fail when running MS with debug.
15:17:00 Apr 4 15:17:00.409 [3554] dbg: pyzor: pyzor is available: /usr/bin/pyzor
/usr/bin/pyzor --homedir /var/spool/postfix/.pyzor check <
/var/spool/MailScanner/incoming/SpamAssassin-Temp/.spamassassin3554JjLLoPtmp
15:17:00 Apr 4 15:17:00.414 [3554] info: pyzor: [3574] error: exit 6
15:17:00 Apr 4 15:17:00.414 [3554] dbg: pyzor: check failed: no response
--
MailScanner mailing list
mailscanner at lists.mailscanner.info
http://lists.mailscanner.info/mailman/listinfo/mailscanner
Before posting, read http://wiki.mailscanner.info/posting
Support MailScanner development - buy the book off the website!
--
-- Glenn
email: glenn < dot > steen < at > gmail < dot > com
work: glenn < dot > steen < at > ap1 < dot > se
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.mailscanner.info/pipermail/mailscanner/attachments/20140408/f30aae25/attachment.html
Stef Morrell
2014-04-10 09:22:35 UTC
Permalink
Thanks everyone who gave me ideas.

It still apparently fails in a debug batch, but I found various instances of PYZOR_CHECK 1.39 and similar in the mail log.

So is mysteriously working fine, except when I run a test.

Very odd, but I guess I won't complain.

Loading...