-[Install]
-WantedBy=timers.target
-EOF
- ser daemon-reload
- ser start mailcert
- sgo mailcert.timer
-
-
- # based on a little google and package search, just the dovecot
- # packages we need instead of dovecot-common.
- #
- # dovecot-lmtpd is for exim to deliver to dovecot instead of maildir
- # directly. The reason to do this is to use dovecot\'s sieve, which
- # has extensions that allow it to be almost equivalent to exim\'s
- # filter capabilities, some ways probably better, some worse, and
- # sieve has the benefit of being supported in postfix and
- # proprietary/weird environments, so there is more examples on the
- # internet. I was torn about whether to do this or not, meh.
- pi dovecot-core dovecot-imapd dovecot-sieve dovecot-lmtpd
-
- # if we changed 90-sieve.conf and removed the active part of the
- # 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.
- lnf -T sieve/main.sieve ~/.dovecot.sieve
-
- # we have a few config files which installing exim/dovecot overwrites,
- # and might as well have this before reading /etc/mailpass,
- # which this sets up too.
- conflink
-
- # begin setup passwd.client
- f=/etc/exim4/passwd.client
- s rm -f $f
- s touch $f
- s chmod 640 $f
- s chown root:Debian-exim $f
- # note: this will go away
- s cat /etc/mailpass| while read -r domain port pass; do
- # reference: exim4_passwd_client(5)
- printf "%s:%s\n" "$domain" "$pass" | s tee -a $f >/dev/null
- done
- # end setup passwd.client
-
- # https://blog.dhampir.no/content/make-exim4-on-debian-respect-forward-and-etcaliases-when-using-a-smarthost
- # i only need .forwards, so just doing that one.
- cd /etc/exim4/conf.d/router
- a=userforward
- b=${a}_higher_priority
- tmp=$(mktemp)
- of=175_$b
- # sed to make the router name unique
- sed -r s/^\\S+:/$b:/ 600_exim4-config_$a | s dd of=$tmp 2>/dev/null
- if ! diff -q $tmp $of &>/dev/null; then
- s dd if=$tmp of=$of >/dev/null
+# ** bind mount setup
+# put spool dir in directory that spans multiple distros.
+# based on http://www.postfix.org/qmgr.8.html and my notes in gnus
+#
+# todo: I\'m suspicious of uids for Debian-exim being the same across
+# distros. It would be good to test this.
+dir=/nocow/exim4
+sdir=/var/spool/exim4
+# we only do this if our system has $dir
+
+# this used to do a symlink, but, in the boot logs, /nocow would get mounted succesfully,
+# about 2 seconds later, exim starts, and immediately puts into paniclog:
+# honVi-0000u3-82 Failed to create directory "/var/spool/exim4/input": No such file or directory
+# so, im trying a bind mount to get rid of that.
+if [[ -e /nocow ]]; then
+ if ! grep -Fx "/nocow/exim4 /var/spool/exim4 none bind 0 0" /etc/fstab; then
+ echo "/nocow/exim4 /var/spool/exim4 none bind 0 0" >> /etc/fstab
+ fi
+ if ! mountpoint -q $sdir; then
+ systemctl stop exim4
+ if [[ -L $sdir ]]; then
+ rm $sdir
+ fi
+ if [[ ! -e $dir && -d $sdir ]]; then
+ mv $sdir $dir