comments, fix sendmail path

This commit is contained in:
fordprefect
2022-02-11 14:25:45 +01:00
parent 96b030579d
commit cbda9c0dd9

View File

@@ -1,3 +1,14 @@
#!/usr/bin/python
"""
Python reimplementation of the here shown bash script:
https://dukun.de/xox/altermime/postfix-altermime-howto-2.html
Use at your own risk, comes without warranty.
License: GPLv3
Author: Georg Schlisio
"""
import subprocess
import sys
@@ -10,9 +21,9 @@ EX_UNAVAILABLE = 69
am = subprocess.run(["/usr/bin/altermime",
"--input=-",
f"--disclaimer={DISCLAIMER}",
f"--htmltoo",
"--htmltoo",
"--force-for-bad-html",
#"--xheader='blablubb'",
#"--xheader='blablubb'", # example of how to add arbitrary header
],
stdin=sys.stdin,
capture_output=True)
@@ -20,7 +31,5 @@ am = subprocess.run(["/usr/bin/altermime",
if am.returncode > 0:
sys.exit(EX_UNAVAILABLE)
sendmailprocess = subprocess.Popen(["./sendmail"] + sys.argv[1:], stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.PIPE)
sendmailprocess = subprocess.Popen(["/usr/bin/sendmail"] + sys.argv[1:], stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.PIPE)
sendmailprocess.communicate(input=am.stdout)
sys.exit(0)