mirror of
https://github.com/axllent/mailpit.git
synced 2026-04-26 08:45:54 +03:00
[GH-ISSUE #440] Spam rules not displayed in web interface #284
Labels
No labels
awaiting feedback
bug
docker
documentation
enhancement
github_actions
invalid
pull-request
question
stale
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/mailpit#284
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @dani on GitHub (Feb 12, 2025).
Original GitHub issue: https://github.com/axllent/mailpit/issues/440
I just enabled spamassassin integration on mailpit 1.22.2 (I'm using a Docker image very similar to yours for spamassassin, based on alpine, version 4.0.1). Everything seems to work, except triggered rules are not displayed in mailpit interface, I only have the global score displayed
While in spamassassin's log, I can see the triggered tests, eg
Same if I add the GTUBE string to trigger a very high spam score. Mailpit does display it's a spam with a score of 999.7/5, but still no rules detail
@dani commented on GitHub (Feb 12, 2025):
Calls to the sa-check endpoint returns an empty rule list, eg
@axllent commented on GitHub (Feb 12, 2025):
I think this is because you're using spamassassin v4.... From memory V3 is currently supported. Could you please try with the axllent/spamassassin docker image and confirm that works?
It's not that I don't want to support v4, it's just that it was not included in any limited distribution I tested back then. If alpine now does support v4, then I have some work to do...
@dani commented on GitHub (Feb 12, 2025):
Just tried with your image (so spamassassin 3.4), with the same result. No rule displayed in the web interface, even if there was a rule matched
@axllent commented on GitHub (Feb 13, 2025):
This is really strange. I have tested on both the current (my) spanassassin docker image (spamassassin v3) as well as a locally build spamassassin v4 (alpine version, thanks for the heads-up that v4 is finally available), and they both work as expected with Mailpit. The good news is that Mailpit appears to work with both versions! The bad news is I cannot replicate your error.
Below is a screenshot of SA 4.0.1
I get the rules returned in the response too:
I then just did the GTUBE test and get:
Could it be that your SpamAssassin container does not have network connectivity, and therefore cannot download any rules? Could you try manually run
sa-update -vwithin the SA container and see if you get any errors?@dani commented on GitHub (Feb 13, 2025):
I don't think so. sa-update runs fine. I even bundled rules in my image just to be sure (but anyway, spamd refuses to start if there are no rules at all). Plus, my spamd logs show that rules are triggered. I'll try to debug this
@axllent commented on GitHub (Feb 13, 2025):
Fair point. I'm completely out of ideas at this stage, all I know is it "just works" for me, and seemingly all others too, so there must be some unique reason yours is not working. I look forward to your findings.
@dani commented on GitHub (Feb 13, 2025):
Are the rules details supposed to be stored in the SQLite DB ? Or is spamd supposed to alter the headers of the email and mailpit read them back from there ?
@axllent commented on GitHub (Feb 13, 2025):
They come from spamassassin. Your message gets pushed to SA and it returns the response to Mailpit. Mailpit then returns a formatted response to the browser.
Nothing in the email itself is modified.
@dani commented on GitHub (Feb 13, 2025):
so mailpit query spamassassin each time I open the web interface, for every mail that I open ? It doesn't persist SA result anywhere ?
@dani commented on GitHub (Feb 13, 2025):
OK got it. The problem is because my spamassassin container was started with env var LANG=fr_FR.utf8. So it breaks spamassassin output parsing here
Started with LANG=C and everything is working as expected
@axllent commented on GitHub (Feb 14, 2025):
Oh that is interesting, I hadn't considered the spamassassin would ever be run using a different locale, nor that the response from spamd would be affected. It makes sense I guess, as the way the spamc client communicated with the spamd is basically over telnet. The entire response is parsed in a very horrible / old-fashioned way compared to modern day methods (eg: JSON). If a locale change impacts the data returned, then it makes sense that Mailpit will not be able to parse the full response.
I'm glad you found the cause!