This avoids the abiguously described "General error":
S: OK GPGME-Tool 1.3.3-git73b439a ready
C: ARMOR true
S: OK
C: RECIPIENT pgp-mime@invalid.com
S: S RECIPIENT
B2EDBE0E771A4B8708DD16A7511AEDA64332B6E3
S: OK
C: # descriptors in flight: [3]
C: INPUT FD
S: OK
C: # descriptors in flight: [6]
C: OUTPUT FD
S: OK
C: ENCRYPT
S: ERR 1 General error <Unspecified source>
C: BYE
S: OK closing connection
I have spend some time trying to track this one down in gpgme-tool,
but without success.
>>> from pgp_mime.email import encodedMIMEText
>>> message = encodedMIMEText('Hi\nBye')
>>> message['To'] = 'pgp-mime-test <pgp-mime@invalid.com>'
>>> from pgp_mime.email import encodedMIMEText
>>> message = encodedMIMEText('Hi\nBye')
>>> message['To'] = 'pgp-mime-test <pgp-mime@invalid.com>'
- >>> encrypted = encrypt(message)
+ >>> encrypted = encrypt(message, always_trust=True)
>>> encrypted.set_boundary('boundsep')
>>> print(encrypted.as_string()) # doctest: +ELLIPSIS, +REPORT_UDIFF
Content-Type: multipart/encrypted; protocol="application/pgp-encrypted"; micalg="pgp-sha1"; boundary="boundsep"
>>> encrypted.set_boundary('boundsep')
>>> print(encrypted.as_string()) # doctest: +ELLIPSIS, +REPORT_UDIFF
Content-Type: multipart/encrypted; protocol="application/pgp-encrypted"; micalg="pgp-sha1"; boundary="boundsep"
>>> from pgp_mime.email import encodedMIMEText
>>> message = encodedMIMEText('Hi\nBye')
>>> from pgp_mime.email import encodedMIMEText
>>> message = encodedMIMEText('Hi\nBye')
- >>> encrypted = encrypt(message, recipients=['<pgp-mime@invalid.com>'])
+ >>> encrypted = encrypt(
+ ... message, recipients=['<pgp-mime@invalid.com>'], always_trust=True)
>>> decrypted = decrypt(encrypted)
>>> print(decrypted.as_string().replace('\r\n', '\n'))
... # doctest: +ELLIPSIS, +REPORT_UDIFF
>>> decrypted = decrypt(encrypted)
>>> print(decrypted.as_string().replace('\r\n', '\n'))
... # doctest: +ELLIPSIS, +REPORT_UDIFF