diff --git a/gpgmymail b/gpgmymail index 03132a1..3bf1705 100755 --- a/gpgmymail +++ b/gpgmymail @@ -83,6 +83,19 @@ def decode_email(message: email.message.Message) -> email.message.Message: decoded_bytes: bytes, most_recent_boundary: str = None ) -> bytes: + """ + change decoded_bytes such that part is decoded if base64 (unchanged if + not) + + see usage below for examples + + :param part: email.message.Message to be decoded + :param decoded_bytes: the email as a bytes object (ie not a string with + encoding), will have modified version returned + :param most_recent_boundary: str of the most recent boundary so we + don't overwrite this + :return: bytes of decoded_bytes with part decoded if base64 + """ if part.get("Content-Transfer-Encoding") == "base64": b64_str = part.get_payload() # remove the boundary as we don't want to change this