This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ponymail-foal.git

commit d358058abea307ddc7d6dc7913d2993aca153efc
Author: Sebb <[email protected]>
AuthorDate: Sat Oct 9 09:44:45 2021 +0100

    Revert "Canonicalisation of 'From ' quoting variations"
    
    This reverts commit c80e7842ae274c22afefa817e18bd936c981ee8f.
---
 tools/plugins/dkim_id.py | 21 +--------------------
 1 file changed, 1 insertion(+), 20 deletions(-)

diff --git a/tools/plugins/dkim_id.py b/tools/plugins/dkim_id.py
index 8925c3e..27c6e79 100644
--- a/tools/plugins/dkim_id.py
+++ b/tools/plugins/dkim_id.py
@@ -21,7 +21,6 @@ DKIM-ID Generator Code
 
 import base64
 import hmac
-import re
 from typing import List, Optional, Set, Tuple
 
 # Types
@@ -254,27 +253,9 @@ def rfc6376_split_canon(
         # Which makes this function polymorphic really
         # This is not reflected in its type signature
         headers, body = rfc6376_simple_holistic(headers, body)
-        body = _strip_gt_from(body)
+
     return (headers, body)
 
-def _strip_gt_from(body: bytes) -> bytes:
-    r"""
-    Convert all escaped '>+From ' back to 'From '
-
-    >>> _strip_gt_from(b'> From ')
-    b'> From '
-    >>> _strip_gt_from(b' >From ')
-    b' >From '
-    >>> _strip_gt_from(b'>From_')
-    b'>From_'
-    >>> _strip_gt_from(b'>From ')
-    b'From '
-    >>> _strip_gt_from(b'>>>From ')
-    b'From '
-    >>> _strip_gt_from(b'\r\n>From x\r\n>From y')
-    b'\r\nFrom x\r\nFrom y'
-    """
-    return re.sub(b'^>+From ', b'From ', body, flags = re.MULTILINE)
 
 def rfc6376_join(headers: Headers, body: Optional[bytes] = None) -> bytes:
     r"""

Reply via email to