docker-postfix/scripts/email-anonymizer.sh
Sergio Del Río Mayoral a1a2082ae1 Add email anonymizer option in case is needed for GDPR
This new feature will anonymize emails in the Postfix logs. This allows
you to keep them indefinetely while being compliant with GDPR.

Based on excellent work on [this pull request](https://github.com/bokysan/docker-postfix/pull/91).

Check `README.md` for more details.
2021-12-07 13:43:13 +01:00

13 lines
No EOL
409 B
Bash
Executable file

#!/usr/bin/env bash
set -e
SCRIPT_DIR=$(CDPATH='' cd -- "$(dirname -- "$0")" && pwd)
##
# Email anonymizer is a filter which goes through every line reported in syslog and filters
# out email addresess.
# This ensures that python output buffering is disabled and outputs
# are sent straight to the terminal
##
while ! env PYTHONUNBUFFERED=1 python3 "$SCRIPT_DIR/email-anonymizer.py" "$@"; do
sleep 1
done