From cbda9c0dd920062d799e56d4ed7bc224c9581c97 Mon Sep 17 00:00:00 2001 From: fordprefect Date: Fri, 11 Feb 2022 14:25:45 +0100 Subject: [PATCH] comments, fix sendmail path --- altermime.py | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/altermime.py b/altermime.py index 5197e71..bec015b 100644 --- a/altermime.py +++ b/altermime.py @@ -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)