X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=mail-setup;h=776f3e68aefd6d4b929e40f2cf04c57b09aab081;hb=21bddd1d26a0349f3932f12c65fbc0775e855880;hp=3c1ad8160784494b96b3ab4f8582370864e584dd;hpb=8d33c68549c02c45ed78a05f7de703a08ec245c6;p=distro-setup diff --git a/mail-setup b/mail-setup index 3c1ad81..776f3e6 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 @@ -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() { @@ -2809,8 +2809,10 @@ pi liblist-allutils-perl lynx # workarounds for broken debbugsconfig which is # itself deprecated. this is temporary before I # figure out how to install from git -gunzip /usr/share/doc/debbugs/examples/text.gz -mkdir -p /etc/debbugs/sources +if [[ -e /usr/share/doc/debbugs/examples/text.gz ]]; then + gunzip /usr/share/doc/debbugs/examples/text.gz +fi +mkdir -p /etc/debbugs/indices debbugsconfig @@ -3227,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 @@ -3603,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.