X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=mail-setup;h=058fb4f52d4d56e4894212a2a1d804d4b36f4a05;hb=f7eaad64a7c5f3bc851f146e1f258d34f398a7d7;hp=2af69b27f7411710b2b2efce87bccbc7c528d575;hpb=ae54f4cd08815de501151c10083e74294609558a;p=distro-setup diff --git a/mail-setup b/mail-setup index 2af69b2..058fb4f 100755 --- a/mail-setup +++ b/mail-setup @@ -50,6 +50,8 @@ EOF # hamburger -> preferences -> preferences -> advanced tab -> config editor button -> security.ssl.enable_ocsp_must_staple = false # background: ovecot does not yet have ocsp stapling support # reference: https://community.letsencrypt.org/t/simple-guide-using-lets-encrypt-ssl-certs-with-dovecot/2921 +# +# for phone, same thing but username alerts, pass in ivy-pass. ####### @@ -69,7 +71,7 @@ EOF # # dovecot password, i just need 1 as I\'m the only user # mkdir /p/c/filesystem/etc/dovecot -# echo "iank:$(doveadm pw -s ssha256)::::::" >/p/c/filesystem/etc/dovecot/users +# echo "iank:$(doveadm pw -s ssha256)::::::" >>/p/c/filesystem/etc/dovecot/users # conflink @@ -197,7 +199,7 @@ pi() { # package install apt-get -y install --purge --auto-remove "$@" } -postmaster=$u +postmaster=alerts mxhost=mail.iankelling.org mxport=587 forward=$u@$mxhost @@ -218,11 +220,11 @@ fi if [[ $HOSTNAME == $MAIL_HOST ]]; then # afaik, these will get ignored because they are routing to my own # machine, but rm them is safer - rm -f $(eval echo ~$postmaster)/.forward /root/.forward + rm -f $(eval echo ~$u)/.forward /root/.forward else # this can\'t be a symlink and has permission restrictions # it might work in /etc/aliases, but this seems more proper. - install -m 644 {-o,-g}$postmaster <(e $forward) $(eval echo ~$postmaster)/.forward + install -m 644 {-o,-g}$u <(e $forward) $(eval echo ~$u)/.forward fi @@ -320,7 +322,7 @@ debconf-set-selections </etc/exim4/rcpt_local_acl <<'EOF' @@ -417,7 +419,7 @@ trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR [[ $EUID == 0 ]] || exec sudo "$BASH_SOURCE" "$@" -f=/a/bin/bash_unpublished/source-semi-priv +f=/a/bin/bash_unpublished/source-state if [[ -e $f ]]; then source $f fi @@ -541,8 +543,7 @@ exim4-config exim4/mailname string mail.iankelling.org # Other destinations for which mail is accepted: # iank.bid is for testing # mail.iankelling.org is for machines i own -exim4-config exim4/dc_other_hostnames string *.iankelling.org;iankelling.org;*iank.bid;iank.bid;*zroe.org;zroe.org;*.b8.nz;b8.nz - +exim4-config exim4/dc_other_hostnames string *.iankelling.org;iankelling.org;*iank.bid;iank.bid;*zroe.org;zroe.org;*.b8.nz;b8.nz;*.fsf.org;fsf.org @@ -687,10 +688,10 @@ EOF # sieve option, we wouldn\'t need this, but I\'d rather not modify a # default config if not needed. This won\'t work as a symlink in /a/c # unfortunately. - sudo -u $postmaster /a/exe/lnf -T sieve/main.sieve $(eval echo ~$postmaster)/.dovecot.sieve + sudo -u $u /a/exe/lnf -T sieve/main.sieve $(eval echo ~$u)/.dovecot.sieve + # we set this later in local.conf sed -ri -f - /etc/dovecot/conf.d/10-mail.conf <<'EOF' -1i mail_location = maildir:/m/md:LAYOUT=fs:INBOX=/m/md/INBOX /^\s*mail_location\s*=/d EOF @@ -744,11 +745,16 @@ ssl_cert = /etc/cron.d/mailtest <<'EOF' +*/10 * * * * iank echo body_test | mail -s "primary_test $(date +%s) $(date +%Y-%m-%dT%H:%M:%S%z)" iank@posteo.de +2/10 * * * * root /usr/local/bin/mailtest-check +EOF + cp /a/bin/distro-setup/filesystem/usr/local/bin/mailtest-check /usr/local/bin +else + rm -f /etc/cron.d/mailtest +fi + # MAIL_HOST also does radicale, and easier to start and stop it here # for when MAIL_HOST changes, so radicale gets the synced files and # does not stop us from remounting /o.