mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2024-01-19 02:48:50 +00:00
Environment variable for amavis subject tag (#596)
* Environment variable for spam subject tag * Add SA_SPAM_SUBJECT to readme * Add integration tests for spam subject tag * Fix overwrite environment variable in config file
This commit is contained in:
parent
3569aebcb6
commit
5a86193dbf
1
Makefile
1
Makefile
|
@ -27,6 +27,7 @@ run:
|
|||
-e SA_TAG=-5.0 \
|
||||
-e SA_TAG2=2.0 \
|
||||
-e SA_KILL=3.0 \
|
||||
-e SA_SPAM_SUBJECT="SPAM: " \
|
||||
-e VIRUSMAILS_DELETE_DELAY=7 \
|
||||
-e SASL_PASSWD="external-domain.com username:password" \
|
||||
-e ENABLE_MANAGESIEVE=1 \
|
||||
|
|
|
@ -146,6 +146,12 @@ Note: this spamassassin setting needs `ENABLE_SPAMASSASSIN=1`
|
|||
|
||||
Note: this spamassassin setting needs `ENABLE_SPAMASSASSIN=1`
|
||||
|
||||
##### SA_SPAM_SUBJECT
|
||||
|
||||
- **\*\*\*SPAM\*\*\*** => add tag to subject if spam detected
|
||||
|
||||
Note: this spamassassin setting needs `ENABLE_SPAMASSASSIN=1`
|
||||
|
||||
##### ONE_DIR
|
||||
|
||||
- **0** => state in default directories
|
||||
|
@ -336,4 +342,3 @@ Enabled by ENABLE_POSTFIX_VIRTUAL_TRANSPORT. Specify the final delivery of postf
|
|||
- lmtps:inet:<host>:<port> (secure lmtp with starttls, take a look at https://sys4.de/en/blog/2014/11/17/sicheres-lmtp-mit-starttls-in-dovecot/)
|
||||
- lmtp:<kopano-host>:2003 (use kopano as mailstore)
|
||||
- etc.
|
||||
|
||||
|
|
|
@ -970,6 +970,7 @@ function _setup_security_stack() {
|
|||
SA_TAG=${SA_TAG:="2.0"} && sed -i -r 's/^\$sa_tag_level_deflt (.*);/\$sa_tag_level_deflt = '$SA_TAG';/g' /etc/amavis/conf.d/20-debian_defaults
|
||||
SA_TAG2=${SA_TAG2:="6.31"} && sed -i -r 's/^\$sa_tag2_level_deflt (.*);/\$sa_tag2_level_deflt = '$SA_TAG2';/g' /etc/amavis/conf.d/20-debian_defaults
|
||||
SA_KILL=${SA_KILL:="6.31"} && sed -i -r 's/^\$sa_kill_level_deflt (.*);/\$sa_kill_level_deflt = '$SA_KILL';/g' /etc/amavis/conf.d/20-debian_defaults
|
||||
SA_SPAM_SUBJECT=${SA_SPAM_SUBJECT:="***SPAM*** "} && sed -i -r 's/^\$sa_spam_subject_tag (.*);/\$sa_spam_subject_tag = '"'$SA_SPAM_SUBJECT'"';/g' /etc/amavis/conf.d/20-debian_defaults
|
||||
test -e /tmp/docker-mailserver/spamassassin-rules.cf && cp /tmp/docker-mailserver/spamassassin-rules.cf /etc/spamassassin/
|
||||
fi
|
||||
|
||||
|
|
|
@ -429,6 +429,8 @@ load 'test_helper/bats-assert/load'
|
|||
assert_success
|
||||
run docker exec mail_pop3 /bin/sh -c "grep '\$sa_kill_level_deflt' /etc/amavis/conf.d/20-debian_defaults | grep '= 6.31'"
|
||||
assert_success
|
||||
run docker exec mail_pop3 /bin/sh -c "grep '\$sa_spam_subject_tag' /etc/amavis/conf.d/20-debian_defaults | grep '= .\*\*\*SPAM\*\*\* .'"
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test "checking spamassassin: docker env variables are set correctly (custom)" {
|
||||
|
@ -438,6 +440,8 @@ load 'test_helper/bats-assert/load'
|
|||
assert_success
|
||||
run docker exec mail /bin/sh -c "grep '\$sa_kill_level_deflt' /etc/amavis/conf.d/20-debian_defaults | grep '= 3.0'"
|
||||
assert_success
|
||||
run docker exec mail /bin/sh -c "grep '\$sa_spam_subject_tag' /etc/amavis/conf.d/20-debian_defaults | grep '= .SPAM: .'"
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test "checking spamassassin: all registered domains should see spam headers" {
|
||||
|
|
Loading…
Reference in a new issue