Open FrankJ1122 opened 7 years ago
Hello,
if you need to run the tests you can use http://orangeassassin.readthedocs.io/en/latest/intro.html as a guide
You seem to be missing the spoon==1.0.1
(looks like you have another version) and pydns==2.3.6
You don't need to change your python version, ideally you would create a virtualenv and install the dependencies for OA there. for python2.7 you would need to install
We plan to provide Debian and CentOS packages, and if you wish you can follow that work here https://github.com/SpamExperts/OrangeAssassin-build
Hi,
As we are dealing with huge spam volumes and we have spamassasin installed on the server. Could you let us know an insight into how should we proceed incorporating the OA rules on the server. Appreciate your thoughts on this.
Hello,
OrangeAssassin is supposed to be a drop-in replacement for SpamAssassin. So you would use the same rules for both of them.
You can take a look at our Documentation, especially at the Configuration and Writing Tests sections for more information.
Ideally you should not need to do anything more besides giving the appropriate paths to the -S and -C daemon options.
Hi, Thanks for your reply. I have followed the doc http://orangeassassin.readthedocs.io/en/latest/intro.html as recommended but stuck with the below errors on testing.
==== ==================================================================================================== FAILURES ===================================================================================================== _ TestDaemon.test_check_content_lenerror
self =
def test_check_content_len_error(self):
"""Check invalid content-length input error"""
process_row = "CHECK"
content_row = "Content-length: %s\r\n" % '-100000'
command = ("%s SPAMC/1.2\r\n%s\r\n%s\r\n" %
(process_row, content_row, GTUBE_MSG))
result = self.send_to_proc(command)
tests/functional/test_daemon.py:322:
self =
def send_to_proc(self, text):
connection = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
connection.settimeout(5)
connection.connect(("localhost", self.port))
E ConnectionRefusedError: [Errno 111] Connection refused
tests/functional/testdaemon.py:161: ConnectionRefusedError
---------------------------------------------------------------------------------------------- Captured stderr setup ----------------------------------------------------------------------------------------------
Traceback (most recent call last):
File "scripts/oad.py", line 16, in
self =
def test_check_non_spam(self):
"""Just check if the passed message isn't spam and verify the result"""
process_row = "CHECK"
content_row = "Content-length: %s\r\n" % self.len_test_msg
command = ("%s SPAMC/1.2\r\n%s\r\n%s\r\n" %
(process_row, content_row, TEST_MSG))
result = self.send_to_proc(command).split("\r\n", 4)
tests/functional/test_daemon.py:332:
self =
def send_to_proc(self, text):
connection = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
connection.settimeout(5)
connection.connect(("localhost", self.port))
E ConnectionRefusedError: [Errno 111] Connection refused
tests/functional/test_daemon.py:161: ConnectionRefusedError ___ TestDaemon.test_check_spam ____
self =
def test_check_spam(self):
"""Just check if the passed message is spam and verify the result"""
process_row = "CHECK"
content_row = "Content-length: %s\r\n" % self.content_len
command = ("%s SPAMC/1.2\r\n%s\r\n%s\r\n" %
(process_row, content_row, GTUBE_MSG))
result = self.send_to_proc(command).split("\r\n", 4)
tests/functional/test_daemon.py:311:
self =
def send_to_proc(self, text):
connection = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
connection.settimeout(5)
connection.connect(("localhost", self.port))
E ConnectionRefusedError: [Errno 111] Connection refused
tests/functional/test_daemon.py:161: ConnectionRefusedError __ TestDaemon.test_ping ___
self =
def test_ping(self):
"""Return a confirmation that oad.py/spamd is alive."""
process = "PING"
command = "%s SPAMC/1.2\r\n" % process
result = self.send_to_proc(command)
tests/functional/test_daemon.py:191:
self =
def send_to_proc(self, text):
connection = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
connection.settimeout(5)
connection.connect(("localhost", self.port))
E ConnectionRefusedError: [Errno 111] Connection refused
tests/functional/test_daemon.py:161: ConnectionRefusedError ___ TestDaemon.test_ping_error ____
self =
def test_ping_error(self):
"""Check unknown process input error"""
process = "PINasdfG"
command = "%s SPAMC/1.2\r\n" % process
result = self.send_to_proc(command)
tests/functional/test_daemon.py:198:
self =
def send_to_proc(self, text):
connection = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
connection.settimeout(5)
connection.connect(("localhost", self.port))
E ConnectionRefusedError: [Errno 111] Connection refused
tests/functional/test_daemon.py:161: ConnectionRefusedError __ TestDaemon.test_process_content_body_non_spam __
self =
def test_process_content_body_non_spam(self):
process_row = "PROCESS"
content_row = "Content-length: %s\r\n" % self.len_test_msg
command = ("%s SPAMC/1.2\r\n%s\r\n%s\r\n" %
(process_row, content_row, TEST_MSG))
result = self.send_to_proc(command).split("\r\n\r\n", 1)[1]
tests/functional/test_daemon.py:299:
self =
def send_to_proc(self, text):
connection = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
connection.settimeout(5)
connection.connect(("localhost", self.port))
E ConnectionRefusedError: [Errno 111] Connection refused
tests/functional/test_daemon.py:161: ConnectionRefusedError ____ TestDaemon.test_process_content_body_spam ____
self =
def test_process_content_body_spam(self):
process_row = "PROCESS"
content_row = "Content-length: %s\r\n" % self.content_len
command = ("%s SPAMC/1.2\r\n%s\r\n%s\r\n" %
(process_row, content_row, GTUBE_MSG))
result = self.send_to_proc(command).split("\r\n\r\n", 1)[1]
tests/functional/test_daemon.py:277:
self =
def send_to_proc(self, text):
connection = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
connection.settimeout(5)
connection.connect(("localhost", self.port))
E ConnectionRefusedError: [Errno 111] Connection refused
tests/functional/test_daemon.py:161: ConnectionRefusedError ___ TestDaemon.test_process_content_disposition ___
self =
def test_process_content_disposition(self):
"""Process this message as described above and return content
disposition """
process_row = "PROCESS"
content_row = "Content-length: %s\r\n" % self.content_len
command = ("%s SPAMC/1.2\r\n%s\r\n%s\r\n" %
(process_row, content_row, GTUBE_MSG))
result = self.send_to_proc(command).split("\r\n\r\n", 1)[1]
tests/functional/test_daemon.py:239:
self =
def send_to_proc(self, text):
connection = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
connection.settimeout(5)
connection.connect(("localhost", self.port))
E ConnectionRefusedError: [Errno 111] Connection refused
tests/functional/test_daemon.py:161: ConnectionRefusedError ____ TestDaemon.test_process_content_disposition2_spam ____
self =
def test_process_content_disposition2_spam(self):
process_row = "PROCESS"
content_row = "Content-length: %s\r\n" % self.content_len
command = ("%s SPAMC/1.2\r\n%s\r\n%s\r\n" %
(process_row, content_row, GTUBE_MSG))
result = self.send_to_proc(command).split("\r\n\r\n", 1)[1]
tests/functional/test_daemon.py:265:
self =
def send_to_proc(self, text):
connection = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
connection.settimeout(5)
connection.connect(("localhost", self.port))
E ConnectionRefusedError: [Errno 111] Connection refused
tests/functional/test_daemon.py:161: ConnectionRefusedError ____ TestDaemon.test_process_content_encoding_non_spam ____
self =
def test_process_content_encoding_non_spam(self):
"""Process this multi-part message and return the content transfer
encoding"""
process_row = "PROCESS"
content_row = "Content-length: %s\r\n" % self.multipart_content_len
command = ("%s SPAMC/1.2\r\n%s\r\n%s\r\n" %
(process_row, content_row, MULTIPART_MSG))
result = self.send_to_proc(command).split("\r\n\r\n", 1)[1]
tests/functional/test_daemon.py:253:
self =
\nTesting rule one-two-three\n
Version information
We are currently testing orangeassasin as a replacement for spamassasin. We are unable to find any docs related to the installation steps, but however we have started the installation process. We are using orangeassasin to be setup on the Cpanel server. We have both python2.7 and python3 installed on the server along with the pip.
I would like to know if there is any valid documentation of orange assasin to be used in cpanel server
Note: we cannot interfere the default python version on the server as it would break yum packages on the server.
Currently as a part of the test we are using test scripts
Steps to replicate
use script py.test tests/unit/
root@orangeassassin [/]# cd /usr/src/Python-2.7.6/OrangeAssassin/ root@orangeassassin [/usr/src/Python-2.7.6/OrangeAssassin]# py.test tests/unit/ =============================================================================================== test session starts =============================================================================================== platform linux2 -- Python 2.7.6, pytest-3.0.7, py-1.4.33, pluggy-0.4.0 rootdir: /usr/src/Python-2.7.6/OrangeAssassin, inifile: plugins: cov-2.4.0 collected 1004 items / 3 errors
===================================================================================================== ERRORS ====================================================================================================== _ ERROR collecting tests/unit/test_daemon.py __ tests/unit/test_daemon.py:12: in
import scripts.oad
scripts/oad.py:16: in
import oa.server
oa/server.py:34: in
class RequestHandler(spoon.server.Gulp):
E AttributeError: 'module' object has no attribute 'Gulp'
_ ERROR collecting tests/unit/test_server.py __
tests/unit/test_server.py:14: in
import oa.server
oa/server.py:34: in
class RequestHandler(spoon.server.Gulp):
E AttributeError: 'module' object has no attribute 'Gulp'
__ ERROR collecting tests/unit/test_plugins/test_spf.py ___
ImportError while importing test module '/usr/src/Python-2.7.6/OrangeAssassin/tests/unit/test_plugins/test_spf.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
tests/unit/test_plugins/test_spf.py:11: in
import oa.plugins.spf
oa/plugins/spf.py:8: in
import spf
/usr/local/lib/python2.7/site-packages/spf.py:110: in
import DNS # http://pydns.sourceforge.net
E ImportError: No module named DNS
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 3 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
============================================================================================= 3 error in 3.36 seconds =============================================================================================