Code Monkey home page Code Monkey logo

docker-spamassassin's Introduction

github.com/tiredofit/docker-spamassassin

GitHub release Build Status Docker Stars Docker Pulls Become a sponsor Paypal Donate

About

This will build a Docker Image for Spamassassin - A message content scanner for spam.

Maintainer

Table of Contents

Prerequisites and Assumptions

  • This image doesn't do much on it's own, you must use a complemenary service to pass messages or data to it via port 783.

Installation

Build from Source

Clone this repository and build the image with docker build -t (imagename) .

Prebuilt Images

Builds of the image are available on Docker Hub

docker pull docker.io/tiredofit/spamassassin:(imagetag)

Builds of the image are also available on the Github Container Registry

docker pull ghcr.io/tiredofit/docker-spamassassin:(imagetag)

The following image tags are available along with their tagged release based on what's written in the Changelog:

Container OS Tag
Alpine :latest

Multi Architecture

Images are built primarily for amd64 architecture, and may also include builds for arm/v7, arm64 and others. These variants are all unsupported. Consider sponsoring my work so that I can work with various hardware. To see if this image supports multiple architecures, type docker manifest (image):(tag)

Configuration

Quick Start

  • The quickest way to get started is using docker-compose. See the examples folder for a working compose.yml that can be modified for development or production use.

  • Set various environment variables to understand the capabilities of this image.

  • Map persistent storage for access to configuration and data files for backup.

Persistent Storage

The following directories are used for configuration and can be mapped for persistent storage.

Directory Description
/logs/ Spamassassin Logs
/config/ Configuration
/data/ Volatile Data (Downloaded Patterns)

Environment Variables

Base Images used

This image relies on an Alpine Linux base image that relies on an init system for added capabilities. Outgoing SMTP capabilities are handlded via msmtp. Individual container performance monitoring is performed by zabbix-agent. Additional tools include: bash,curl,less,logrotate,nano,vim.

Be sure to view the following repositories to understand all the customizable options:

Image Description
OS Base Customized Image based on Alpine Linux
Parameter Description Default
CHILD_MAX Max Children 5
CHILD_MAX_CONNECTIONS Max connections per child 200
CHILD_MAX_SPARE Max Spare Children 2
CHILD_MIN Minimum Child Process 1
CHILD_MIN_SPARE Minimum Spare Children 1
CONFIG_PATH Config directory /config/
DATA_PATH Updates / Rulesets directory /data/
ENABLE_LEARNING Enable Learning/Reporting TRUE
ENABLE_ROUND_ROBIN Enable Roundrobin Forking for childs FALSE
ENABLE_UPDATES Enable Ruleset Updates TRUE
LISTEN_PORT TCP Listen Port 783
LOG_FILE Log File spamassassin.log
LOG_PATH Log Logcation /logs/
PID_FILE PID File spamassassin.pid
PID_PATH PID Path /var/run/spamassassin/
TIMEOUT_CHILD Child Timeout in Seconds 300
TIMEOUT_IDENT Ident Timeout in Seconds 5
TIMEOUT_TCP TCP Timeout in Seconds 30
UPDATE_PERIOD Cron Expression when to perform updates 15 23 * * *

Networking

Port Description
783 Spamassassin Listening Port

Maintenance

Shell Access

For debugging and maintenance purposes you may want access the containers shell.

docker exec -it (whatever your container name is) bash

Support

These images were built to serve a specific need in a production environment and gradually have had more functionality added based on requests from the community.

Usage

  • The Discussions board is a great place for working with the community on tips and tricks of using this image.
  • Sponsor me for personalized support

Bugfixes

  • Please, submit a Bug Report if something isn't working as expected. I'll do my best to issue a fix in short order.

Feature Requests

  • Feel free to submit a feature request, however there is no guarantee that it will be added, or at what timeline.
  • Sponsor me regarding development of features.

Updates

  • Best effort to track upstream changes, More priority if I am actively using the image in a production environment.
  • Sponsor me for up to date releases.

License

MIT. See LICENSE for more details.

References

docker-spamassassin's People

Contributors

hleskien avatar sustmi avatar tiredofit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

docker-spamassassin's Issues

error: config: no rules were found! Do you need to run 'sa-update'?

Summary

Configuration isn't being detected, do I need to apply a default configuration or is what's in config all that I need?

spamassassin-app    | 2021-08-24-17:21:08 [STARTING] ** [spamassassin] [35] Starting spamassassin
spamassassin-app    | 2021-08-24-17:21:08 [STARTING] ** [monitoring] [35] Starting Zabbix Agent (modern) 5.4.3
spamassassin-app    | Aug 24 17:21:09.284 [4204] error: config: no rules were found! Do you need to run 'sa-update'?
spamassassin-app    | config: no rules were found!  Do you need to run 'sa-update'?

Steps to reproduce

docker-compose.yml:

version: '3.7'
services:
  spamassassin-app:
    image: tiredofit/spamassassin:latest
    container_name: spamassassin-app
    ports: 
    - 783:783
    volumes:
    - ./logs/spamassassin:/var/log/spamassassin
    - ./conf:/etc/mail/spamassassin
    - ./data:/var/lib/spamassassin
    networks:
    - internal
    - services
    restart: always
  clamav-app:
    image: tiredofit/clamav:latest
    container_name: clamav-app
    ports: 
    - 3310:3310
    volumes:
    - ./data:/var/lib/clamav
    - ./logs:/var/log/clamav
    environment:
    - DEFINITIONS_UPDATE_FREQUENCY=60
    networks: 
    - internal
    - services
    restart: always
networks:
  internal:
    external: false
  services:
    external: true

What is the expected correct behavior?

The app starts up without issue.

Environment

  • Image version / tag: latest
  • Host OS: Ubuntu 20.04

Possible fixes

Seems like I don't have the correct pathing for the configuration set up, but this was pulled from the example in the example directory.

Port is wrong

The port is wrong (783) and it look me a while to figure out what was up... port is actually 737.

This is a really great little docker image -- thank you for it!

Do you need to run 'sa-update'?

Summary

error: config: no rules were found! Do you need to run 'sa-update'?
config: no rules were found! Do you need to run 'sa-update'?
[spamassassin] POTENTIAL RUNWAY DETECTECTED: Disabling 10-spamassassin service because it has tried restarting '50' times

Steps to reproduce

Running docker on windows server 2020 and windows 11

No Image Published for Release 2.0.10?

I'm looking at DockerHub tags and there does not seem to have been a published version of 2.0.10:

image

Was this intentional?

I looked at the commit history and it looks like there has only been 1 change since the 2.0.10 build, but as a matter of principle we do not use latest in our build scripts.

I could pull the latest image by its hash, but I'm not sure how DockerHub handles untagged images, so this could be risky. Even if it is safe, it makes maintenance more difficult. Without a pinned tag, there will be no easy way to determine what changed between our current version and the new latest version.

Appreciate your work maintaining this repo and welcome any feedback you may have.

Please provide a way to overwrite the nameserver

Hi,

the image has the google nameservers hardwired which in turn means that dns base blacklists don't work or are blocked.

I've "fixed" this now by overriding /etc/resolv.conf but maybe there could be a more general solution (maybe using /config/resolv.conf if it exists?).

Access Forbidden on startup of docker container

I just tried to get the docker container running with docker-compose but I always get an access forbidden error. It seems that the container attempts to open the link https://registry.selfdesign.org/v2/docker/spamassassin/manifests/latest which needs authentication. Is there a way to configure the authentication for this link or is this a bug?

docker-compose up
[+] Running 0/1
 ⠿ spamassassin-app Error                                                                                                                         1.3s
Error response from daemon: Head "https://registry.selfdesign.org/v2/docker/spamassassin/manifests/latest": denied: access forbidden

ENABLE_LEARNING=true don't work

Summary

Thu Sep 29 13:54:47 2022 [1041] warn: spamd: service unavailable: TELL commands are not enabled, set the --allow-tell switch.

Steps to reproduce

Send any TELL request

What is the expected correct behavior?

--allow-tell should be added to cmd if ENABLE_LEARNING is true

Relevant logs and/or screenshots

docker logs -f spamassasin
                                                                       ,---.
,--------.,--.                 ,--.            ,---.    ,--. ,--------.|   |
'--.  .--'`--',--.--. ,---.  ,-|  |     ,---. /  .-'    |  | '--.  .--'|  .'
   |  |   ,--.|  .--'| .-. :' .-. |    | .-. ||  `-,    |  |    |  |   |  |
   |  |   |  ||  |   \   --.\ `-' |    ' '-' '|  .-'    |  |.--.|  |   `--'
   `--'   `--'`--'    `----' `---'      `---' `--'      `--''--'`--'   .--.
                                                                       '--'
Image: tiredofit/alpine | Version 7.6.19 Type 'image_changelog' for details
Repository/Issues/Support: https://github.com/tiredofit/docker-alpine/
           Like my work? Visit https://www.tiredofit.ca/sponsor

2022-09-29.13:54:29 [NOTICE] ** [monitoring] Container configured for monitoring with 'zabbix modern'
2022-09-29.13:54:30 [NOTICE] ** [scheduling] Container configured for scheduled tasks with 'cron'
chown: /var/lib/spamassassin/.spamassassin: No such file or directory
sed: /etc/logrotate.d/spamassassin: No such file or directory
2022-09-29.13:54:30 [NOTICE] ** [spamassassin] First time Install Detected - Copying Default Configuration
2022-09-29.13:54:30 [NOTICE] ** [spamassassin] Enabling Automatic Ruleset Updates
2022-09-29.13:54:30 [NOTICE] ** [spamassassin] Updating Rulesets
2022-09-29.13:54:35 [STARTING] ** [spamassassin] [1] Starting spamassassin
2022-09-29.13:54:36 [STARTING] ** [monitoring] [1] Starting Zabbix Agent (modern) 6.0.6
2022-09-29.13:54:36 [STARTING] ** [scheduling] [1] Starting cron
Sep 29 13:54:39.864 [755] info: spamd: server started on IO::Socket::IP [0.0.0.0]:783 (running version 3.4.6)
Sep 29 13:54:39.865 [755] info: spamd: server pid: 755
Sep 29 13:54:39.868 [755] info: spamd: server successfully spawned child process, pid 1041
Sep 29 13:54:39.870 [755] info: spamd: server successfully spawned child process, pid 1042
Sep 29 13:54:39.873 [755] info: prefork: child states: SI
Sep 29 13:54:39.873 [755] info: prefork: child states: II
Sep 29 13:54:47.709 [1041] info: spamd: connection from  [172.20.0.22]:51842 to port 783, fd 5
Sep 29 13:54:47.711 [1041] warn: spamd: service unavailable: TELL commands are not enabled, set the --allow-tell switch.
Sep 29 13:54:47.775 [755] info: prefork: child states: II

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.