1 #!/usr/bin/env python3.6
7 with open(fn, "rb") as fd:
8 lines = fd.read().split(b"\n")
13 for i, line in enumerate(lines):
17 if line.startswith(b" "):
22 if line.startswith(what):
27 return [l for n, l in enumerate(lines) if n not in idx]
30 lines = dup(lines, b"To")
31 lines = dup(lines, b"From")
32 lines = dup(lines, b"Subject")
33 with open(out, "wb") as fd:
34 fd.write(b"\n".join(lines))