[[ $EUID == 0 ]] || exec sudo -E "${BASH_SOURCE[0]}" "$@"
set -eE -o pipefail
-trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
+trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?. PIPESTATUS: ${PIPESTATUS[@]}" >&2' ERR
shopt -s nullglob
unix_time=$(date -d $(sed -r 's/(.{4})(..)(.{5})(..)(.*)/\1-\2-\3:\4:\5/' <<<${f#$vol.}) +%s)
printf "%s %s\n" $unix_time $s
# sort will fail
- done | sort -r | head -n 1 | awk '{print $2}' || [[ ${PIPESTATUS[1]} == 2 ]]
+ done | sort -r | head -n 1 | awk '{print $2}' || [[ ${PIPESTATUS[1]} == 141 ]]
)
if [[ ! $last_snap ]]; then
# should not happen.
!authenticated = *
domains = mail.iankelling.org
EOF
+
+# This acl already exists in rcpt, this just makes it more widespread.
+# See the comment there for its rationale. The reason it needs to be
+# more widespread is that I've turned on sender verification, but cron
+# emails can fail sender verification since I may be in a network that
+# doesn't have my local dns.
+cat >/etc/exim4/conf.d/local_deny_exceptions_acl <<'EOF'
+accept
+ authenticated = *
+EOF
+
rm -fv /etc/exim4/data_local_acl # old path
cat >/etc/exim4/conf.d/data_local_acl <<'EOF'
# Except for the "condition =", this was
cat >>/etc/exim4/conf.d/main/000_local <<EOF
# recommended if dns is expected to work
CHECK_RCPT_VERIFY_SENDER = true
-# seems like a good idea
+# These seem like a good idea and have stoped spammers on my server
CHECK_DATA_VERIFY_HEADER_SENDER = true
CHECK_RCPT_SPF = true
CHECK_RCPT_REVERSE_DNS = true
# options exim has to avoid having to alter the default config files
CHECK_RCPT_LOCAL_ACL_FILE = /etc/exim4/conf.d/rcpt_local_acl
CHECK_DATA_LOCAL_ACL_FILE = /etc/exim4/conf.d/data_local_acl
+LOCAL_DENY_EXCEPTIONS_LOCAL_ACL_FILE = /etc/exim4/conf.d/local_deny_exceptions_acl
# testing dmarc
*/10 * * * * root chmod -R g+rw /m/md/bounces |& log-once -1 bounces-chmod
*/5 * * * * $u mailtest-check |& log-once -1 mailtest-check
EOF
+ m sudo rsync -ahhi --chown=root:root --chmod=0755 \
+ /b/ds/mailtest-check /b/ds/check-remote-mailqs /usr/local/bin/
;;&
$MAIL_HOST)
test_from=ian@iankelling.org
cat >>/etc/cron.d/mailtest <<EOF
2 * * * * $u check-remote-mailqs |& log-once check-remote-mailqs
EOF
- m sudo rsync -ahhi --chown=root:root --chmod=0755 \
- /b/ds/mailtest-check /b/ds/check-remote-mailqs /usr/local/bin/
;;&
l2)
test_from=iank@l2.b8.nz