# mail related
etail() {
- sudo tail -F /var/log/exim4/mainlog -n 50
+ tail -F /var/log/exim4/mainlog -n 200
+}
+eless() {
+ less /var/log/exim4/mainlog
}
f() {
}
r() {
- histappend -a
+ history -a # save history
exit "$@"
# i had this redir, not sure why
# exit "$@" 2>/dev/null
# See the License for the specific language governing permissions and
# limitations under the License.
-# todo: make quick backups of maildir, or deliver to multiple hosts.
+# TODO: copy dkim keys from within this file. its now done in conflink.
+# TODO: fix dkim key to b chmod 640, group Debian-exim
set -eE -o pipefail
trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
#### begin mail cert setup ###
f=/usr/local/bin/mail-cert-cron
cat >$f <<'EOF'
+#!/bin/bash
set -eE -o pipefail
trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
systemctl restart mailcert.timer
systemctl enable mailcert.timer
+# This symlink is only here to so I can use the
+# fsf mailman ansible role and trick its cert script
+# into doing nothing.
+/a/exe/lnf -T /etc/exim4/exim.crt /etc/letsencrypt/live/$(hostname -f)/fullchain.pem
+
##### end mailcert setup #####
# comon stuff
# DO NOT USE THIS ONE.
#keyserver hkp://pool.sks-keyservers.net
-keyserver hkp://keys.openpgp.org
+#keyserver hkp://keys.openpgp.org
#keyserver hkp://pgp.mit.edu
#keyserver hkp://keyserver.pgp.com
#keyserver hkp://ipv4.pool.sks-keyservers.net
#keyserver hkp://keys.gnupg.net
-
+keyserver hkp://keyring.debian.org
# more secure, but had problems with my gpg version
#keyserver hkps://hkps.pool.sks-keyservers.net
update_wrt=true # default
temp=$(getopt -l help owh "$@") || usage 1
-mp_args=
+mp_args="-m /o,/q,/a"
eval set -- "$temp"
while true; do
case $1 in
if [ -z "$BASH_VERSION" ]; then echo "error: shell is not bash" >&2; exit 1; fi
-set -eE -o pipefail
-trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
-
+source /a/bin/errhandle/err
status_file=/dev/shm/iank-status
shopt -s nullglob
shopt -s dotglob
-lo() { /usr/local/bin/log-once -1 "$@"; }
+lo() { /usr/local/bin/log-once "$@"; }
write-status() {
chars=()
glob=(/m/md/bounces/new/*)
if [[ -e $glob ]]; then
chars+=("BOUNCE!")
- lo bounce "message in /m/md/bounces/new"
+ lo -1 bounce "message in /m/md/bounces/new"
fi
glob=(/m/md/alerts/new/* /m/md/alerts/cur/*)
if [[ -e $glob ]]; then
fi
if [[ -e /nocow/user/mailtest-failure ]]; then
chars+=("MAILPING!")
- lo mailping "mailtest-check didnt see mail from send-test-forward"
fi
if [[ -s /var/log/exim4/paniclog ]]; then
chars+=("PANIC!")
- tail /var/log/exim4/paniclog | lo paniclog
+ tail /var/log/exim4/paniclog | lo -1 paniclog
fi
source /a/bin/bash_unpublished/source-state
if [[ $MAIL_HOST == $HOSTNAME ]]; then
if [[ $(systemctl is-active btrbk.timer) != active ]]; then
- chars+=("BTRBK-TIMER!")
+ chars+=("BTRBK.TIMER!")
+ lo -60 btrbk.timer "btrbk.timer not enabled"
fi
## check if last snapshot was within an hour
done
if (( maxtime < now - 60*60 )); then
chars+=("OLD-SNAPSHOT!")
+ lo -1 old-snapshot "/o snapshot older than 1 hour"
fi
fi