|
@@ -48,8 +48,11 @@ def inject(m):
|
|
|
e = m.get('Content-Transfer-Encoding','').lower()
|
|
|
payload = m.get_payload(decode=True).decode(m.get_content_charset("utf-8"))
|
|
|
|
|
|
- if c == 'text/plain' and txt not in payload:
|
|
|
- payload += f"\n{txt}\n"
|
|
|
+ if c == 'text/plain':
|
|
|
+ if txt.strip() in payload:
|
|
|
+ payload = payload.replace(txt.strip(), '')
|
|
|
+
|
|
|
+ payload = f"{payload.strip()}\n\n{txt}\n"
|
|
|
|
|
|
elif c == 'text/html':
|
|
|
h = HTML.fromstring(payload)
|