X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=mail-setup;h=e753fbe9670ea27f7837b14be795d1ce5d7c95af;hb=c300392f92092b3a89281df462d42710f25d0351;hp=8da3a657655ea723f3b715cafa56d1db2f62d421;hpb=83a72c65a1a20398c78e41147faa8195adda710c;p=distro-setup diff --git a/mail-setup b/mail-setup index 8da3a65..e753fbe 100755 --- a/mail-setup +++ b/mail-setup @@ -303,7 +303,7 @@ fi # * functions & constants -pre="${0##*/}:" +pre="${0##*/}:${SSH_CLIENT:+ $HOSTNAME:}" m() { printf "$pre %s\n" "$*"; "$@"; } e() { printf "$pre %s\n" "$*"; } err() { printf "$pre %s\n" "$*" >&2; exit 1; } @@ -536,7 +536,7 @@ EOF # Aug 02 21:59:27 sy systemd[1]: wg-quick@wgmail.service: Failed with result 'exit-code'. # Aug 02 21:59:27 sy systemd[1]: Failed to start WireGuard via wg-quick(8) for wgmail. # Aug 02 21:59:47 sy systemd[1]: wg-quick@wgmail.service: Scheduled restart job, restart counter is at 1. -# Aug 02 21:59:47 sy systemd[1]: Stopped WireGuard via wg-quick(8) for wgmail. +# Aug 02 21:95:47 sy systemd[1]: Stopped WireGuard via wg-quick(8) for wgmail. # Aug 02 21:59:47 sy systemd[1]: Starting WireGuard via wg-quick(8) for wgmail... # Aug 02 21:59:47 sy wg-quick[3424]: wg-quick: `wgmail' already exists # Aug 02 21:59:47 sy systemd[1]: wg-quick@wgmail.service: Main process exited, code=exited, status=1/FAILURE @@ -857,6 +857,7 @@ fi u /etc/spamassassin/mylocal.cf <<'EOF' # this is mylocal.cf because the normal local.cf has a bunch of upstream stuff i dont want to mess with + # /usr/share/doc/exim4-base/README.Debian.gz: # SpamAssassin's default report should not be used in a add_header # statement since it contains empty lines. (This triggers e.g. Amavis' @@ -881,6 +882,35 @@ PIDFILE="/var/run/spamd.pid" NICE="--nicelevel 15" CRON=1 EOF + +case $HOSTNAME in + bk) + u /etc/spamassassin/my_thishost.cf <<'EOF' +# note: these are duplicated in exim config +# veth0/1 # bk bk_ip6 +internal_networks 10.173.8.1/32 10.173.8.2/32 85.119.83.50/32 2001:ba8:1f1:f0c9::2 +trusted_networks 10.173.8.1/32 10.173.8.2/32 85.119.83.50/32 2001:ba8:1f1:f0c9::2 +EOF + + ;; + je) + u /etc/spamassassin/my_thishost.cf <<'EOF' +# note: these are duplicated in exim config +# veth0/1 # je je_ipv6 +internal_networks 10.173.8.1/32 10.173.8.2/32 85.119.82.128/32 2001:ba8:1f1:f09d::2/128 +trusted_networks 10.173.8.1/32 10.173.8.2/32 85.119.82.128/32 2001:ba8:1f1:f09d::2/128 +EOF + ;; + *) + u /etc/spamassassin/my_thishost.cf <<'EOF' +# note: these are duplicated in exim config +# veth0/1 # li li_ip6 +internal_networks 10.173.8.1/32 10.173.8.2/32 72.14.176.105/32 2600:3c00::f03c:91ff:fe6d:baf8/128 +trusted_networks 10.173.8.1/32 10.173.8.2/32 72.14.176.105/32 2600:3c00::f03c:91ff:fe6d:baf8/128 +EOF + ;; +esac + ##### end spamassassin config @@ -1261,6 +1291,7 @@ DKIM_SIGN_HEADERS = mime-version:in-reply-to:references:from:date:subject:to domainlist local_hostnames = ! je.b8.nz : ! bk.b8.nz : *.b8.nz : b8.nz +# note: most of these are duplicated in spamassassin config hostlist iank_trusted = <; \ # veth0 10.173.8.1 ; \ @@ -2232,13 +2263,12 @@ if [[ $HOSTNAME == bk ]]; then rm composer-setup.php # based on error when running composer - mkdir /var/www/.composer + mkdir -p /var/www/.composer chown www-data:www-data /var/www/.composer ### end composer install rcdirs=(/usr/local/lib/rcexpertpath /usr/local/lib/rcninja) - ncdirs=(/var/www/ncninja) ncdirs=(/var/www/ncexpertpath /var/www/ncninja) # point debian cronjob to our local install, preventing daily cron error @@ -2270,8 +2300,6 @@ if [[ $HOSTNAME == bk ]]; then rcdir=${rcdirs[i]} rcbase=${rcdir##*/} ncdir=${ncdirs[i]} - myncdir=/root/${ncdir##*/} - mkdir -p $myncdir # copied from debians cronjob u /etc/cron.d/$rcbase <$myncdir/tmp.php <$myncdir/tmp.php <config.php + e running php $myncdir/tmp.php + # note: we leave it around place for debugging + # shellcheck disable=SC2024 # intended + sudo -u www-data php $myncdir/tmp.php >config.php + fi cd $ncdir m sudo -u www-data php occ maintenance:update:htaccess list=$(sudo -u www-data php $ncdir/occ --output=json_pretty app:list) @@ -2670,7 +2705,7 @@ cd /var/www/$ncbase m php /var/www/$ncbase/updater/updater.phar -n # throw a sleep in just because who knows what else is undocumented sleep 5 -./occ upgrade +m php occ upgrade EOFOUTER chmod +x /usr/local/bin/ncup @@ -2927,7 +2962,7 @@ gnusmarthost: debug_print = "R: smarthost for $local_part@$domain" driver = manualroute domains = ! +local_domains -# send most mail through eggs, helps fsfs sender reputation. +# comment senders to send most mail through eggs, helps fsfs sender reputation. # uncomment and optionally move to 188 file to send through my own servers again senders = *@gnu.org transport = smarthost_dkim @@ -3655,6 +3690,9 @@ EOF test_to=${test_tos[0]} for t in ${test_tos[@]:1}; do + if [[ $test_from == *@gnu.org && $t == *@gnu.org ]]; then + continue + fi test_to+=", $t" done case $test_from in