[GH-ISSUE #361] Issues with SpamAssassin integration #239

Closed
opened 2026-03-15 13:22:48 +03:00 by kerem · 2 comments
Owner

Originally created by @brenc on GitHub (Sep 12, 2024).
Original GitHub issue: https://github.com/axllent/mailpit/issues/361

I'm setting up mailpit today (which is awesome) but I can't get SpamAssassin integration to work. First I set MP_ENABLE_SPAMASSASSIN: postmark and I can see the log line [spamassassin] enabled via postmark but in the UI there is no Spam Analysis tab on my test emails. No logs of an attempt either when sending test emails with verbose logging on.

Then I tried setting up the Docker container and using it locally. Here's my full compose file:

services:
  mailpit:
    container_name: mailpit
    depends_on:
      - spamassassin
    environment:
      MP_MAX_MESSAGES: 5000
      MP_DATABASE: /data/mailpit.db
      MP_ENABLE_SPAMASSASSIN: spamassassin:783
      MP_SMTP_AUTH_ACCEPT_ANY: 1
      MP_SMTP_AUTH_ALLOW_INSECURE: 1
      MP_VERBOSE: 1
    image: axllent/mailpit
    ports:
      - 8350:8025
      - 8351:1025
    restart: unless-stopped
    volumes:
      - ./data:/data

  spamassassin:
    image: axllent/spamassassin
    container_name: spamassassin
    ports:
      - 8352:783
    restart: unless-stopped

mailpit logs show:

...
mailpit       | time="2024/09/12 15:58:27" level=info msg="[spamassassin] enabled via spamassassin:783"
mailpit       | time="2024/09/12 15:58:27" level=warning msg="[spamassassin] ping: dial tcp 172.22.0.2:783: connect: connection refused"
...
spamassassin  | Sep 12 15:58:29.302 [11] info: spamd: server started on IO::Socket::IP [::]:783, IO::Socket::IP [0.0.0.0]:783 (running version 3.4.6)

It takes a few seconds for SpamAssassin to open the port. I can connect to it via the mailpit container using nc after it starts. It appears mailpit attempts to connect one time on startup (before the port opens up) then gives up. It doesn't attempt to use the local SpamAssassin instance again (or maybe I'm missing something obvious).

I'm sending test emails with bun script + nodemailer if that makes any difference.

Originally created by @brenc on GitHub (Sep 12, 2024). Original GitHub issue: https://github.com/axllent/mailpit/issues/361 I'm setting up mailpit today (which is awesome) but I can't get SpamAssassin integration to work. First I set `MP_ENABLE_SPAMASSASSIN: postmark` and I can see the log line `[spamassassin] enabled via postmark` but in the UI there is no Spam Analysis tab on my test emails. No logs of an attempt either when sending test emails with verbose logging on. Then I tried setting up the Docker container and using it locally. Here's my full compose file: ``` services: mailpit: container_name: mailpit depends_on: - spamassassin environment: MP_MAX_MESSAGES: 5000 MP_DATABASE: /data/mailpit.db MP_ENABLE_SPAMASSASSIN: spamassassin:783 MP_SMTP_AUTH_ACCEPT_ANY: 1 MP_SMTP_AUTH_ALLOW_INSECURE: 1 MP_VERBOSE: 1 image: axllent/mailpit ports: - 8350:8025 - 8351:1025 restart: unless-stopped volumes: - ./data:/data spamassassin: image: axllent/spamassassin container_name: spamassassin ports: - 8352:783 restart: unless-stopped ``` mailpit logs show: ``` ... mailpit | time="2024/09/12 15:58:27" level=info msg="[spamassassin] enabled via spamassassin:783" mailpit | time="2024/09/12 15:58:27" level=warning msg="[spamassassin] ping: dial tcp 172.22.0.2:783: connect: connection refused" ... spamassassin | Sep 12 15:58:29.302 [11] info: spamd: server started on IO::Socket::IP [::]:783, IO::Socket::IP [0.0.0.0]:783 (running version 3.4.6) ``` It takes a few seconds for SpamAssassin to open the port. I can connect to it via the mailpit container using nc after it starts. It appears mailpit attempts to connect one time on startup (before the port opens up) then gives up. It doesn't attempt to use the local SpamAssassin instance again (or maybe I'm missing something obvious). I'm sending test emails with bun script + nodemailer if that makes any difference.
kerem closed this issue 2026-03-15 13:22:54 +03:00
Author
Owner

@brenc commented on GitHub (Sep 12, 2024):

I'm not sure what I did but postmark and local SpamAssassin are both working now. This must've been on my end.

<!-- gh-comment-id:2346792599 --> @brenc commented on GitHub (Sep 12, 2024): I'm not sure what I did but postmark and local SpamAssassin are both working now. This must've been on my end.
Author
Owner

@axllent commented on GitHub (Sep 12, 2024):

Mailpit will try to connect to the spamassassin server on startup, and in this case Mailpit is starting much faster than spamassassin so you're getting the warning. Despite the error however, it should not have prevented the integration from working once it was all loaded, so I assume you simply hadn't reloaded your browser after enabling spamassassin 🤷‍♂️

Either way, I'm glad it's working 👍

<!-- gh-comment-id:2347018083 --> @axllent commented on GitHub (Sep 12, 2024): Mailpit will try to connect to the spamassassin server on startup, and in this case Mailpit is starting much faster than spamassassin so you're getting the warning. Despite the error however, it should not have prevented the integration from working once it was all loaded, so I assume you simply hadn't reloaded your browser after enabling spamassassin 🤷‍♂️ Either way, I'm glad it's working 👍
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/mailpit#239
No description provided.