OrangeAssassin is an open-source drop-in replacement for SpamAssassin.
OrangeAssassin is compatible with the following Python versions:
- Python 2.7
- Python 3.2 and later
Getting the source¶
To clone the repository using git simply run:
git clone https://github.com/SpamExperts/OrangeAssassin
Please feel free to fork us and submit your pull requests.
To run the project’s tests you will need to first:
- Create a python virtualenv and activate it (Recommended only)
- Clone the repository from GitHub.
- Install sqlalchemy or pymysql package.
- Install the base dependencies from requirements/base.txt with pip
- Install the the dependencies for the python version you are using from the requirements folder
- Install the dependencies for running tests from requirements/tests.txt
- Download the GeoIP databases (for IPv4 and IPv6)
- Run the setup.py script
Some requirements (e.g. Pillow) require some additional build dependencies when installing them.
The OrangeAssassin tests are split into unittest and functional tests.
Unitests perform checks against the current source code and not the installed version of OrangeAssassin. To run all the unittests suite:
Functional tests perform checks against the installed version of OrangeAssassin and not the current source code. These are more extensive and generally take longer to run. They also might need special setup. To run the full suite of functional tests:
env USE_PICKLES=0 py.test tests/functional/ (or py.test tests/functional/)
If you want to compile rules and avoid re-parsing:
env USE_PICKLES=1 py.test tests/functional/
Or you can run all the tests with just:
An example for Python3 would be:
sudo apt-get install python3-dev libjpeg-dev build-essential zlib1g-dev virtualenv -p /usr/bin/python3 ~/oa-env source ~/oa-env/bin/activate git clone https://github.com/SpamExperts/OrangeAssassin cd OrangeAssassin pip install sqlalchemy || pip install pymysql pip install -r requirements/base.txt pip install -r requirements/python3.txt pip install -r requirements/tests.txt wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz gunzip GeoIP.dat.gz wget http://geolite.maxmind.com/download/geoip/database/GeoIPv6.dat.gz gunzip GeoIPv6.dat.gz python setup.py install env USE_PICKLES=0 py.test env USE_PICKLES=0 py.test
See also the .travis.yml file where all these instructions are set for the automatic builds.
In order to build the documentation based on the docs files from the repository:
- Run the same steps for running the tests (including installing all requirements, installing OrangeAssassin, etc.).
- Install the documentation libraries from requirements/docs.txt
- Change directory to docs
- Run make html
- The HTML version of the documentation will be generated in the docs/_build/ directory.
See also the helper script docs/generate_plugin_doc.py that generates a documentation page for the specified plugin. After adding a new plugin:
- Use the script to generate a new page for it
- Add a reference to the list from docs/plugins.rst
- Add autodoc to docs/pad.plugins.rst