From: Ian Kelling Date: Wed, 5 Oct 2022 07:12:26 +0000 (-0400) Subject: fix duplicate backups, duplicate sent archive X-Git-Url: https://iankelling.org/git/?a=commitdiff_plain;ds=sidebyside;h=ca2912304f8d0a727756763218c9c7f89768c76d;p=distro-setup fix duplicate backups, duplicate sent archive --- diff --git a/mail-setup b/mail-setup index bbe0def..0ec8384 100755 --- a/mail-setup +++ b/mail-setup @@ -135,7 +135,8 @@ if [[ -s /usr/local/lib/err ]]; then elif [[ -s /a/bin/errhandle/err ]]; then source /a/bin/errhandle/err else - err "no err tracing script found" + echo "no err tracing script found" + exit 1 fi source /a/bin/distro-functions/src/identify-distros source /a/bin/distro-functions/src/package-manager-abstractions @@ -1354,21 +1355,17 @@ EOF # old file -rm -fv /etc/exim4/conf.d/router/880_backup_copy - +rm -fv /etc/exim4/conf.d/router/8{8,9}0_backup_copy /etc/exim4/conf.d/router/865_backup_redir # It is important for this to exist everywhere except in MAIL_HOST # non-nn config. Previously, just had it in the nn-config on MAIL_HOST, # but that is a problem if we change mail host and still have something # in the queue which was destined for this router, but hosts were # unreachable, the routers will be reevaluated on the next retry. -i /etc/exim4/conf.d/router/890_backup_copy <>/etc/exim4/update-exim4.conf.conf <>/etc/myexim4/conf.d/main/000_local <<'EOF' # this makes it easier to see which exim is doing what log_file_path = /var/log/exim4/my%s @@ -3296,11 +3297,42 @@ EOF bk) # config for the non-nn exim - cat >/etc/myexim4/conf.d/main/000_local-nn <<'EOF' + cat >>/etc/myexim4/conf.d/main/000_local <<'EOF' MAIN_HARDCODE_PRIMARY_HOSTNAME = mail2.iankelling.org EOF ;; $MAIL_HOST) + + + i /etc/myexim4/conf.d/router/185_sentarchive <<'EOF' +sentarchive: + driver = redirect + domains = ! +local_domains + senders = <; *@fsf.org ; *@posteo.net + condition = ${if !bool{${lookup{$local_part@$domain}lsearch{/etc/exim4/ignore-sent}{true}}}} + data = vojdedIdNejyebni@b8.nz + unseen +EOF + + + i /etc/myexim4/conf.d/router/160_backup_redir <<'EOF' +backup_redir: +driver = redirect +# i dont email myself from my own machine much, so lets ignore that. +domains = ! +local_domains +senders = <; *@fsf.org ; *@posteo.net +condition = ${if !bool{${lookup{$local_part@$domain}lsearch{/etc/exim4/ignore-sent}{true}}}} +# b is just an arbirary short string +data = b@eximbackup.b8.nz +# note, to test this, i could temporarily allow testignore. +# alerts avoids potential mail loop. +local_parts = ! root : ! testignore : ! alerts : ! daylert +unseen = true +errors_to = alerts@iankelling.org +EOF + + + # for bk, we have a exim4in.service that will do this for us. m update-exim4.conf -d /etc/myexim4 ;;