diff --git a/fix-eml.py b/fix-eml.py new file mode 100755 index 0000000..124cbdb --- /dev/null +++ b/fix-eml.py @@ -0,0 +1,23 @@ +#!/usr/bin/python +import re +import sys + +if len(sys.argv) != 2: + print(f"Usage: {sys.argv[0]} FILE") + sys.exit(1) + +with open(sys.argv[1]) as f: + line = "" + for l in f: + if len(l) == 77 and l[-2] == "=": + line += l[:-2] + else: + line += l + if not re.match("NetApp Security WARNING:", line): + line = re.sub("^\+ ", "+ ", line, count=1) + line = re.sub("^\- ", "- ", line, count=1) + line = re.sub("^ ", " ", line, count=1) + line = re.sub(" ", " ", line) + line = re.sub("=3D", "=", line) + print(line, end="") + line = ""