+_libconfig_sanitize() {
+ ${NOTMUCH_PYTHON} /dev/fd/3 3<<'EOF'
+import os, sys, pwd, socket
+
+pw = pwd.getpwuid(os.getuid())
+user = pw.pw_name
+name = pw.pw_gecos.partition(",")[0]
+fqdn = socket.getaddrinfo(socket.gethostname(), 0, 0,
+ socket.SOCK_STREAM, 0, socket.AI_CANONNAME)[0][3]
+for l in sys.stdin:
+ if l[:4] == "08: ":
+ l = l.replace(user, "USERNAME", 1).replace("@" + fqdn, "@FQDN", 1)
+ l = l.replace(".(none)", "", 1).replace(".localdomain", "", 1)
+ elif l[:4] == "10: ":
+ l = l.replace("'" + name, "'USER_FULL_NAME", 1)
+ sys.stdout.write(l)
+EOF
+}
+