Re: Pyzor errors after upgrade

2014-09-02 Thread Chris
On Tue, 2014-09-02 at 11:27 -0700, John Hardin wrote:
> On Tue, 2 Sep 2014, Chris wrote:
> 
> >>> ifplugin Mail::SpamAssassin::Plugin::Pyzor
> >>> pyzor_path /usr/local/bin/pyzor
> >>> pyzor_options --homedir /home/chris/.pyzor
> >>> endif
> >
> > Would it be better if I changed the pyzor home dir
> > to /etc/mail/spamassassin and put the 'servers' file there?
> 
> In general that's a better way to do it. The alternative would be if (for 
> example) spamd was running under a dedicated daemon user amavis, then you 
> could leave the pyzor home dir under ~amavis. But you don't really want to 
> have system config files living under real user directories.
> 
Hmm, after making the change in my local.cf and restarting SA I went and
took my afternoon nap. Coming back and checking my hourly syslog
snippits I saw:

Sep  2 13:11:32 localhost spamd[26055]: pyzor: check failed: internal
error, python traceback seen in response
Sep  2 13:11:46 localhost spamd[26055]: pyzor: check failed: internal
error, python traceback seen in response
Sep  2 13:14:07 localhost spamd[26055]: pyzor: check failed: internal
error, python traceback seen in response
Sep  2 13:53:52 localhost spamd[26055]: pyzor: check failed: internal
error, python traceback seen in response

I had changed my local.cf to read:

ifplugin Mail::SpamAssassin::Plugin::Pyzor
pyzor_path /usr/local/bin/pyzor
pyzor_options --homedir /etc/mail/spamassassin
endif

and put the servers file as noted above by itself. That was possibly
incorrect as I copied the .pyzor folder over from my home
to /etc/mail/spamassassin and added /.pyzor after the pyzor homedir path
I had. Just happened to have a new spam in my spam folder and ran
spamassassin -D -r on it and it looks like it's working again:

Sep  2 15:10:34.025 [30796] dbg: pyzor: pyzor is
available: /usr/local/bin/pyzor
Sep  2 15:10:34.025 [30796] dbg: dns: entering helper-app run mode
Sep  2 15:10:34.025 [30796] dbg: pyzor: opening
pipe: /usr/local/bin/pyzor --homedir /etc/mail/spamassassin/.pyzor
report < /tmp/.spamassassin30796Fg233vtmp
Sep  2 15:10:34.028 [30799] dbg: util: setuid: ruid=1000 euid=1000
Sep  2 15:10:34.254 [30796] dbg: pyzor: [30799] reporter finished
successfully
Sep  2 15:10:34.254 [30796] dbg: dns: leaving helper-app run mode
Sep  2 15:10:34.255 [30796] info: reporter: spam reported to Pyzor

Hopefully putting the whole .pyzor folder there corrected the issue.

Chris


-- 
Chris
31.11°N 97.89°W (Elev. 1092 ft)
15:11:49 up 2 days, 17:15, 3 users, load average: 0.17, 0.23, 0.22
Ubuntu 14.04 LTS, kernel 3.13.0-35-generic



Re: Pyzor errors after upgrade

2014-09-02 Thread John Hardin

On Tue, 2 Sep 2014, Chris wrote:


ifplugin Mail::SpamAssassin::Plugin::Pyzor
pyzor_path /usr/local/bin/pyzor
pyzor_options --homedir /home/chris/.pyzor
endif


Would it be better if I changed the pyzor home dir
to /etc/mail/spamassassin and put the 'servers' file there?


In general that's a better way to do it. The alternative would be if (for 
example) spamd was running under a dedicated daemon user amavis, then you 
could leave the pyzor home dir under ~amavis. But you don't really want to 
have system config files living under real user directories.


--
 John Hardin KA7OHZhttp://www.impsec.org/~jhardin/
 jhar...@impsec.orgFALaholic #11174 pgpk -a jhar...@impsec.org
 key: 0xB8732E79 -- 2D8C 34F4 6411 F507 136C  AF76 D822 E6E6 B873 2E79
---
  Vista: because the audio experience is *far* more important than
  network throughput.
---
 15 days until the 227th anniversary of the signing of the U.S. Constitution


Re: Pyzor errors after upgrade

2014-09-02 Thread Chris
On Tue, 2014-09-02 at 10:30 -0700, John Hardin wrote:
> On Tue, 2 Sep 2014, Chris wrote:
> 
> > On Tue, 2014-09-02 at 07:20 -0700, John Hardin wrote:
> >> On Tue, 2 Sep 2014, Chris wrote:
> >>
> >>> On Mon, 2014-09-01 at 21:17 -0700, John Hardin wrote:
>  On Mon, 1 Sep 2014, Chris wrote:
> 
> > System is Ubuntu 14.04 LTS I use fetchmail linked with procmail.
> 
> > Permissions on the ~/.pyzor/servers files and directory is:
> >
> > drwxr-x---   2 chris chris  4096 Jul 17 09:28 .pyzor
> > -rw-r- 1 chris chris 23 Jul 17 09:28 servers
> 
>  Are you using this with spamc/spamd, or spamassassin-per-message? If
>  the former, what user is spamd running as?
> 
> >>> Morning John, I'm using it with spamc which is called by a procmail
> >>> recipe in my home directory which I would 'assume' makes it being run as
> >>> user 'chris'.
> >>
> >> spamc is running as chris, spamd (the daemon) is probably running as a
> >> system account with (1) a different notion of what "~" refers to, and (2)
> >> no permissions to access chris' home directory.
> >>
> >> See the other answer that was posted; you may need to explicitly set the
> >> path to the pyzor config files to a shared (vs. per-user) location.
> >
> > John, I think you're referring to this:
> >
> > ifplugin Mail::SpamAssassin::Plugin::Pyzor
> > pyzor_path /usr/local/bin/pyzor
> > pyzor_options --homedir /home/chris/.pyzor
> > endif
> 
> That's what I was referring to.
> 
> > I added this to my local.cf and it appears to be working now. At least
> > this showed up at the end of a spam report:
> >
> > PYZOR Results are Reported 3 times.
> 
> The fact that spamd can see into your home directory suggests you're 
> running spamd as root. I was allowing for it being run as a 
> less-privileged user.
> 
Would it be better if I changed the pyzor home dir
to /etc/mail/spamassassin and put the 'servers' file there?



-- 
Chris
31.11°N 97.89°W (Elev. 1092 ft)
13:08:03 up 2 days, 15:11, 1 user, load average: 0.20, 0.22, 0.17
Ubuntu 14.04 LTS, kernel 3.13.0-35-generic



Re: Pyzor errors after upgrade

2014-09-02 Thread John Hardin

On Tue, 2 Sep 2014, Chris wrote:


On Tue, 2014-09-02 at 07:20 -0700, John Hardin wrote:

On Tue, 2 Sep 2014, Chris wrote:


On Mon, 2014-09-01 at 21:17 -0700, John Hardin wrote:

On Mon, 1 Sep 2014, Chris wrote:


System is Ubuntu 14.04 LTS I use fetchmail linked with procmail.



Permissions on the ~/.pyzor/servers files and directory is:

drwxr-x---   2 chris chris  4096 Jul 17 09:28 .pyzor
-rw-r- 1 chris chris 23 Jul 17 09:28 servers


Are you using this with spamc/spamd, or spamassassin-per-message? If
the former, what user is spamd running as?


Morning John, I'm using it with spamc which is called by a procmail
recipe in my home directory which I would 'assume' makes it being run as
user 'chris'.


spamc is running as chris, spamd (the daemon) is probably running as a
system account with (1) a different notion of what "~" refers to, and (2)
no permissions to access chris' home directory.

See the other answer that was posted; you may need to explicitly set the
path to the pyzor config files to a shared (vs. per-user) location.


John, I think you're referring to this:

ifplugin Mail::SpamAssassin::Plugin::Pyzor
pyzor_path /usr/local/bin/pyzor
pyzor_options --homedir /home/chris/.pyzor
endif


That's what I was referring to.


I added this to my local.cf and it appears to be working now. At least
this showed up at the end of a spam report:

PYZOR Results are Reported 3 times.


The fact that spamd can see into your home directory suggests you're 
running spamd as root. I was allowing for it being run as a 
less-privileged user.


--
 John Hardin KA7OHZhttp://www.impsec.org/~jhardin/
 jhar...@impsec.orgFALaholic #11174 pgpk -a jhar...@impsec.org
 key: 0xB8732E79 -- 2D8C 34F4 6411 F507 136C  AF76 D822 E6E6 B873 2E79
---
  Maxim II: A Sergeant in motion outranks a Lieutenant who doesn't
  know what's going on.
  Maxim III: An ordnance technician at a dead run outranks everybody.
---
 15 days until the 227th anniversary of the signing of the U.S. Constitution


Re: Pyzor errors after upgrade

2014-09-02 Thread Chris
On Tue, 2014-09-02 at 07:20 -0700, John Hardin wrote:
> On Tue, 2 Sep 2014, Chris wrote:
> 
> > On Mon, 2014-09-01 at 21:17 -0700, John Hardin wrote:
> >> On Mon, 1 Sep 2014, Chris wrote:
> >>
> >>> System is Ubuntu 14.04 LTS I use fetchmail linked with procmail.
> >>
> >>> Permissions on the ~/.pyzor/servers files and directory is:
> >>>
> >>> drwxr-x---   2 chris chris  4096 Jul 17 09:28 .pyzor
> >>> -rw-r- 1 chris chris 23 Jul 17 09:28 servers
> >>
> >> Are you using this with spamc/spamd, or spamassassin-per-message? If
> >> the former, what user is spamd running as?
> >>
> > Morning John, I'm using it with spamc which is called by a procmail
> > recipe in my home directory which I would 'assume' makes it being run as
> > user 'chris'.
> 
> spamc is running as chris, spamd (the daemon) is probably running as a 
> system account with (1) a different notion of what "~" refers to, and (2) 
> no permissions to access chris' home directory.
> 
> See the other answer that was posted; you may need to explicitly set the 
> path to the pyzor config files to a shared (vs. per-user) location.
> 
Additionally John when running 'spamassassin -D -r on my spam folder it
does seen to be working ok now:

Sep  2 12:08:43.528 [22850] dbg: pyzor: pyzor is
available: /usr/local/bin/pyzor
Sep  2 12:08:43.528 [22850] dbg: dns: entering helper-app run mode
Sep  2 12:08:43.529 [22850] dbg: pyzor: opening
pipe: /usr/local/bin/pyzor --homedir /home/chris/.pyzor report
< /tmp/.spamassassin22850mid5cVtmp
Sep  2 12:08:43.530 [22870] dbg: util: setuid: ruid=1000 euid=1000
Sep  2 12:08:43.965 [22850] dbg: pyzor: [22870] reporter finished
successfully
Sep  2 12:08:43.965 [22850] dbg: dns: leaving helper-app run mode
Sep  2 12:08:43.966 [22850] info: reporter: spam reported to Pyzor


-- 
Chris
31.11°N 97.89°W (Elev. 1092 ft)
12:10:04 up 2 days, 14:13, 2 users, load average: 0.21, 0.25, 0.23
Ubuntu 14.04 LTS, kernel 3.13.0-35-generic



Re: Pyzor errors after upgrade

2014-09-02 Thread Chris
On Tue, 2014-09-02 at 07:20 -0700, John Hardin wrote:
> On Tue, 2 Sep 2014, Chris wrote:
> 
> > On Mon, 2014-09-01 at 21:17 -0700, John Hardin wrote:
> >> On Mon, 1 Sep 2014, Chris wrote:
> >>
> >>> System is Ubuntu 14.04 LTS I use fetchmail linked with procmail.
> >>
> >>> Permissions on the ~/.pyzor/servers files and directory is:
> >>>
> >>> drwxr-x---   2 chris chris  4096 Jul 17 09:28 .pyzor
> >>> -rw-r- 1 chris chris 23 Jul 17 09:28 servers
> >>
> >> Are you using this with spamc/spamd, or spamassassin-per-message? If
> >> the former, what user is spamd running as?
> >>
> > Morning John, I'm using it with spamc which is called by a procmail
> > recipe in my home directory which I would 'assume' makes it being run as
> > user 'chris'.
> 
> spamc is running as chris, spamd (the daemon) is probably running as a 
> system account with (1) a different notion of what "~" refers to, and (2) 
> no permissions to access chris' home directory.
> 
> See the other answer that was posted; you may need to explicitly set the 
> path to the pyzor config files to a shared (vs. per-user) location.
> 
John, I think you're referring to this:

ifplugin Mail::SpamAssassin::Plugin::Pyzor
pyzor_path /usr/local/bin/pyzor
pyzor_options --homedir /home/chris/.pyzor
endif

I added this to my local.cf and it appears to be working now. At least
this showed up at the end of a spam report:

PYZOR Results are Reported 3 times.


-- 
Chris
31.11°N 97.89°W (Elev. 1092 ft)
12:05:40 up 2 days, 14:09, 1 user, load average: 0.26, 0.27, 0.22
Ubuntu 14.04 LTS, kernel 3.13.0-35-generic



Re: Pyzor errors after upgrade

2014-09-02 Thread John Hardin

On Tue, 2 Sep 2014, Chris wrote:


On Mon, 2014-09-01 at 21:17 -0700, John Hardin wrote:

On Mon, 1 Sep 2014, Chris wrote:


System is Ubuntu 14.04 LTS I use fetchmail linked with procmail.



Permissions on the ~/.pyzor/servers files and directory is:

drwxr-x---   2 chris chris  4096 Jul 17 09:28 .pyzor
-rw-r- 1 chris chris 23 Jul 17 09:28 servers


Are you using this with spamc/spamd, or spamassassin-per-message? If
the former, what user is spamd running as?


Morning John, I'm using it with spamc which is called by a procmail
recipe in my home directory which I would 'assume' makes it being run as
user 'chris'.


spamc is running as chris, spamd (the daemon) is probably running as a 
system account with (1) a different notion of what "~" refers to, and (2) 
no permissions to access chris' home directory.


See the other answer that was posted; you may need to explicitly set the 
path to the pyzor config files to a shared (vs. per-user) location.


--
 John Hardin KA7OHZhttp://www.impsec.org/~jhardin/
 jhar...@impsec.orgFALaholic #11174 pgpk -a jhar...@impsec.org
 key: 0xB8732E79 -- 2D8C 34F4 6411 F507 136C  AF76 D822 E6E6 B873 2E79
---
  False is the idea of utility that sacrifices a thousand real
  advantages for one imaginary or trifling inconvenience; that would
  take fire from men because it burns, and water because one may drown
  in it; that has no remedy for evils except destruction. The laws
  that forbid the carrying of arms are laws of such a nature. They
  disarm only those who are neither inclined nor determined to commit
  crime.   -- Cesare Beccaria, quoted by Thomas Jefferson
---
 15 days until the 227th anniversary of the signing of the U.S. Constitution


Re: Pyzor errors after upgrade

2014-09-02 Thread Chris
On Mon, 2014-09-01 at 21:17 -0700, John Hardin wrote:
> On Mon, 1 Sep 2014, Chris wrote:
> 
> > System is Ubuntu 14.04 LTS I use fetchmail linked with procmail.
> 
> > Permissions on the ~/.pyzor/servers files and directory is:
> >
> > drwxr-x---   2 chris chris  4096 Jul 17 09:28 .pyzor
> > -rw-r- 1 chris chris 23 Jul 17 09:28 servers
> 
> Are you using this with spamc/spamd, or spamassassin-per-message? If 
> the former, what user is spamd running as?
> 
Morning John, I'm using it with spamc which is called by a procmail
recipe in my home directory which I would 'assume' makes it being run as
user 'chris'.


-- 
Chris
31.11°N 97.89°W (Elev. 1092 ft)
07:34:29 up 2 days, 9:37, 3 users, load average: 0.17, 0.15, 0.12
Ubuntu 14.04 LTS, kernel 3.13.0-35-generic



RE: Pyzor errors after upgrade

2014-09-02 Thread David Jones
> 
> From: Chris 
> Sent: Monday, September 01, 2014 10:25 PM
> To: users@spamassassin.apache.org
> Subject: Pyzor errors after upgrade

> System is Ubuntu 14.04 LTS I use fetchmail linked with procmail. Once
> mail is tossed to my other folders what's left is run through SA and
> tossed either into my Inbox or my Spam folder. Yesterday morning I
> upgraded to the newest version of Pyzor using this command:

> pip install --upgrade pyzor

> Since then I've been seeing this in my syslog:
> Aug 31 10:02:43 localhost spamd[2645]: pyzor: check failed: internal
> error, python traceback seen in response

> Aug 31 10:07:02 localhost spamd[2645]: pyzor: check failed: internal
> error, python traceback seen in response

> Aug 31 10:35:38 localhost spamd[2645]: pyzor: check failed: internal
> error, python traceback seen in response

> The version of Pyzor shown is:

> /usr/local/bin/pyzor 0.8.0

> Permissions on the ~/.pyzor/servers files and directory is:

> drwxr-x---   2 chris chris  4096 Jul 17 09:28 .pyzor
> -rw-r- 1 chris chris 23 Jul 17 09:28 servers

> Any assistance would be appreciated even a 2x4 upside the head. I'm not
> sure how to get to the python traceback that's mentioned.

Same thing happened to me a while back.  This is in my local.cf:

ifplugin Mail::SpamAssassin::Plugin::Pyzor
pyzor_path /usr/local/bin/pyzor
pyzor_options --homedir /etc/mail/spamassassin
endif

The --homedir line above solved the problem for me.  Not sure
why since my permissions seemed to be good too.

Be sure to move the 'servers' file to /etc/mail/spamassassin.

> Chris

> --
> Chris
> 31.11°N 97.89°W (Elev. 1092 ft)
> 22:14:39 up 2 days, 18 min, 2 users, load average: 0.05, 0.10, 0.22
> Ubuntu 14.04 LTS, kernel 3.13.0-35-generic


Re: Pyzor errors after upgrade

2014-09-01 Thread John Hardin

On Mon, 1 Sep 2014, Chris wrote:


System is Ubuntu 14.04 LTS I use fetchmail linked with procmail.



Permissions on the ~/.pyzor/servers files and directory is:

drwxr-x---   2 chris chris  4096 Jul 17 09:28 .pyzor
-rw-r- 1 chris chris 23 Jul 17 09:28 servers


Are you using this with spamc/spamd, or spamassassin-per-message? If 
the former, what user is spamd running as?


--
 John Hardin KA7OHZhttp://www.impsec.org/~jhardin/
 jhar...@impsec.orgFALaholic #11174 pgpk -a jhar...@impsec.org
 key: 0xB8732E79 -- 2D8C 34F4 6411 F507 136C  AF76 D822 E6E6 B873 2E79
---
  ...much of our country's counterterrorism security spending is not
  designed to protect us from the terrorists, but instead to protect
  our public officials from criticism when another attack occurs.
-- Bruce Schneier
---
 823 days since the first successful private support mission to ISS (SpaceX)