Differences between revisions 28 and 29
Revision 28 as of 2012-10-06 19:27:20
Size: 4166
Editor: JohnHardin
Comment: Clarify testing results
Revision 29 as of 2012-10-06 19:42:55
Size: 4722
Editor: JohnHardin
Comment: A little more testing clarification
Deletions are marked like this. Additions are marked like this.
Line 2: Line 2:
Line 6: Line 5:
 * Be sure to run "pyzor discover" after you install Pyzor, so that you can download the server to contact.   * Be sure to run "pyzor discover" after you install Pyzor, so that you can download the server to contact.
Line 10: Line 9:
 
Line 13: Line 11:
  
Line 16: Line 13:
  
Line 25: Line 21:
Line 37: Line 32:
The "check failed: no response" does not indicate a problem, as this test does not pass in an actual properly-formatted email message. If you have an actual message handy, use that for your test; you should see output similar to:
Line 38: Line 34:
The "check failed: no response" does not indicate a problem, as this test does not pass in an actual properly-formatted email message. {{{
...
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 /some/dir/.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
...
}}}
Line 41: Line 45:
Line 45: Line 48:
Line 49: Line 51:
Line 53: Line 54:
Line 57: Line 57:
 * Download and install Pyzor from http://pyzor.sourceforge.net/. You'll need something that can un-bzip2 the files. Installing simply means running the following from the folder you extracted pyzor into:{{{  * Download and install Pyzor from http://pyzor.sourceforge.net/. You'll need something that can un-bzip2 the files. Installing simply means running the following from the folder you extracted pyzor into:
 
{{{
Line 62: Line 63:
 * Create a pyzor.bat in your python folder (c:\python24 by default when I installed it), containing the following line, modified for your python folder path.{{{
@c:\python24\python c:/python24/scripts/pyzor --homedir c:/python24/etc/pyzor %1 %2 %3 %4 %5 %6 %7 %8 %9 
 * Create a pyzor.bat in your python folder (c:\python24 by default when I installed it), containing the following line, modified for your python folder path.
 
{{{
@c:\python24\python c:/python24/scripts/pyzor --homedir c:/python24/etc/pyzor %1 %2 %3 %4 %5 %6 %7 %8 %9
Line 66: Line 68:
  * Find signal.signal(signal.SIGALRM, handle_timeout) and put a # in front of it.
  * Find the section for: def time_call(self, call, varargs=(), kwargs=None): and change it to read like this:{{{
  * Find signal.signal(signal.SIGALRM, handle_timeout) and put a # in front of it.
  * Find the section for: def time_call(self, call, varargs=(), kwargs=None): and change it to read like this:
  
{{{
Line 72: Line 75:
 * From a command prompt in the python folder context, run the following where /python/pyzor is the folder you created in the previous step.{{{  * From a command prompt in the python folder context, run the following where /python/pyzor is the folder you created in the previous step.
 
{{{
Line 76: Line 80:
 * (This is not necessary in v3.1.7) Edit your /site/lib/mail/spamassassin/Util.pm. Find the "sub helper_app_pipe_open_windows" section and the line that reads{{{  * (This is not necessary in v3.1.7) Edit your /site/lib/mail/spamassassin/Util.pm. Find the "sub helper_app_pipe_open_windows" section and the line that reads
 
{{{
Line 78: Line 83:
}}} and replace it with{{{ }}}
and replace it with
 
{{{
Line 80: Line 87:
}}} because Windows won't pipe a file with a space after the < and single quotes around it. }}}
because Windows won't pipe a file with a space after the < and single quotes around it.
Line 83: Line 91:
 * Edit your local.cf and add configuration lines for pyzor. For example:{{{  * Edit your local.cf and add configuration lines for pyzor. For example:
 
{{{

Using Pyzor

Pyzor is a completely free database and software HashSharingSystem, written by Frank Tobin. http://pyzor.sourceforge.net/ .

Pyzor Install Hints

  • Be sure to run "pyzor discover" after you install Pyzor, so that you can download the server to contact.

Using Pyzor Site-wide

  • Note permissions advice concerning /etc/mail/spamassassin in RazorSiteWide and add the following to your /etc/mail/spamassassin/local.cf: pyzor_options --homedir /etc/mail/spamassassin

    • Now put some servers in that dir:

      pyzor --homedir /etc/mail/spamassassin discover

    • And finally, restart spamd:

      /etc/init.d/spamd restart

Is it working?

You can run SpamAssassin from the command line to figure out if it is using Pyzor. The process is described at RazorHowToTell, but the summary is to run the following from the command line:

  echo "test" | spamassassin -D pyzor 2>&1 | less

This test should return output similar to:

...
Oct  6 11:11:46.956 [10904] dbg: pyzor: network tests on, attempting Pyzor
Oct  6 11:11:52.055 [10904] dbg: pyzor: pyzor is available: /bin/pyzor
Oct  6 11:11:52.056 [10904] dbg: pyzor: opening pipe: /bin/pyzor --homedir /some/dir/.pyzor check < /tmp/.spamassassin10904BmyCb9tmp
Oct  6 11:11:52.344 [10904] dbg: pyzor: [10906] finished: exit 1
Oct  6 11:11:52.345 [10904] dbg: pyzor: check failed: no response
...

The "check failed: no response" does not indicate a problem, as this test does not pass in an actual properly-formatted email message. If you have an actual message handy, use that for your test; you should see output similar to:

...
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 /some/dir/.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
...

Pyzor on Debian

If you are using Debian, a pyzor package is available in the stable distribution.

Detailed instructions

Very detailed instructions on configuring pyzor for a personal Unix account are in SingleUserUnixInstall.

Reporting

Using SpamAssassin to submit spam is described in ReportingSpam.

Pyzor on Windows

It is possible to make Pyzor work on Windows with a little extra effort.

  • Download and install ActivePython from www.activestate.com.

  • Download and install Pyzor from http://pyzor.sourceforge.net/. You'll need something that can un-bzip2 the files. Installing simply means running the following from the folder you extracted pyzor into:

    python setup.py build
    python setup.py install
  • Create a folder somewhere for the pyzor config files. You can use your spamassassin folder if you like as it only creates a single file called servers. I used c:/python24/etc/pyzor
  • Create a pyzor.bat in your python folder (c:\python24 by default when I installed it), containing the following line, modified for your python folder path.
    @c:\python24\python c:/python24/scripts/pyzor --homedir c:/python24/etc/pyzor %1 %2 %3 %4 %5 %6 %7 %8 %9
  • Edit /Lib/site-packages/pyzor/client.py with the following changes:
    • Find signal.signal(signal.SIGALRM, handle_timeout) and put a # in front of it.
    • Find the section for: def time_call(self, call, varargs=(), kwargs=None): and change it to read like this:
          def time_call(self, call, varargs=(), kwargs=None):
              if kwargs is None:  kwargs  = {}
              return apply(call, varargs, kwargs)
  • From a command prompt in the python folder context, run the following where /python/pyzor is the folder you created in the previous step.
    pyzor discover
  • Now you are ready to configure SpamAssassin to use it.

  • (This is not necessary in v3.1.7) Edit your /site/lib/mail/spamassassin/Util.pm. Find the "sub helper_app_pipe_open_windows" section and the line that reads
    if ($stdinfile) { $cmd .= " <'$stdinfile'"; }"
    and replace it with
    if ($stdinfile) { $cmd .= " <\"$stdinfile\""; }"

    because Windows won't pipe a file with a space after the < and single quotes around it.

  • Edit v310.pre and uncomment the load for the Pyzor plugin.
  • Edit your local.cf and add configuration lines for pyzor. For example:
    use_pyzor   1
    pyzor_path c:\python24\pyzor.bat
    pyzor_timeout 10
  • That should do it. If you do a spamassassin --lint -D you should see pyzor

UsingPyzor (last edited 2012-10-06 19:42:55 by JohnHardin)