Skip to content

Commit

Permalink
Amavis config tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
williamdes committed Jan 10, 2024
1 parent 7d64bdd commit 57dafd4
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 5 deletions.
1 change: 0 additions & 1 deletion .env.dist
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ PFLOGSUMM_RECIPIENT=
LOGWATCH_RECIPIENT=
# The @ must be escaped like \@
VIRUS_ADMIN_EMAIL=
VIRUS_X_HEADER_LINE=

# Fail2ban config to allow IPs to make failed attempts
FAIL2BAN_IGNORE_IPS=
Expand Down
1 change: 0 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ services:
MAILTO: "${CRON_MAILTO:-$POSTMASTER_ADDRESS}"
POSTMASTER_ADDRESS: "${POSTMASTER_ADDRESS}"
VIRUS_ADMIN_EMAIL: "${VIRUS_ADMIN_EMAIL}"
VIRUS_X_HEADER_LINE: "${VIRUS_X_HEADER_LINE}"
PFLOGSUMM_RECIPIENT: "${PFLOGSUMM_RECIPIENT}"
PFLOGSUMM_TRIGGER: daily_cron
LOGWATCH_INTERVAL: daily
Expand Down
1 change: 0 additions & 1 deletion tests/.env.test1
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ [email protected]
[email protected]
[email protected]
[email protected]
VIRUS_X_HEADER_LINE="at Wdes SAS"

# Replication
DOVECOT_REPLICATION_SERVER=
Expand Down
26 changes: 24 additions & 2 deletions user-patches.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,29 @@ printf '\nsmtp_helo_name = %s\n' "${OVERRIDE_HOSTNAME}" >> /etc/postfix/main.cf

echo 'Add spam check config'

cat <<EOF > /etc/amavis/conf.d/05-domain_id
use strict;
# \$mydomain is used just for convenience in the config files and it is not
# used internally by amavisd-new except in the default X_HEADER_LINE (which
# Debian overrides by default anyway).
\$mydomain = '$OVERRIDE_HOSTNAME';
# amavisd-new needs to know which email domains are to be considered local
# to the administrative domain. Only emails to "local" domains are subject
# to certain functionality, such as the addition of spam tags.
#
# Default local domains to \$mydomain and all subdomains. Remember to
# override or redefine this if \$mydomain is changed later in the config
# sequence.
@local_domains_acl = ( "$OVERRIDE_HOSTNAME" );
1; # ensure a defined return
EOF

cat <<EOF > /etc/amavis/conf.d/50-user
use strict;
Expand All @@ -51,8 +74,7 @@ use strict;
\$enable_dkim_verification = 1; # Check DKIM
\$virus_admin = '${VIRUS_ADMIN_EMAIL}';
\$X_HEADER_LINE = '${VIRUS_X_HEADER_LINE}';
\$banned_quarantine_to = '${VIRUS_ADMIN_EMAIL}';
#------------ Do not modify anything below this line -------------
1; # ensure a defined return
Expand Down

0 comments on commit 57dafd4

Please sign in to comment.