Skip to content

Commit 2e02cb6

Browse files
committed
Add Fritz router report pipeline for email
1 parent f5a7046 commit 2e02cb6

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

ansible/roles/postfix/tasks/main.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,9 @@
242242
243243
fredrick-pipe unix - n n - - pipe
244244
flags=Fq user=servicemailer argv=/usr/bin/nice /etc/postfix/service-scripts/fredrick-reply.sh
245+
246+
fritz-report-pipe unix - n n - - pipe
247+
flags=Fq user=servicemailer argv=/usr/bin/nice /etc/postfix/service-scripts/fritz-report-pipe.sh
245248
tags:
246249
- role::postfix
247250
- role::postfix::service-scripts
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env sh
2+
# {{ ansible_managed }}
3+
#
4+
# Forwards emails sent to [email protected] to the fritz-report service.
5+
# This generates a Discord report for information from Chris's Fritz!Box router.
6+
7+
# Write mail to a temporary file
8+
TEMPFILE=$(mktemp /tmp/fritz-pipe.XXXXXX)
9+
cat > "$TEMPFILE"
10+
11+
# Run the FRITZ!Box Discord binary with the email as input
12+
/home/joe/scripts/fritz-router-discord "$TEMPFILE"
13+
14+
# Clean up the temporary file
15+
rm "$TEMPFILE"

ansible/roles/postfix/templates/transport.j2

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
#
33
# Postfix Mail Transport Map
44

5-
[email protected] fortune-pipe:
5+
[email protected] fortune-pipe:
66

7-
[email protected] fredrick-pipe:
7+
[email protected] fredrick-pipe:
8+
9+
[email protected] fritz-report-pipe:

0 commit comments

Comments
 (0)