X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=mail-setup;h=85bd17b78f6313541af26babbdde0a3d6f6eabb4;hb=3a198460eadab9293e774b26e54d14563cb5f407;hp=c40c56c0b6eab97923f57686a5c617eaed7040ca;hpb=5abdcfce00c6ff61bf3856f7b5101915dc096107;p=distro-setup diff --git a/mail-setup b/mail-setup index c40c56c..85bd17b 100755 --- a/mail-setup +++ b/mail-setup @@ -3,6 +3,10 @@ # Copyright (C) 2019 Ian Kelling # SPDX-License-Identifier: AGPL-3.0-or-later +# todo: check new macro DKIM_TIMESTAMPS + +# todo: check if REMOTE_SMTP_INTERFACE or REMOTE_SMTP_TRANSPORTS_HEADERS_REMOVE can simplify my or fsfs config + # todo: max line length macro changed in t11. look into it # todo: check that all macros we use are still valid in t11 @@ -131,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 @@ -1204,8 +1209,8 @@ REMOTE_SMTP_SMARTHOST_HOSTS_REQUIRE_TLS = * # other says gmail does not reject. figure out and open a new bug. IGNORE_SMTP_LINE_LENGTH_LIMIT = true -# more verbose logs -MAIN_LOG_SELECTOR = +all +# more verbose logs. used to use +all, but made it less for more efficiency. +MAIN_LOG_SELECTOR = -tls_cipher -tls_certificate_verified +pid +received_recipients +received_sender +sender_on_delivery +return_path_on_delivery +msg_id_created +subject +address_rewrite +smtp_confirmation # Based on spec, seems like a good idea to be nice. smtp_return_error_details = true @@ -1348,18 +1353,21 @@ warn EOF -# It is important for this to exist universally, instead of -# just on the mail host because 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/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 @@ -3286,11 +3304,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 ;; @@ -3546,10 +3595,12 @@ EOF # Dont put these test messages into the sent folder or else it will # overwhelm it, plus i dont want to save a copy at all. - rm -f /etc/exim4/ignore-sent - for t in ${test_tos[@]}; do - echo $t >> /etc/exim4/ignore-sent - done + # Plus addresses we generally want to ignore. + i /etc/exim4/ignore-sent </usr/local/bin/send-test-forward <<'EOF' #!/bin/bash