-
Notifications
You must be signed in to change notification settings - Fork 31
Open
Description
Assuming i'd be using pyzmail as an email processor which replaces all url's with a shortener (for tracking), is the following approach correct?
for part in msg.mailparts:
payload = part.get_payload() (this also decodes it and trasnforms it into unicode)
if payload.type in ["text/plain", "text/html"]:
# process payload in some way, replace links, etc..
payload = payload.encode(part.charset)
cte = part.part.get("Content-Transfer-Encoding") or "7bit"
part.part.set_payload(encode payload according to cte, quopri, base64, etc..)
If this is correct, do you support a patch for a set_payload function?
Metadata
Metadata
Assignees
Labels
No labels