diff options
author | Dylan Baker <baker.dylan.c@gmail.com> | 2017-07-18 09:50:44 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-18 09:50:44 -0700 |
commit | 3995747c4efed39a74e75b5c11061574bc1e8cd8 (patch) | |
tree | a1de05d28d284ea5a40595eb9ce5d0e784da4c2a /alot | |
parent | 9da1345a977ba7061a357d072ead632cfe1625f4 (diff) | |
parent | 22ad7af98ad1daaf8ccef6515acefeb3b964730e (diff) |
Merge pull request #1088 from dcbaker/submit/gpg-signed-no-newline
helper: Do not add a newline to the end of a signed section
Diffstat (limited to 'alot')
-rw-r--r-- | alot/helper.py | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/alot/helper.py b/alot/helper.py index b73ee7b1..effec6b3 100644 --- a/alot/helper.py +++ b/alot/helper.py @@ -585,8 +585,7 @@ def RFC3156_canonicalize(text): This function works as follows (in that order): 1. Convert all line endings to \\\\r\\\\n (DOS line endings). - 2. Ensure the text ends with a newline (\\\\r\\\\n). - 3. Encode all occurences of "From " at the beginning of a line + 2. Encode all occurences 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. @@ -595,8 +594,6 @@ def RFC3156_canonicalize(text): :rtype: str """ text = re.sub("\r?\n", "\r\n", text) - if not text.endswith("\r\n"): - text += "\r\n" text = re.sub("^From ", "From=20", text, flags=re.MULTILINE) return text |