Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hi issues when testing orange assasin #76

Open
FrankJ1122 opened this issue May 5, 2017 · 12 comments
Open

Hi issues when testing orange assasin #76

FrankJ1122 opened this issue May 5, 2017 · 12 comments
Labels

Comments

@FrankJ1122
Copy link

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 =============================================================================================

@bitsikas
Copy link
Contributor

bitsikas commented May 8, 2017

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

  • requirements/base.txt
  • requirements/python2.txt
  • requirements/tests.txt

We plan to provide Debian and CentOS packages, and if you wish you can follow that work here https://github.com/SpamExperts/OrangeAssassin-build

@FrankJ1122
Copy link
Author

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.

@bitsikas
Copy link
Contributor

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.

@FrankJ1122
Copy link
Author

FrankJ1122 commented May 14, 2017

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_len_error _____________________________________________________________________________________

self = <tests.functional.test_daemon.TestDaemon testMethod=test_check_content_len_error>

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 = <tests.functional.test_daemon.TestDaemon testMethod=test_check_content_len_error>
text = 'CHECK SPAMC/1.2\r\nContent-length: -100000\r\n\r\nSubject: test\n\nXJSC4JDBQADN1.NSBN32IDNENGTUBE-STANDARD-ANTI-UBE-TEST-EMAILC.34X\n\r\n'

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
---------------------------------------------------------------------------------------------- Captured stderr setup ----------------------------------------------------------------------------------------------
Traceback (most recent call last):
File "scripts/oad.py", line 16, in
import oa.server
File "/usr/local/lib/python2.7/site-packages/oa/server.py", line 34, in
class RequestHandler(spoon.server.Gulp):
AttributeError: 'module' object has no attribute 'Gulp'
_________________________________________________________________________________________ TestDaemon.test_check_non_spam __________________________________________________________________________________________

self = <tests.functional.test_daemon.TestDaemon testMethod=test_check_non_spam>

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 = <tests.functional.test_daemon.TestDaemon testMethod=test_check_non_spam>
text = 'CHECK SPAMC/1.2\r\nContent-length: 103\r\n\r\nSubject: Email Flow Test\nFrom: Geo [email protected]\nTo: [email protected]\n\n\nThis is a test message.\n\n\n\r\n'

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 = <tests.functional.test_daemon.TestDaemon testMethod=test_check_spam>

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 = <tests.functional.test_daemon.TestDaemon testMethod=test_check_spam>
text = 'CHECK SPAMC/1.2\r\nContent-length: 86\r\n\r\nSubject: test\n\nXJSC4JDBQADN1.NSBN32IDNENGTUBE-STANDARD-ANTI-UBE-TEST-EMAILC.34X\n\r\n'

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 = <tests.functional.test_daemon.TestDaemon testMethod=test_ping>

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 = <tests.functional.test_daemon.TestDaemon testMethod=test_ping>, text = 'PING SPAMC/1.2\r\n'

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 = <tests.functional.test_daemon.TestDaemon testMethod=test_ping_error>

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 = <tests.functional.test_daemon.TestDaemon testMethod=test_ping_error>, text = 'PINasdfG SPAMC/1.2\r\n'

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 = <tests.functional.test_daemon.TestDaemon testMethod=test_process_content_body_non_spam>

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 = <tests.functional.test_daemon.TestDaemon testMethod=test_process_content_body_non_spam>
text = 'PROCESS SPAMC/1.2\r\nContent-length: 103\r\n\r\nSubject: Email Flow Test\nFrom: Geo [email protected]\nTo: [email protected]\n\n\nThis is a test message.\n\n\n\r\n'

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 = <tests.functional.test_daemon.TestDaemon testMethod=test_process_content_body_spam>

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 = <tests.functional.test_daemon.TestDaemon testMethod=test_process_content_body_spam>
text = 'PROCESS SPAMC/1.2\r\nContent-length: 86\r\n\r\nSubject: test\n\nXJSC4JDBQADN1.NSBN32IDNENGTUBE-STANDARD-ANTI-UBE-TEST-EMAILC.34X\n\r\n'

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 = <tests.functional.test_daemon.TestDaemon testMethod=test_process_content_disposition>

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 = <tests.functional.test_daemon.TestDaemon testMethod=test_process_content_disposition>
text = 'PROCESS SPAMC/1.2\r\nContent-length: 86\r\n\r\nSubject: test\n\nXJSC4JDBQADN1.NSBN32IDNENGTUBE-STANDARD-ANTI-UBE-TEST-EMAILC.34X\n\r\n'

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 = <tests.functional.test_daemon.TestDaemon testMethod=test_process_content_disposition2_spam>

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 = <tests.functional.test_daemon.TestDaemon testMethod=test_process_content_disposition2_spam>
text = 'PROCESS SPAMC/1.2\r\nContent-length: 86\r\n\r\nSubject: test\n\nXJSC4JDBQADN1.NSBN32IDNENGTUBE-STANDARD-ANTI-UBE-TEST-EMAILC.34X\n\r\n'

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 = <tests.functional.test_daemon.TestDaemon testMethod=test_process_content_encoding_non_spam>

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 = <tests.functional.test_daemon.TestDaemon testMethod=test_process_content_encoding_non_spam>
text = 'PROCESS SPAMC/1.2\r\nContent-length: 1205\r\n\r\nFrom: Marco Antonio Islas Cruz [email protected]\nContent-Type:...">

\nTesting rule one-two-three\n
\n--Apple-Mail=_9311E301-2E56-423D-B730-30A522F3844C--\n\r\n'

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_len_error ____________________________________________________________________________________

self = <tests.functional.test_daemon.TestDaemon testMethod=test_process_content_len_error>

def test_process_content_len_error(self):
    """Check invalid content-length input error"""
    process_row = "PROCESS"
    missing = ''
    content_row = "Content-length: %s\r\n" % missing
    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:290:


self = <tests.functional.test_daemon.TestDaemon testMethod=test_process_content_len_error>
text = 'PROCESS SPAMC/1.2\r\nContent-length: \r\n\r\nSubject: test\n\nXJSC4JDBQADN1.NSBN32IDNENGTUBE-STANDARD-ANTI-UBE-TEST-EMAILC.34X\n\r\n'

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_type _______________________________________________________________________________________

self = <tests.functional.test_daemon.TestDaemon testMethod=test_process_content_type>

def test_process_content_type(self):
    """Process this message as described above and return modified
        message"""
    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:208:


self = <tests.functional.test_daemon.TestDaemon testMethod=test_process_content_type>
text = 'PROCESS SPAMC/1.2\r\nContent-length: 86\r\n\r\nSubject: test\n\nXJSC4JDBQADN1.NSBN32IDNENGTUBE-STANDARD-ANTI-UBE-TEST-EMAILC.34X\n\r\n'

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_type_non_spam __________________________________________________________________________________

self = <tests.functional.test_daemon.TestDaemon testMethod=test_process_content_type_non_spam>

def test_process_content_type_non_spam(self):
    """Process this multipart-message and return the content-type
        message"""
    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:221:


self = <tests.functional.test_daemon.TestDaemon testMethod=test_process_content_type_non_spam>
text = 'PROCESS SPAMC/1.2\r\nContent-length: 1205\r\n\r\nFrom: Marco Antonio Islas Cruz [email protected]\nContent-Type:...">

\nTesting rule one-two-three\n
\n--Apple-Mail=_9311E301-2E56-423D-B730-30A522F3844C--\n\r\n'

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_report_if_spam __________________________________________________________________________________________

self = <tests.functional.test_daemon.TestDaemon testMethod=test_report_if_spam>

def test_report_if_spam(self):
    """Check if message is not spam, and see no score plus report"""
    process_row = "REPORT_IFSPAM"
    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")

tests/functional/test_daemon.py:411:


self = <tests.functional.test_daemon.TestDaemon testMethod=test_report_if_spam>
text = 'REPORT_IFSPAM SPAMC/1.2\r\nContent-length: 1205\r\n\r\nFrom: Marco Antonio Islas Cruz [email protected]\nContent...">

\nTesting rule one-two-three\n
\n--Apple-Mail=_9311E301-2E56-423D-B730-30A522F3844C--\n\r\n'

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_report_if_spam_true _______________________________________________________________________________________

self = <tests.functional.test_daemon.TestDaemon testMethod=test_report_if_spam_true>

def test_report_if_spam_true(self):
    """Check if message is spam, and return score plus report if
        the message is spam"""
    process_row = "REPORT_IFSPAM"
    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)

tests/functional/test_daemon.py:425:


self = <tests.functional.test_daemon.TestDaemon testMethod=test_report_if_spam_true>
text = 'REPORT_IFSPAM SPAMC/1.2\r\nContent-length: 86\r\n\r\nSubject: test\n\nXJSC4JDBQADN1.NSBN32IDNENGTUBE-STANDARD-ANTI-UBE-TEST-EMAILC.34X\n\r\n'

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_report_spam ___________________________________________________________________________________________

self = <tests.functional.test_daemon.TestDaemon testMethod=test_report_spam>

def test_report_spam(self):
    """Check if message is spam or not, and return score plus report"""
    process_row = "REPORT"
    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)

tests/functional/test_daemon.py:396:


self = <tests.functional.test_daemon.TestDaemon testMethod=test_report_spam>
text = 'REPORT SPAMC/1.2\r\nContent-length: 86\r\n\r\nSubject: test\n\nXJSC4JDBQADN1.NSBN32IDNENGTUBE-STANDARD-ANTI-UBE-TEST-EMAILC.34X\n\r\n'

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_symbols_bad_header_line _____________________________________________________________________________________

self = <tests.functional.test_daemon.TestDaemon testMethod=test_symbols_bad_header_line>

def test_symbols_bad_header_line(self):
    """Check bad command sent scenario """
    process_row = "SYMBOL"
    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)

tests/functional/test_daemon.py:371:


self = <tests.functional.test_daemon.TestDaemon testMethod=test_symbols_bad_header_line>
text = 'SYMBOL SPAMC/1.2\r\nContent-length: 86\r\n\r\nSubject: test\n\nXJSC4JDBQADN1.NSBN32IDNENGTUBE-STANDARD-ANTI-UBE-TEST-EMAILC.34X\n\r\n'

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_symbols_missing_key_content_error ________________________________________________________________________________

self = <tests.functional.test_daemon.TestDaemon testMethod=test_symbols_missing_key_content_error>

def test_symbols_missing_key_content_error(self):
    """Check missing ":" in content-length input error"""

    process_row = "SYMBOLS"
    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)

tests/functional/test_daemon.py:361:


self = <tests.functional.test_daemon.TestDaemon testMethod=test_symbols_missing_key_content_error>
text = 'SYMBOLS SPAMC/1.2\r\nContent-length 86\r\n\r\nSubject: test\n\nXJSC4JDBQADN1.NSBN32IDNENGTUBE-STANDARD-ANTI-UBE-TEST-EMAILC.34X\n\r\n'

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_symbols_non_spam _________________________________________________________________________________

can you help me trouble shoot. I have installed all the requirements and necessary plugins. Since I am using cpanel test environment the MINI-DNS-Server-master was cloned and installed manually.
apart from that the installation is as per described on the docs.
Could you recommend any suggestions to trouble shoot.

@bitsikas
Copy link
Contributor

Hello,

would it be easy to post the result of pip freeze and python -VV ? It looks like an issue with the spoon package but I can't reproduce it locally.

@FrankJ1122
Copy link
Author

I am using python3.6 that is custom compiled on the server. Please have a check.

root@orangeassassin [/]# /usr/local/bin/python3.6 -VV
Python 3.6.1 (default, May 3 2017, 11:21:07)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-18)]

root@orangeassassin [/]# /usr/local/bin/pip3.6 freeze
contextlib2==0.5.5
coverage==4.4
dill==0.2.5
dkimpy==0.5.6
dnslib==0.9.6
dnspython3==1.12.0
future==0.15.2
langdetect==1.0.6
memory-profiler==0.47
Mini-DNS==1.2.0
mock==2.0.0
olefile==0.44
OrangeAssassin==1.0b0
pbr==3.0.0
pep8==1.7.0
Pillow==4.0.0
psutil==5.2.2
py==1.4.33
py3dns==3.1.0
pygeoip==0.3.2
PyMySQL==0.7.11
PyPDF2==1.25.1
pyspf==2.0.12
pytest==2.9.1
pytest-cov==2.2.1
python-coveralls==2.7.0
python-dateutil==2.6.0
PyYAML==3.12
pyzor==1.0.0
raven==5.13.0
requests==2.14.2
se-profile==1.0.0
sh==1.12.13
six==1.10.0
spoon==1.0.1
SQLAlchemy==1.0.12

@bitsikas
Copy link
Contributor

They seem fine, there are a couple of differences but they should not be important. Is there any reason the server would not be able to start/bind port 30783 in your test environment ?

@FrankJ1122
Copy link
Author

We have no firewall rules that may block onto the ports in an allowed range that includes the mentioned port number. But to clarify could you please let us know if you mean to configure the bind( or named) with port 30783.

Also as it turns to be tedious I am currently trying to incorporate the OA rule sets to Spamassasin. Could you let us know if there would be any special settings needed to enable this feature. I am aware that we could use the .cf rules to be added to make the rule sets added on the Spamassasin. ( am I correct in my approach?)

@tonyandrewmeyer
Copy link
Contributor

Also as it turns to be tedious I am currently trying to incorporate the OA rule sets to Spamassasin.

OA does not have any rule sets, as mentioned earlier. It's a replacement for the daemon, intended to be used with regular SA rule sets.

@bitsikas
Copy link
Contributor

@FrankJ1122 You need to get the relevant rules (.pre files and .cf files) from spamassassin and then point the daemons -C/-S options to the location of those files. We will provide them when we release our own .deb/.rpm packages but until then that's the only way to get them

as for port 30783. The tests are attempting to run the server on that port and for some reason are failing. By default the daemon binds on 783.

if you want to debug this you can start by running this command

oad.py -p 30783 --log-file /tmp/logfile.log -C /tmp/ -S /tmp/ -D

It should show 2017-05-22 13:53:28,970 [28388] DEBUG Listening on ('0.0.0.0', 30783) and no errors

@FrankJ1122
Copy link
Author

Thanks for the reply. Let me try it out

@FrankJ1122
Copy link
Author

FrankJ1122 commented May 22, 2017

I get the below results

root@orangeassassin [/usr/src/Python-2.7.6/OrangeAssassin/scripts]# oad.py -p 30783 --log-file /tmp/logfile.log -C /tmp/ -S /tmp/ -D
2017-05-22 04:05:35,876 [18077] DEBUG Listening on ('0.0.0.0', 30783)
2017-05-22 04:05:35,877 [18077] DEBUG Unable to set IPV6_V6ONLY to false [Errno 92] Protocol not available
2017-05-22 04:05:35,878 [18077] INFO Using default nameservers
2017-05-22 04:05:35,878 [18077] INFO 0 rules loaded

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants