Code

Add new config-option 'password_pbkdf2_default_rounds' in 'main' section
[roundup.git] / roundup / rfc2822.py
index 8fba2ad819de83f806b61960f6819063f5392d27..7e016c280fca036118bae1bc875e9bc08b4b3402 100644 (file)
@@ -18,6 +18,8 @@ ecre = re.compile(r'''
 
 hqre = re.compile(r'^[A-z0-9!"#$%%&\'()*+,-./:;<=>?@\[\]^_`{|}~ ]+$')
 
+CRLF = '\r\n'
+
 def base64_decode(s, convert_eols=None):
     """Decode a raw base64 string.
 
@@ -139,7 +141,7 @@ def encode_header(header, charset='utf-8'):
         if c == ' ':
             quoted += '_'
         # These characters can be included verbatim
-        elif hqre.match(c):
+        elif hqre.match(c) and c not in '_=?':
             quoted += c
         # Otherwise, replace with hex value like =E2
         else: