Browse Source

When encode is not possible, assume it's already bytes, so return it raw with a warning

master
nemunaire 2 months ago
parent
commit
a52c756159
  1. 6
      envelope.py

6
envelope.py

@ -44,7 +44,11 @@ def assume_rfc3156(msg):
def assume_oldstyle(payload):
yield MailTest("Found BEGIN PGP SIGNED MESSAGE: message treated as old style PGP email.")
yield payload.encode()
try:
yield payload.encode()
except:
yield MailTest("Non-armored signed message discovered. Avoid using binary message over SMTP (see RFC2015 #2. PGP data formats).", 2)
yield payload

Loading…
Cancel
Save