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:52:39 +0100
commit8476718a063a39d839d872623169dfc081964a62 (patch)
treed11bc239f2397042c8fb94b545c57b8e774c40e3
parentImplement Chris' new savings policy (diff)
Learn from Fredrick's therapy results
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"