summaryrefslogtreecommitdiff
path: root/alot/helper.py
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2021-01-16 09:57:24 +0100
committerAnton Khirnov <anton@khirnov.net>2021-01-16 09:57:24 +0100
commit44bb1b83488ea6acf4b0f9f1deb6384c7dfa98fa (patch)
tree20bddc6cb59cfe8eadb63cf4680853b8fa1f0f7b /alot/helper.py
parent7ba6454a8c029462c7f86bb1090fe74ff28d093f (diff)
helper: drop unused RFC3156_canonicalize()
Diffstat (limited to 'alot/helper.py')
-rw-r--r--alot/helper.py21
1 files changed, 0 insertions, 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)