aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Johannes Christ <[email protected]>2024-09-03 20:17:05 +0200
committerGravatar Johannes Christ <[email protected]>2024-09-03 20:17:05 +0200
commit4d84f76e5a4299c047d9c6e70124106daaa0fcaa (patch)
tree4703f827dc3ae8cd3ca7261eee6e5e8e726fa2d4
parentFix Jitsi SASL authentication (diff)
Send raw date to Fredrick vacation script
Allows to add the timezone to it to properly determine local sender time and Fredrick's current time (if he's travelling within his home country, that is).
-rw-r--r--ansible/roles/postfix/templates/services/fredrick-reply.sh.j26
1 files changed, 4 insertions, 2 deletions
diff --git a/ansible/roles/postfix/templates/services/fredrick-reply.sh.j2 b/ansible/roles/postfix/templates/services/fredrick-reply.sh.j2
index f4ef663..97de345 100644
--- a/ansible/roles/postfix/templates/services/fredrick-reply.sh.j2
+++ b/ansible/roles/postfix/templates/services/fredrick-reply.sh.j2
@@ -38,9 +38,11 @@ JSON_BODY=$(echo -n "$BODY" | jq -R -s . | sed 's/\\n/\\\\n/g')
FINAL_JSON=$(jq -r -c -n \
--arg from "$SENDER" \
--arg subject "$ORIGINAL_SUBJECT" \
- --arg sent_at "$DATE_UNIX" \
+ --arg sent_at_unix "$DATE_UNIX" \
+ --arg sent_at_unparsed "$MESSAGE_DATE" \
--argjson body "$JSON_BODY" \
- '{sent_at: $sent_at, from: $from, subject: $subject, body: $body}')
+ '{sent_at_unix: $sent_at, sent_at_unparsed: $sent_at_unparsed,
+ from: $from, subject: $subject, body: $body}')
FRED_RESPONSE=$(curl -X POST "$FREDRICK_ENDPOINT" \
-H "Authorization: $FREDRICK_TOKEN" \