From 8476718a063a39d839d872623169dfc081964a62 Mon Sep 17 00:00:00 2001 From: Johannes Christ Date: Mon, 3 Feb 2025 21:27:00 +0100 Subject: [PATCH] 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? --- .../postfix/templates/services/fredrick-reply.sh.j2 | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/ansible/roles/postfix/templates/services/fredrick-reply.sh.j2 b/ansible/roles/postfix/templates/services/fredrick-reply.sh.j2 index b33c7c4a..7fe77b31 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"