mirror of
https://github.com/chatmail/relay.git
synced 2026-05-19 20:38:05 +00:00
filtermail: strip any empty lines at the end (#496)
This commit is contained in:
@@ -2,6 +2,9 @@
|
|||||||
|
|
||||||
## untagged
|
## untagged
|
||||||
|
|
||||||
|
- filtermail: don't require exactly 2 lines after openPGP payload
|
||||||
|
([#497](https://github.com/chatmail/chatmail/pull/497))
|
||||||
|
|
||||||
- cmdeploy dns: offer alternative DKIM record format for some web interfaces
|
- cmdeploy dns: offer alternative DKIM record format for some web interfaces
|
||||||
([#470](https://github.com/deltachat/chatmail/pull/470))
|
([#470](https://github.com/deltachat/chatmail/pull/470))
|
||||||
|
|
||||||
|
|||||||
@@ -80,7 +80,9 @@ def check_armored_payload(payload: str):
|
|||||||
return False
|
return False
|
||||||
payload = payload.removeprefix(prefix)
|
payload = payload.removeprefix(prefix)
|
||||||
|
|
||||||
suffix = "-----END PGP MESSAGE-----\r\n\r\n"
|
while payload.endswith("\r\n"):
|
||||||
|
payload = payload.removesuffix("\r\n")
|
||||||
|
suffix = "-----END PGP MESSAGE-----"
|
||||||
if not payload.endswith(suffix):
|
if not payload.endswith(suffix):
|
||||||
return False
|
return False
|
||||||
payload = payload.removesuffix(suffix)
|
payload = payload.removesuffix(suffix)
|
||||||
|
|||||||
@@ -205,10 +205,20 @@ UN4fiB0KR9JyG2ayUdNJVkXZSZLnHyRgiaadlpUo16LVvw==\r
|
|||||||
=b5Kp\r
|
=b5Kp\r
|
||||||
-----END PGP MESSAGE-----\r
|
-----END PGP MESSAGE-----\r
|
||||||
\r
|
\r
|
||||||
|
\r
|
||||||
"""
|
"""
|
||||||
|
|
||||||
assert check_armored_payload(payload) == True
|
assert check_armored_payload(payload) == True
|
||||||
|
|
||||||
|
payload = payload.removesuffix("\r\n")
|
||||||
|
assert check_armored_payload(payload) == True
|
||||||
|
|
||||||
|
payload = payload.removesuffix("\r\n")
|
||||||
|
assert check_armored_payload(payload) == True
|
||||||
|
|
||||||
|
payload = payload.removesuffix("\r\n")
|
||||||
|
assert check_armored_payload(payload) == True
|
||||||
|
|
||||||
payload = """-----BEGIN PGP MESSAGE-----\r
|
payload = """-----BEGIN PGP MESSAGE-----\r
|
||||||
\r
|
\r
|
||||||
HELLOWORLD
|
HELLOWORLD
|
||||||
|
|||||||
Reference in New Issue
Block a user