aboutsummaryrefslogtreecommitdiff
path: root/src/mailman_pgp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mailman_pgp')
-rw-r--r--src/mailman_pgp/pgp/mime.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/mailman_pgp/pgp/mime.py b/src/mailman_pgp/pgp/mime.py
index 22ebd65..751b9e5 100644
--- a/src/mailman_pgp/pgp/mime.py
+++ b/src/mailman_pgp/pgp/mime.py
@@ -172,6 +172,7 @@ class MIMEWrapper:
micalg = self._micalg(signature.hash_algorithm)
out = MIMEMultipart('signed', micalg=micalg,
protocol=MIMEWrapper._signed_type)
+ out.preamble = 'This is an OpenPGP/MIME signed message (RFC 4880 and 3156)'
second_part = MIMEApplication(_data=str(signature),
_subtype=MIMEWrapper._signature_subtype,
@@ -223,14 +224,25 @@ class MIMEWrapper:
pmsg = key.encrypt(pmsg, cipher=cipher,
session_key=session_key)
del session_key
+
out = MIMEMultipart('encrypted',
protocol=MIMEWrapper._encrypted_type)
+ out.preamble = 'This is an OpenPGP/MIME encrypted message (RFC 4880 and 3156)'
+
first_part = MIMEApplication(_data='Version: 1',
_subtype=MIMEWrapper._encryption_subtype,
_encoder=encode_7or8bit)
+ first_part.add_header('content-description',
+ 'PGP/MIME version identification')
+
second_part = MIMEApplication(_data=str(pmsg),
_subtype='octet-stream',
- _encoder=encode_7or8bit)
+ _encoder=encode_7or8bit,
+ name='encrypted.asc')
+ second_part.add_header('content-description',
+ 'OpenPGP encrypted message')
+ second_part.add_header('content-disposition', 'inline',
+ filename='encrypted.asc')
out.attach(first_part)
out.attach(second_part)
copy_headers(self.msg, out)