X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=mail-setup;h=8f2a5c5f973fbecee46c5a113b34fbba73ae9d55;hb=9a0f77b0495e6f2643d5646c54b4c99cf3118c67;hp=e55aa47b4a4ba8cbd920887b04a3b92c7942fb1e;hpb=2ff8740f1061a31683152a4447340921de82b1b9;p=distro-setup diff --git a/mail-setup b/mail-setup index e55aa47..8f2a5c5 100755 --- a/mail-setup +++ b/mail-setup @@ -183,10 +183,10 @@ if [ -z "$BASH_VERSION" ]; then echo "error: shell is not bash" >&2; exit 1; fi shopt -s nullglob -if [[ -s /usr/local/lib/err ]]; then - source /usr/local/lib/err -elif [[ -s /a/bin/errhandle/err ]]; then - source /a/bin/errhandle/err +if [[ -s /usr/local/lib/bash-bear ]]; then + source /usr/local/lib/bash-bear +elif [[ -s /a/bin/bash-bear-trap/bash-bear ]]; then + source /a/bin/bash-bear-trap/bash-bear else echo "no err tracing script found" exit 1 @@ -1864,8 +1864,8 @@ if mailhost; then # plus debug does not help. # sudo -u radicale radicale -D - # created password file with: - # htpasswd -c /p/c/machine_specific/li/filesystem/etc/caldav-htpasswd + # created radicale password file with: + # htpasswd -c /p/c/machine_specific/li/filesystem/etc/caldav-htpasswd ian # chmod 640 /p/c/machine_specific/li/filesystem/etc/caldav-htpasswd # # setup chgrp www-data in ./conflink @@ -2037,7 +2037,7 @@ EOF ssl = required # this is the same as the certbot list, i check changes in /a/bin/ds/filesystem/usr/local/bin/check-lets-encrypt-ssl-settings ssl_cipher_list = ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384 -ssl_protocols = TLSv1.2 +ssl_min_protocol = TLSv1.2 ssl_prefer_server_ciphers = no protocol lmtp { @@ -2748,7 +2748,7 @@ EOF u /usr/local/bin/ncup <<'EOFOUTER' #!/bin/bash -source /usr/local/lib/err +source /usr/local/lib/bash-bear m() { printf "%s\n" "$*"; "$@"; } err-cleanup() { @@ -3229,16 +3229,27 @@ MAILDIR_HOME_MAILDIR_LOCATION = /m/md/Sent EOF + # ian: save a copy of sent mail. i thought of other ways to do this, + # for example, to only save sent mail that is not sent from my mail + # client which saves a copy by default, but in the end, it seems + # simplest to turn that off. We want to save external mail sent by + # smarthosts. However, there is one complication: encrypted + # mail. Saving it here just gets us an encrypted copy that we can't + # read. Soo, we could bcc ourselves: then we still have the + # annoyance that it is encrypted so we can't grep it. Or, we could + # hack emacs so that it sends us an unencrypted copy. Turns out that + # the emacs function which saves sent email can also send us a + # copy. But, then we have 3 copies: the encrypted copy exim saves, + # the unencrypted copy exim saves, and the copy emacs saves. Soo, + # we can emacs send a copy directly to the sent alias but only when + # it is not mail_host, and have the exim condition for redirecting a + # copy to the sent alias avoid doing it if it has an emacs user + # agent header. u /etc/exim4/conf.d/router/186_sentarchive_nn <<'EOF' -# ian: save a copy of sent mail. i thought of other ways to -# do this, for example, to only save sent mail that is not sent -# from my mail client which saves a copy by default, but in the -# end, it seems simplest to turn that off. We want to save -# external mail sent by smarthosts. sentarchive_nn: driver = redirect domains = ! +local_domains - condition = ${if !bool{${lookup{$local_part@$domain}lsearch{/etc/exim4/ignore-sent}{true}}}} + condition = ${if and {{!bool{${lookup{$local_part@$domain}lsearch{/etc/exim4/ignore-sent}{true}}}} {!match {$h_user-agent:}{emacs}}}} data = vojdedIdNejyebni@b8.nz unseen EOF @@ -3605,25 +3616,25 @@ sentarchive: driver = redirect domains = ! +local_domains senders = <; *@fsf.org ; *@posteo.net - condition = ${if !bool{${lookup{$local_part@$domain}lsearch{/etc/exim4/ignore-sent}{true}}}} + condition = ${if and {{!bool{${lookup{$local_part@$domain}lsearch{/etc/exim4/ignore-sent}{true}}}} {!match {$h_user-agent:}{emacs}}}} data = vojdedIdNejyebni@b8.nz unseen EOF u /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 + 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 and {{!bool{${lookup{$local_part@$domain}lsearch{/etc/exim4/ignore-sent}{true}}}} {!match {$h_user-agent:}{emacs}}}} + # 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.