mirror of
https://github.com/chatmail/relay.git
synced 2026-05-19 20:38:05 +00:00
filtermail: better performance for removing Version
This commit is contained in:
@@ -104,8 +104,8 @@ def check_armored_payload(payload: str, outgoing: bool):
|
|||||||
# Disallow comments in outgoing messages
|
# Disallow comments in outgoing messages
|
||||||
version_comment = "Version: "
|
version_comment = "Version: "
|
||||||
if payload.startswith(version_comment):
|
if payload.startswith(version_comment):
|
||||||
version_line = payload.splitlines()[0]
|
splitindex = payload.find("\r\n")
|
||||||
payload = payload.removeprefix(version_line)
|
payload = payload[splitindex:]
|
||||||
if outgoing:
|
if outgoing:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user