Update v-add-srs-support-to-exim: compatibility for Debian < 12

This commit is contained in:
myvesta 2024-11-18 14:26:36 +01:00 committed by GitHub
commit a7d7c3686c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -50,6 +50,16 @@ if ! /usr/local/vesta/bin/v-grep 'remote_forwarded_smtp:' '/etc/exim4/exim4.conf
v-sed 'procmail:\n driver = pipe' 'remote_forwarded_smtp:\n driver = smtp\n dkim_domain = DKIM_DOMAIN\n dkim_selector = mail\n dkim_private_key = DKIM_PRIVATE_KEY\n dkim_canon = relaxed\n dkim_strict = 0\n hosts_try_fastopen = \n hosts_try_chunking = !93.188.3.0/24\n message_linelength_limit = 1G\n # modify the envelope from, for mails that we forward\n max_rcpt = 1\n return_path = ${srs_encode {SRS_SECRET} {$return_path} {$original_domain}}\n\nprocmail:\n driver = pipe' '/etc/exim4/exim4.conf.template'
fi
release=$(cat /etc/debian_version | tr "." "\n" | head -n1)
if [ "$release" -lt 11 ]; then
echo "= Removing \"smtputf8_advertise_hosts\" line for Debian < 11"
sed -i "s|smtputf8_advertise_hosts|#smtputf8_advertise_hosts|g" /etc/exim4/exim4.conf.template
fi
if [ "$release" -lt 12 ]; then
echo "= Removing \"message_linelength_limit\" line for Debian < 12"
sed -i "s|message_linelength_limit|#message_linelength_limit|g" /etc/exim4/exim4.conf.template
fi
echo "= Restarting exim4 service"
systemctl restart exim4