summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2020-10-11 00:06:45 +0200
committerJonas Smedegaard <dr@jones.dk>2020-10-11 00:07:26 +0200
commit49907dc63c22e9a33b52cc2a861937f7dd2293f4 (patch)
tree13379d4b1046f501ec647227caead772d237286b
parente5ef0e46de08f33cc2f6f6c04777973702c88403 (diff)
generalize overridable variables $AMAVIS_MAXPROC $DKIMPROXY_MAXPROC_OUT
-rwxr-xr-xpostfix/postfix.sh19
1 files changed, 11 insertions, 8 deletions
diff --git a/postfix/postfix.sh b/postfix/postfix.sh
index df5ba3a..d8040ee 100755
--- a/postfix/postfix.sh
+++ b/postfix/postfix.sh
@@ -35,6 +35,14 @@ REALM=${REALM:-ORG}
TLS_CERT=${TLS_CERT:-/etc/ssl/certs/postfix.pem}
TLS_KEY=${TLS_KEY:-/etc/ssl/private/postfix.pem}
+# TODO: maybe use AMaViS default of 20 (and instead tune spamassassin)
+# <https://www.ijs.si/software/amavisd/amavisd-new-docs.html#max_requests>
+AMAVIS_MAXPROC=${AMAVIS_MAXPROC:-2}
+
+# TODO: check if DKIMPROXY_MAXPROC_IN should be handled too
+#DKIMPROXY_MAXPROC_IN=5
+DKIMPROXY_MAXPROC_OUT=5
+
realmsdir="/etc/local-$REDPILL"
thisrealm=$(cat "/etc/local-$REALM/realm" || dnsdomainname | tr '[:lower:]' '[:upper:]')
confdir=/etc/postfix
@@ -80,18 +88,12 @@ else
warn "No inbound SASL authentication - requires TLS encryption and Dovecot."
fi
amavis=
-# TODO: maybe use AMaViS default of 20 (instead tuning spamassassin)
-# <https://www.ijs.si/software/amavisd/amavisd-new-docs.html#max_requests>
-default_amavis_maxproc=2
if [ -x /usr/sbin/amavisd ] || [ -x /usr/sbin/amavisd-new ]; then
amavis=1
else
warn "AMaViS missing (Debian package amavisd-new)."
fi
dkimproxy=
-#dkimproxy_maxproc_in=5
-# FIXME: update actual outgoing maxproc from /etc/default/dkimproxy (and /etc/dkimproxy/dkimproxy_out.conf too?)
-dkimproxy_maxproc_out=5
if [ -x /usr/sbin/dkimproxy.in ]; then
if [ "1" = "$amavis" ]; then
dkimproxy=1
@@ -366,7 +368,7 @@ _postconf -X smtpd_sasl_auth_enable
_postconf -X smtpd_sasl_security_options
if [ -n "$amavis" ]; then
- amavis_maxproc=$(getperlvarfromfile max_servers "$default_amavis_maxproc" amavisd.conf.addon amavis)
+ amavis_maxproc=$(getperlvarfromfile max_servers "$AMAVIS_MAXPROC" amavisd.conf.addon amavis)
_postconf -Me amavisfeed/unix="
amavisfeed unix - - n - $amavis_maxproc lmtp
-o lmtp_data_done_timeout=1200s
@@ -403,8 +405,9 @@ amavisfeed unix - - n - $amavis_maxproc lmtp
_postconf -Pe submission/inet/content_filter='dkimsign:[127.0.0.1]:10028'
_postconf -Pe smtps/inet/content_filter='dkimsign:[127.0.0.1]:10028'
fi
+ # FIXME: supersede DKIMPROXY_MAXPROC_OUT from /etc/default/dkimproxy
_postconf -Me dkimsign/unix="
-dkimsign unix - - n - $dkimproxy_maxproc_out smtp
+dkimsign unix - - n - $DKIMPROXY_MAXPROC_OUT smtp
-o smtp_send_xforward_command=yes
-o smtp_discard_ehlo_keywords=8bitmime,starttls
"