X-Git-Url: https://iankelling.org/git/?p=distro-setup;a=blobdiff_plain;f=mail-setup;h=b79fd8483fa44fd6a0ae9d0bbf56f05ee2d85389;hp=65c9d8b70a80d7b437833cdf4fed4b877ad84c93;hb=f31ab4e29572ea4948f292bee814bc23061e992a;hpb=648257b1698602fdeeb7eb5ba496106547f93665 diff --git a/mail-setup b/mail-setup index 65c9d8b..b79fd84 100755 --- a/mail-setup +++ b/mail-setup @@ -182,7 +182,7 @@ if [[ ! -e /lib/systemd/system/openvpn-client@.service ]]; then vpn_ser=openvpn fi -if [[ $HOSTNAME == $MAIL_HOST ]]; then +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 ~$u)/.forward /root/.forward @@ -317,6 +317,7 @@ EOF cat >/etc/exim4/host_local_deny_exceptions <<'EOF' mail.fsf.org +*.posteo.de EOF cat >/etc/exim4/conf.d/router/190_exim4-config_fsfsmarthost <<'EOF' @@ -348,7 +349,7 @@ f=/a/bin/bash_unpublished/source-state if [[ -e $f ]]; then source $f fi -if [[ $HOSTNAME == $MAIL_HOST ]]; then +if [[ $HOSTNAME == "$MAIL_HOST" ]]; then local_mx=mail.iankelling.org rsync_common="rsync -ogtL --chown=root:Debian-exim --chmod=640 root@li.iankelling.org:/etc/letsencrypt/live/$local_mx/" ${rsync_common}fullchain.pem /etc/exim4/exim.crt @@ -409,7 +410,7 @@ dc_mailname_in_oh='true' EOF -if [[ $HOSTNAME == $MAIL_HOST ]]; then +if [[ $HOSTNAME == "$MAIL_HOST" ]]; then # mail.iankelling.org so local imap clients can connect with tls and # when they happen to not be local. @@ -547,6 +548,10 @@ wget -nv -N https://publicsuffix.org/list/public_suffix_list.dat EOF chmod 755 $f + sed -i --follow-symlinks -f - /etc/aliases </etc/dovecot/local.conf <<'EOF' + cat >/etc/dovecot/local.conf < /etc/mailname + # We set this to alerts on MAIL_HOST, but using a user that doesn't exist elsewhere + # is no good. + sed -i --follow-symlinks -f - /etc/aliases </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 +if [[ $HOSTNAME == "$MAIL_HOST" ]]; then + cat >/etc/cron.d/mailtest </dev/null; then - if [[ $HOSTNAME == $MAIL_HOST ]]; then + if [[ $HOSTNAME == "$MAIL_HOST" ]]; then systemctl restart radicale systemctl enable radicale if [[ -e /etc/logrotate.d/radicale.disabled ]]; then