aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Johannes Christ <[email protected]>2025-02-03 21:27:00 +0100
committerGravatar Johannes Christ <[email protected]>2025-02-03 21:27:00 +0100
commit2754ac4869a84a6c595efe5af778a469105f89bb (patch)
tree16148843cf37ad0fdbed26953562f11c8c0b7d25
parentUpdate ansible (diff)
Learn from Fredrick's therapy resultsfredrick-therapy
After his diagnosis, Fredrick now finally has access to treatment. Will he use this treatment, or will he continue to fail to reply to his mails?
-rw-r--r--ansible/roles/postfix/templates/services/fredrick-reply.sh.j212
1 files changed, 11 insertions, 1 deletions
diff --git a/ansible/roles/postfix/templates/services/fredrick-reply.sh.j2 b/ansible/roles/postfix/templates/services/fredrick-reply.sh.j2
index b33c7c4..7fe77b3 100644
--- a/ansible/roles/postfix/templates/services/fredrick-reply.sh.j2
+++ b/ansible/roles/postfix/templates/services/fredrick-reply.sh.j2
@@ -16,6 +16,9 @@ SENDER=$(echo "$EMAIL" | maddr -h from -)
# Grab the display name of the sender
SENDER_DISPLAY_NAME=$(echo "$EMAIL" | maddr -h from -d -)
+# Grab the target address
+RECIPIENT=$(echo "$EMAIL" | maddr -a -h to -)
+
# Sender date as a unix timestamp
DATE_UNIX=$(echo "$EMAIL" | mhdr -h date -D -)
@@ -89,5 +92,12 @@ rm "$REPLY_PATH"
EOF
# Use the z queue for maximum niceness
-at -q z -f "$ATSCRIPT" now + 10 min
+case $RECIPIENT in
+ "fredrick+ritalin@"*)
+ at -q z -f "$ATSCRIPT" now + 1 min
+ ;;
+ *)
+ at -q z -f "$ATSCRIPT" now + 20 min
+ ;;
+esac
rm "$ATSCRIPT"