You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
Hello
Generating and parsing emails was already a big challenge.
Modifying an existing email is a level harder.
Pyzmail was very well tested and reliable when I released it some years ago.
I don't have time to imagine and write tests for a set_payload() function to keep the high quality.
This is something I can't support.
My first concern is that I don't know if python email parser and generator are "invariant".
In other word if
It looks like you have a good understanding of the problem and are already close of the solution.
You can look at generate.py about how I use set_payload() to generate payload.
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?
If this is correct, do you support a patch for a set_payload function?
The text was updated successfully, but these errors were encountered: