Menu

#436 TB error "Unable to save your message as draft." when drafts are encrypted; Enigmail error: "mimeEncrypt.js: caught exception: undefined"

fixed
nobody
None
1.8.0
Major
31.5.0
2.0.17
Linux
1.8.1
nobody
2015-05-18
2015-03-20
Tom Metro
No

Steps to reproduce:

  1. create a new message
  2. address to 'foo' and fill in some body text
  3. File -> Save

This result in "Unable to save your message as draft."

The TB error console reports:

[JavaScript Error: "mimeEncrypt.js: caught exception: undefined
Message: 'undefined'
File: undefined
Line: undefined
Stack: undefined
"]

And the Enigmail debug log shows:

2015-03-20 12:47:14.838 [DEBUG] enigmailMsgComposeOverlay.js: Enigmail.msg.encryptMsg: detected save draft
2015-03-20 12:47:14.838 [DEBUG] enigmailMsgComposeOverlay.js: saveDraftMessage()
2015-03-20 12:47:14.838 [DEBUG] enigmailMsgComposeOverlay.js: Enigmail.msg.setDraftStatus - enabling draft mode
[...]
2015-03-20 12:47:14.838 [DEBUG] enigmailMsgComposeOverlay.js: Enigmail.msg.keySelection(): skip key selection because we neither have "to" nor "cc" addresses
2015-03-20 12:47:14.903 [ERROR] mimeEncrypt.js: caught exception: undefined
Message: 'undefined'
File: undefined
Line: undefined
Stack: undefined

I'm not sure if this is due to the failure to find a matching key for the message recipient, or due to a independent failure in mimeEncrypt.js. Either way, looks like a bug.

Workaround: go into Account Settings -> OpenPGP Security and uncheck "Encrypt draft messages on saving" option.

Related

Bugs: #445

Discussion

  • Ludwig Hügelschäfer

    Hi,

    would you please try tomorrows nightly build
    (https://www.enigmail.net/download/nightly.php) and tell if it fixes
    your problem?

    Thanks!

    Ludwig

     
  • Patrick Brunschwig

    • status: open --> fixed
    • Fixed in version: --- --> 1.9.0
     
  • Patrick Brunschwig

    This is fixed on master.

     
  • Patrick Brunschwig

    The workaround is to change enable PGP/MIME as default in the account settings.

     
  • Patrick Brunschwig

    • Fixed in version: 1.9.0 --> 1.8.1
     
  • Oliver Carl

    Oliver Carl - 2015-03-23

    Sorry, the problem (see duplicate bug 445 for steps to reproduce) still persists with Enigmail 1.8.1.

    Enigmail version 1.8.1
    OS/CPU=Windows NT 6.1; WOW64
    Platform=Windows
    Non-default preference values:
    maxIdleMinutes: 60
    displaySignWarn: false
    wrapHtmlBeforeSend: false
    warnOnRulesConflict: 1
    keyserver: pgp.mit.edu, pool.sks-keyservers.net, subkeys.pgp.net, ldap://certserver.pgp.com
    logDirectory: d:\trans\enig.log
    encryptAttachments: 2
    advancedUser: true
    configuredVersion: 1.8.1
    saveEncrypted: 2
    composeHtmlAlertCount: 0
    encryptAttachmentsSkipDlg: 1

    [...]

    2015-03-23 22:32:47.751 [DEBUG] enigmailMsgComposeOverlay.js: Enigmail.msg.sendMessageListener
    2015-03-23 22:32:47.751 [DEBUG] enigmailMsgComposeOverlay.js: Enigmail.msg.encryptMsg: msgSendType=4, Enigmail.msg.sendMode=0, Enigmail.msg.statusEncrypted=0
    2015-03-23 22:32:47.752 [DEBUG] enigmailMsgComposeOverlay.js: Enigmail.msg.encryptMsg: detected save draft
    2015-03-23 22:32:47.752 [DEBUG] enigmailMsgComposeOverlay.js: saveDraftMessage()
    2015-03-23 22:32:47.752 [DEBUG] enigmailMsgComposeOverlay.js: Enigmail.msg.setDraftStatus - enabling draft mode
    2015-03-23 22:32:47.752 [DEBUG] enigmailMsgComposeOverlay.js: Enigmail.msg.getSenderUserId: type of userIdValue=object
    2015-03-23 22:32:47.752 [DEBUG] =====> keySelection()
    2015-03-23 22:32:47.752 [DEBUG] enigmailMsgComposeOverlay.js: Enigmail.msg.keySelection()
    2015-03-23 22:32:47.752 [DEBUG] enigmailMsgComposeOverlay.js: Enigmail.msg.keySelection(): skip key selection because we neither have "to" nor "cc" addresses
    2015-03-23 22:32:47.777 [DEBUG] enigmailCommon.jsm: encryptMessageStart: uiFlags=0, from me@example.com to me@example.com, hashAlgorithm=null (00000282)
    2015-03-23 22:32:47.777 [DEBUG] enigmailCommon.jsm: getEncryptCommand: hashAlgorithm=null
    2015-03-23 22:32:47.777 enigmailCommon.jsm: execStart: command = "C:\Program Files (x86)\GNU\GnuPG\pub\gpg2.exe" --charset utf-8 --display-charset utf-8 --batch --no-tty --status-fd 2 -a -t --encrypt -r me@example.com -u me@example.com, needPassphrase=0, domWindow=[object ChromeWindow], listener=[object Object]
    2015-03-23 22:32:47.777 [CONSOLE] enigmail> "C:\Program Files (x86)\GNU\GnuPG\pub\gpg2.exe" --charset utf-8 --display-charset utf-8 --batch --no-tty --status-fd 2 -a -t --encrypt -r me@example.com -u me@example.com
    2015-03-23 22:32:47.780 [DEBUG] enigmail> DONE
    2015-03-23 22:32:47.893 [DEBUG] enigmailCommon.jsm: encryptMessageEnd: uiFlags=0, sendFlags=00000282, outputLen=0
    2015-03-23 22:32:47.893 [DEBUG] enigmailCommon.jsm: parseErrorOutput: status message:
    gpg: E786F22A: Es gibt keine Garantie, daá dieser Schlssel wirklich dem angegebenen Besitzer geh”rt.
    [GNUPG:] INV_RECP 10 me@example.com
    gpg: [stdin]: encryption failed: Unbrauchbarer öffentlicher Schlüssel

    2015-03-23 22:32:47.893 [DEBUG] enigmailCommon.jsm: parseErrorOutput: statusFlags = 00000400
    2015-03-23 22:32:47.893 [DEBUG] enigmailCommon.jsm: parseErrorOutput(): return with errorMsg = gpg: E786F22A: Es gibt keine Garantie, daá dieser Schlssel wirklich dem angegebenen Besitzer geh”rt.
    gpg: [stdin]: encryption failed: Unbrauchbarer öffentlicher Schlüssel
    2015-03-23 22:32:47.893 [DEBUG] enigmailCommon.jsm: encryptMessageEnd: command execution exit code: 2
    2015-03-23 22:32:47.893 [ERROR] alert: caught exception: NS_ERROR_NOT_AVAILABLE
    Message: 'Cannot call openModalWindow on a hidden window'
    File: undefined
    Line: 357
    Stack: undefined
    2015-03-23 22:32:47.893 [ERROR] mimeEncrypt.js: caught exception: undefined
    Message: 'undefined'
    File: undefined
    Line: undefined
    Stack: undefined
    2015-03-23 22:32:47.896 [ERROR] subprocess.jsm: trying to write data to closed stdin2015-03-23 22:32:49.252 [DEBUG] enigmailMsgComposeOverlay.js: ECSL.ComposeProcessDone: 2147500037

     
  • Patrick Brunschwig

    Actually the error now is quite different from before. While before encryption was not attempted the error now is entirely due to your keys:

    gpg: E786F22A: Es gibt keine Garantie, dass dieser Schlüssel wirklich dem angegebenen Besitzer gehört.
    gpg: [stdin]: encryption failed: Unbrauchbarer öffentlicher Schlüssel
    2015-03-23 22:32:47.893 [DEBUG] enigmailCommon.jsm: encryptMessageEnd: command execution exit code: 2

    I don't think that I'll need to explain this in more details ;-).

     
  • Martin Raiber

    Martin Raiber - 2015-05-13

    Have the same error as Oliver Carl. GPG says the key is "unbrauchbar" but signing later with the same key works. Only saving as draft does not seem to work.

     
  • Patrick Brunschwig

    There is a difference between using the private key (which seems to work in your case) and the public key. For signing you'll need your private key, but for encryption you'll need your public key.

    Unusable public key can mean that the public key has expired, but it can also mean that you need to certify it (see https://www.gnupg.org/faq/subkey-cross-certify.html)

     
  • Martin Raiber

    Martin Raiber - 2015-05-18

    I can also send encrypted mails with that key. The only thing that does not work is saving drafts.

     
  • Martin Raiber

    Martin Raiber - 2015-05-18

    Okay: It works if I set the trust level of my own certificate to "trust absolutely" (from "trust").

    When encrypting for it enigmail calls gpg with "--trust-model always". Maybe that would also be a good idea for saving drafts? (I already specified the key as my own)

     

    Last edit: Martin Raiber 2015-05-18
  • Ludwig Hügelschäfer

    Setting the trust level of own certificate to ultimate trust is absolutely necessary for a fully working Enigmail and/or GnuPG system. Therefore we are planning to implement an automatic check for this, also a possibility to set ultimate will be offered to do this on import.

    I bet you someday imported your key into your current installation.

     
    • Daniel Kahn Gillmor

      Setting your own certificate to absolute ownertrust is not a requirement for a fully-working GnuPG system. It would be a shame if it were a requirement for enigmail.

      there is a requirement for installations that care about calculated validity that there is some root (or roots) of ownertrust they can rely on, but it should not be mandatory to have that ownertrust set on the secret key you plan to use on the account.

      I think the automatic checks you've proposed are good ideas for many users, but they won't happen silently or without confirmation, right?

       
      • Ludwig Hügelschäfer

        Well, I think using the web of trust and all what makes it up (e.g. calculated validities) is part of a fully working GnuPG system.

        Automatically encrypted drafts within Enigmail seems to require a full validity of your own key - we've got lots of reports of people having difficulties if their key is not regarded fully valid. Maybe the draft encryption call to gpg is better issued with "--trust-model always". I have to check the code, but not today any more ;-)

        I think, the automatic checks for ownertrust on own keys should get a "don't show me this alert any more".

         
        • Ludwig Hügelschäfer

          Maybe the draft encryption call to gpg is better issued with "--trust-model always". I have to check the code, but not today any more ;-)

          "--trust-model always" during saving drafts is only issued, if you have set "To send encrypted accept -> all usable keys" (Part of "Convenient encryption). I think this should be changed and drafts should always use "--trust-model always". Actually this is a simplification of the code :-)

           
          • Ludwig Hügelschäfer

            Oh, Patrick was faster than me :-) Change is already comitted.

             
  • Martin Raiber

    Martin Raiber - 2015-05-18

    Yes, imported the key. Thanks!

     

Log in to post a comment.