Install Pyzor: Difference between revisions

From QmailToaster
Jump to navigation Jump to search
No edit summary
No edit summary
 
(11 intermediate revisions by the same user not shown)
Line 1: Line 1:
[[User_Tips_%26_Tricks#Anti_Spam|Back]]<br>
[[User_Tips_%26_Tricks#Anti_Spam|Back]]<br>


===Install Pyzor===
[[https://www.pyzor.org/en/latest/installation.html#downloading Documentation]]:
# dnf install -y pyzor
# pyzor --homedir /etc/mail/spamassassin/pyzor discover
# pyzor --homedir /etc/mail/spamassassin/pyzor discover
Make the servers file readable by all
# cd /etc/mail spamassassin/pyzor
# chmod a+r servers
Run a check -
# echo "test" | spamassassin -D pyzor 2>&1 | less
You should see some output like this<br>
Feb  9 16:24:58.824 [23979] dbg: pyzor: network tests on, attempting Pyzor
Feb  9 16:24:59.787 [23979] dbg: pyzor: pyzor is available: /usr/bin/pyzor
Feb  9 16:24:59.788 [23979] dbg: pyzor: opening pipe: /usr/bin/pyzor check < /tmp/.spamassassin23979z26KDDtmp
Feb  9 16:24:59.841 [23979] dbg: pyzor: [23981] finished: exit 1
Feb  9 16:24:59.842 [23979] dbg: pyzor: check failed: no response<br>
Add the following lines to the end of /etc/spamassassin/local.cf
pyzor_options --homedir /etc/mail/spamassassin/pyzor<br>
# systemctl restart spamassassin


Jake Vickers <jake@v2gnu.com> September 19, 2006
[[https://www.binarytides.com/install-spamassassin-with-postfix-dovecot/ Razor]]
Scott Hughes - Updated - June 9, 2009


<blockquote>&quot;Pyzor is a collaborative, networked system to detect and block spam using identifying digests of messages.&quot;<br /> (from the Pyzor website: http://pyzor.sourceforge.net/)</blockquote>
<!--
 
  Make sure that pyzor is enabled in your /etc/mail/spamassassin/v310.pre file:
Installing Pyzor is rather easy. You need to have python installed first. Here are the steps to install from source:
 
Download pyzor from Sourceforge (https://sourceforge.net/projects/pyzor/files/latest/download).
 
<pre># wget https://sourceforge.net/projects/pyzor/files/latest/download</pre>
 
[[https://www.pyzor.org/en/latest/installation.html#downloading|Documentation]]
Unpack the package:
<pre># tar xf download</pre>
 
Move into the dir:
<pre># cd pyzor-0.7.0</pre>
 
<span style="color:red">
Pyzor requires at least Python 2.6<br>
To install this distribution, simply run the following:
        python setup.py build
        python setup.py install<br>
Note that your system might install the modules and scripts
with non-world-readable permissions.
Correct this with a command such as:<br>
        chmod -R a+rX /usr/share/doc/pyzor \
                /usr/lib/python2.2/site-packages/pyzor \
                /usr/bin/pyzor /usr/bin/pyzord<br>
To use the server, the Python gdbm module or MySQLdb module is required.
You can generally check if you have the gdbm module by executing:
        python -c 'import gdbm' && echo 'gdbm found'
  You can generally check if you have the MySQLdb module by executing:
        python -c 'import MySQLdb' && echo 'MySQLdb found'<br>
The gdbm module is available at:
        Debian GNU/Linux:
                http://packages.debian.org/stable/interpreters/python-gdbm.html
        Gentoo Linux:
                Will be built with Python if the gdbm library is found.
                If it isn't there with your Python, try stealing
                the FreeBSD setup.py patchfile in their ports to
                install just the gdbm module, or simply re-install
                Python.
        FreeBSD:
                ports/databases/py-gdbm
        tar.gz:
                included in the Python distribution
                (not sure of the precise procedure for simply installing
                the gdbm module; try stealing the FreeBSD setup.py patchfile
                in their ports).<br>
Pyzor also works with Python3.3. The code will be automatically refactored with
2to3 during the setup:
        python3.3 setup.py install<br>
Note that the MySQLdb library does not currently support Python3.<br>
See docs/usage.html for usage documentation, and if you are upgrading
from another version of Pyzor, please read the UPGRADING file.
</span>
 
The 'pyzor discover' command tells pyzor to contact home and find the latest list of servers to use. I add this to a cron to be run nightly:
 
<pre>17 2 * * * pyzor discover</pre>
 
Make sure that pyzor is enabled in your /etc/mail/spamassassin/v310.pre file:


<pre># Pyzor - perform Pyzor message checks.
<pre># Pyzor - perform Pyzor message checks.
Line 94: Line 52:
|-
|-
|}
|}
 
-->
== [[User Tips & Tricks]] ==
== [[User Tips & Tricks]] ==

Latest revision as of 18:37, 16 April 2024

Back

[Documentation]:

# dnf install -y pyzor
# pyzor --homedir /etc/mail/spamassassin/pyzor discover
# pyzor --homedir /etc/mail/spamassassin/pyzor discover
Make the servers file readable by all
# cd /etc/mail spamassassin/pyzor
# chmod a+r servers
Run a check -
# echo "test" | spamassassin -D pyzor 2>&1 | less
You should see some output like this
Feb 9 16:24:58.824 [23979] dbg: pyzor: network tests on, attempting Pyzor Feb 9 16:24:59.787 [23979] dbg: pyzor: pyzor is available: /usr/bin/pyzor Feb 9 16:24:59.788 [23979] dbg: pyzor: opening pipe: /usr/bin/pyzor check < /tmp/.spamassassin23979z26KDDtmp Feb 9 16:24:59.841 [23979] dbg: pyzor: [23981] finished: exit 1 Feb 9 16:24:59.842 [23979] dbg: pyzor: check failed: no response
Add the following lines to the end of /etc/spamassassin/local.cf pyzor_options --homedir /etc/mail/spamassassin/pyzor
# systemctl restart spamassassin
[Razor]

User Tips & Tricks