-local_mx=mail.iankelling.org
-
-host=$local_mx
-relayhost="[$host]:25" # postfix
-smarthost="$host::25" # exim
-
-
-# this was for when I used the exim config type
-# "mail sent by smarthost; received via SMTP or fetchmail"
-# if [[ $HOSTNAME == $MAIL_HOST ]]; then
-# host=mail.messagingengine.com
-# relayhost="[$host]:587" # postfix
-# smarthost="$host::587" # exim
-# fi
-
-forward=ian@$local_mx
-
-
-# background: This also works instead of ~/.forward
-# s sed -i --follow-symlinks '/^root/d' /etc/aliases ||:
-#echo "root: $HOSTNAME@$SOME_DOMAIN" | s tee -a /etc/aliases
-# this can't be a symlink and has permission restrictions
-# it might work in /etc/aliases, but this seems more proper.
-e $forward > ~/.forward
-e $forward | s tee /root/.forward
-# exim log complains about 664 permissions.
-s chmod 644 ~/.forward /root/.forward
-
-
-# offlineimap uses this too, it is much easier to use one location than to
-# condition it's config and postfix's config
-case $distro in
- fedora) s lnf -T ca-certificates.crt /etc/ssl/ca-bundle.trust.crt ;;
- *) :
-esac
-
-if postfix; then
- # dunno why, but debian installed postfix with builddep emacs
- # but I will just explicitly install it here since
- # I use it for sending mail in emacs.
- if isdeb; then
- s debconf-set-selections <<EOF
-postfix postfix/main_mailer_type select Satellite system
-postfix postfix/mailname string $HOSTNAME
-postfix postfix/relayhost string $relayhost
-EOF
-
- pi postfix
- else
- pi postfix
- # Settings from reading the output when installing on debian,
- # then seeing which were different in a default install on arch.
- # I assume the same works for fedora.
- postconfin <<EOF
-mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
-mailbox_size_limit = 0
-relayhost = $relayhost
-inet_interfaces = loopback-only
-EOF
-
- s systemctl enable postfix
- s systemctl start postfix
- fi
- # i'm assuming mail just won't work on systems without the sasl_passwd.
- postconfin <<'EOF'
-smtp_sasl_auth_enable = yes
-smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
-smtp_sasl_security_options = noanonymous
-smtp_tls_security_level = secure
-message_size_limit = 20480000
-smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt
-inet_protocols = ipv4
+# * spamassassin
+
+if [[ $HOSTNAME != "$MAIL_HOST" ]]; then
+ systemctl stop spamassassin
+ systemctl disable spamassassin
+
+else
+
+ # per readme.debian
+ sed -i '/^\s*CRON\s*=/d' /etc/default/spamassassin
+ e CRON=1 >>/etc/default/spamassassin
+ # just noticed this in the config file, seems like a good idea.
+ sed -i '/^\s*NICE\s*=/d' /etc/default/spamassassin
+ e 'NICE="--nicelevel 15"' >>/etc/default/spamassassin
+
+ systemctl enable spamassassin
+ systemctl start spamassassin
+ systemctl reload spamassassin
+
+ cat >/etc/systemd/system/spamddnsfix.service <<'EOF'
+[Unit]
+Description=spamd dns bug fix cronjob
+
+[Service]
+Type=oneshot
+ExecStart=/a/bin/distro-setup/spamd-dns-fix