From 0fc1cb64def2ac7c0e234670d2c72bd71107a818 Mon Sep 17 00:00:00 2001 From: Harald Pfeiffer Date: Tue, 26 Jun 2018 23:32:40 +0200 Subject: Initial commit --- lib/email-filter.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 lib/email-filter.py (limited to 'lib') diff --git a/lib/email-filter.py b/lib/email-filter.py new file mode 100644 index 0000000..1b44e1e --- /dev/null +++ b/lib/email-filter.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python3 + +# Please prefer the email-gravatar.lua using lua: as a prefix over this script. This +# script is very slow, in comparison. +# +# This script may be used with the email-filter or repo.email-filter settings in cgitrc. +# +# The following environment variables can be used to retrieve the configuration +# of the repository for which this script is called: +# CGIT_REPO_URL ( = repo.url setting ) +# CGIT_REPO_NAME ( = repo.name setting ) +# CGIT_REPO_PATH ( = repo.path setting ) +# CGIT_REPO_OWNER ( = repo.owner setting ) +# CGIT_REPO_DEFBRANCH ( = repo.defbranch setting ) +# CGIT_REPO_SECTION ( = section setting ) +# CGIT_REPO_CLONE_URL ( = repo.clone-url setting ) +# +# This simply receives text on stdin and replaces any occurrence of "@" by +# " _ " to obfuscate emails. Not the most sophisticated algorithm (for now), +# but laziness and time are two important factors. +# It still helps with receiving email only from the wealthy Nigerian princes. +# I need to make money, too. + +from sys import stdin +text = stdin.read().strip() +text=text.replace("@", " _ ") + +print(text) -- cgit v1.2.3