various fixes
[distro-setup] / mail-setup
index 9c466899979bf2e36f99ddade0681b263488f45b..36b3ab57027418c56945b3767d3bb3beac04b29f 100755 (executable)
@@ -2105,7 +2105,7 @@ EOF
     # Having backups of indexes is a waste of space. This also means we
     # don't send them around with btrbk, I think it is probably
     # preferable use a bit more cpu to recalculate indexes.
-    install -d -o iank -g iank /var/dovecot-indexes
+    install -d -m 700 -o iank -g iank /var/dovecot-indexes
     cat >>/etc/dovecot/local.conf <<EOF
 
 
@@ -2118,9 +2118,10 @@ mail_cache_max_size = 50M
 !include conf.d/auth-passwdfile.conf.ext
 
 # ian: %u is used for alerts user vs iank
+# https://doc.dovecot.org/configuration_manual/mail_location/Maildir/
 mail_location = maildir:/m/%u:LAYOUT=fs:INBOX=/m/%u/INBOX:INDEX=/var/dovecot-indexes/%u
-mail_uid = $u
-mail_gid = $u
+mail_uid = iank
+mail_gid = iank
 
 protocol lmtp {
 # For a normal setup with exim, we need something like this, which
@@ -3803,8 +3804,8 @@ case $HOSTNAME in
 esac
 
 # optimization, this only needs to run once.
-if [[ ! -e /etc/exim4/fullchain.pem ]]; then
-  m /a/bin/ds/mail-cert-cron -1
+if ! openssl x509 -checkend $(( 60 * 60 * 24 * 3 )) -noout -in /etc/exim4/fullchain.pem; then
+  m /a/bin/ds/mail-cert-cron -1 -i
   m systemctl --now enable mailcert.timer
 fi