git.lirion.de

Of git, get, and gud

aboutsummaryrefslogtreecommitdiffstats
path: root/lib/email-filter.py
blob: 40757991a20b8e74f2ae43ee7b2081161219c8df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env python3

# 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)