From 44bb1b83488ea6acf4b0f9f1deb6384c7dfa98fa Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sat, 16 Jan 2021 09:57:24 +0100 Subject: helper: drop unused RFC3156_canonicalize() --- alot/helper.py | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/alot/helper.py b/alot/helper.py index 4511059f..eb6c1969 100644 --- a/alot/helper.py +++ b/alot/helper.py @@ -480,27 +480,6 @@ def mailto_to_envelope(mailto_str): headers, body = parse_mailto(mailto_str) return Envelope(bodytext=body, headers=headers) - -def RFC3156_canonicalize(text): - """ - Canonicalizes plain text (MIME-encoded usually) according to RFC3156. - - This function works as follows (in that order): - - 1. Convert all line endings to \\\\r\\\\n (DOS line endings). - 2. Encode all occurrences of "From " at the beginning of a line - to "From=20" in order to prevent other mail programs to replace - this with "> From" (to avoid MBox conflicts) and thus invalidate - the signature. - - :param text: text to canonicalize (already encoded as quoted-printable) - :rtype: str - """ - text = re.sub("\r?\n", "\r\n", text) - text = re.sub("^From ", "From=20", text, flags=re.MULTILINE) - return text - - def get_xdg_env(env_name, fallback): """ Used for XDG_* env variables to return fallback if unset *or* empty """ env = os.environ.get(env_name) -- cgit v1.2.3