mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2025-07-24 12:44:47 +02:00
docs: SpamAssassin ENV docs refactor (#3756)
* chore: Log `SPAMASSASSIN_SPAM_TO_INBOX=1` ENV correctly ENV name logged was incomplete. * docs: Update SA related ENV docs * fix: Log level `warning` should be `warn` * docs: FAQ - Revise outdated SA entry * chore: Antispam / Antivirus => Anti-spam / Anti-virus * docs: ENV - Additional revisions to SA ENV * docs: ENV - Move `ENABLE_SPAMASSASSIN_KAM`
This commit is contained in:
parent
8e20173200
commit
5e28c17cf4
10 changed files with 181 additions and 99 deletions
|
@ -378,18 +378,7 @@ When you run DMS with the ENV variable `ONE_DIR=1` (default), this directory wil
|
|||
|
||||
#### How can I manage my custom SpamAssassin rules?
|
||||
|
||||
Antispam rules are managed in `docker-data/dms/config/spamassassin-rules.cf`.
|
||||
|
||||
#### What are acceptable `SA_SPAM_SUBJECT` values?
|
||||
|
||||
For no subject set `SA_SPAM_SUBJECT=undef`.
|
||||
|
||||
For a trailing white-space subject one can define the whole variable with quotes in `compose.yaml`:
|
||||
|
||||
```yaml
|
||||
environment:
|
||||
- "SA_SPAM_SUBJECT=[SPAM] "
|
||||
```
|
||||
Anti-spam rules are managed in `docker-data/dms/config/spamassassin-rules.cf`.
|
||||
|
||||
#### Why are SpamAssassin `x-headers` not inserted into my `subdomain.example.com` subdomain emails?
|
||||
|
||||
|
@ -479,59 +468,39 @@ The following configuration works nicely:
|
|||
file: ./docker-data/dms/cron/sa-learn
|
||||
```
|
||||
|
||||
With the default settings, SpamAssassin will require 200 mails trained for spam (for example with the method explained above) and 200 mails trained for ham (using the same command as above but using `--ham` and providing it with some ham mails). Until you provided these 200+200 mails, SpamAssassin will not take the learned mails into account. For further reference, see the [SpamAssassin Wiki](https://wiki.apache.org/spamassassin/BayesNotWorking).
|
||||
With the default settings, SpamAssassin will require 200 mails trained for spam (for example with the method explained above) and 200 mails trained for ham (using the same command as above but using `--ham` and providing it with some ham mails).
|
||||
|
||||
- Until you provided these 200+200 mails, SpamAssassin will not take the learned mails into account.
|
||||
- For further reference, see the [SpamAssassin Wiki](https://wiki.apache.org/spamassassin/BayesNotWorking).
|
||||
|
||||
#### How do I have more control about what SpamAssassin is filtering?
|
||||
|
||||
By default, SPAM and INFECTED emails are put to a quarantine which is not very straight forward to access. Several config settings are affecting this behavior:
|
||||
This is related to Amavis processing the mail after SpamAssassin has analyzed it and assigned a spam score.
|
||||
|
||||
First, make sure you have the proper thresholds set:
|
||||
- DMS provides some [common SA tunables via ENV][docs::env::sa_env].
|
||||
- Additional configuration can be managed with the DMS config volume by providing `docker-data/dms/config/amavis.cf`.
|
||||
|
||||
```conf
|
||||
SA_TAG=-100000.0
|
||||
SA_TAG2=3.75
|
||||
SA_KILL=100000.0
|
||||
```
|
||||
#### How can I send quarantined mail to a mailbox?
|
||||
|
||||
- The very negative value in `SA_TAG` makes sure, that all emails have the SpamAssassin headers included.
|
||||
- `SA_TAG2` is the actual threshold to set the YES/NO flag for spam detection.
|
||||
- `SA_KILL` needs to be very high, to make sure nothing is bounced at all (`SA_KILL` superseeds `SPAMASSASSIN_SPAM_TO_INBOX`)
|
||||
SPAM and INFECTED emails that [reach the `SA_KILL` threshold are archived into quarantine][docs::env::sa_kill].
|
||||
|
||||
Make sure everything (including SPAM) is delivered to the inbox and not quarantined:
|
||||
|
||||
```conf
|
||||
SPAMASSASSIN_SPAM_TO_INBOX=1
|
||||
```
|
||||
|
||||
Use `MOVE_SPAM_TO_JUNK=1` or create a sieve script which puts spam to the Junk folder:
|
||||
|
||||
```sieve
|
||||
require ["comparator-i;ascii-numeric","relational","fileinto"];
|
||||
|
||||
if header :contains "X-Spam-Flag" "YES" {
|
||||
fileinto "Junk";
|
||||
} elsif allof (
|
||||
not header :matches "x-spam-score" "-*",
|
||||
header :value "ge" :comparator "i;ascii-numeric" "x-spam-score" "3.75"
|
||||
) {
|
||||
fileinto "Junk";
|
||||
}
|
||||
```
|
||||
|
||||
Create a dedicated mailbox for emails which are infected/bad header and everything amavis is blocking by default and put its address into `docker-data/dms/config/amavis.cf`
|
||||
Instead of a quarantine folder, you can use a dedicated mailbox instead. Create an account like `quarantine@example.com` and create `docker-data/dms/config/amavis.cf`:
|
||||
|
||||
```cf
|
||||
$clean_quarantine_to = "amavis\@example.com";
|
||||
$virus_quarantine_to = "amavis\@example.com";
|
||||
$banned_quarantine_to = "amavis\@example.com";
|
||||
$bad_header_quarantine_to = "amavis\@example.com";
|
||||
$spam_quarantine_to = "amavis\@example.com";
|
||||
$clean_quarantine_to = "quarantine\@example.com";
|
||||
$virus_quarantine_to = "quarantine\@example.com";
|
||||
$banned_quarantine_to = "quarantine\@example.com";
|
||||
$bad_header_quarantine_to = "quarantine\@example.com";
|
||||
$spam_quarantine_to = "quarantine\@example.com";
|
||||
```
|
||||
|
||||
[fail2ban-customize]: ./config/security/fail2ban.md
|
||||
[docs-maintenance]: ./config/advanced/maintenance/update-and-cleanup.md
|
||||
[docs-override-postfix]: ./config/advanced/override-defaults/postfix.md
|
||||
[docs-userpatches]: ./config/advanced/override-defaults/user-patches.md
|
||||
[docs-optional-configuration]: ./config/advanced/optional-config.md
|
||||
[docs::env::sa_env]: ./config/environment.md#spamassassin
|
||||
[docs::env::sa_kill]: ./config/environment.md#sa_kill
|
||||
[github-comment-baredomain]: https://github.com/docker-mailserver/docker-mailserver/issues/3048#issuecomment-1432358353
|
||||
[github-comment-override-hostname]: https://github.com/docker-mailserver/docker-mailserver/issues/1731#issuecomment-753968425
|
||||
[github-issue-95]: https://github.com/docker-mailserver/docker-mailserver/issues/95
|
||||
|
@ -542,4 +511,3 @@ $spam_quarantine_to = "amavis\@example.com";
|
|||
[github-issue-1792]: https://github.com/docker-mailserver/docker-mailserver/pull/1792
|
||||
[hanscees-userpatches]: https://github.com/hanscees/dockerscripts/blob/master/scripts/tomav-user-patches.sh
|
||||
[mail-state-folders]: https://github.com/docker-mailserver/docker-mailserver/blob/c7e498194546416fb7231cb03254e77e085d18df/target/scripts/startup/misc-stack.sh#L24-L33
|
||||
[docs-optional-configuration]: ./config/advanced/optional-config.md
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue