[Enigmail] Extension to avoid signing on certain mails

Patrick Brunschwig patrick at mozilla-enigmail.org
Fri Feb 20 00:08:29 PST 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Marius Storm-Olsen wrote:
> Hi guys,
> 
> I'm working on an extension which will send a certain type
> of mails, which should never be signed. However, I'm
> struggling with getting the .js code right to turn off the
> PGP signing.
> 
> Right now I have something like
>    window.addEventListener('compose-send-message', checkSigning, true);
> 
> where    checkSigning: function() {
>        var signing_on = false;
>        try {
>            if
> (document.getElementById("enigmail_signed_send").getBoolAttribute("checked"))
> {
>                enigSetSendMode('toggle-sign');
>            }
>        } catch (e) {}
>    },
> 
> as I couldn't see any particular way for other extensions
> to query the signing state, and setting it. However, the
> code above fails miserably. Any input on how I can
> correctly handle this?
> 
> My configuration is
>  extensions.enigmail.confirmBeforeSend = false
>  extensions.enigmail.disableSMIMEui    = false
>  extensions.enigmail.displaySignWarn   = false
>  mail.identity.id1.pgpSignPlain        = true
> 
> and I want my extension to only automatically turn off
> the signing for *this particular mail type*, even if
> my mail.identity says that I'm supposed to be signing
> them.
> 
> Thanks for any input!

I think the main problem for your listener is that it's not defined if
it should be run before or after the event listener that Enigmail
specified. There is no guarantee of any sequence.

If I were you, I'd hook on some other event that is triggered earlier,
like observing "mail:composeOnSend".

In addition, I'd make sure you also activate the option to ignore
per-recipient rules. But as John said: you may be better off by just
using the per-recipient rules ...

- -Patrick
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEVAwUBSZ5k/HcOpHodsOiwAQjIKwf+LYY0vO4TbaPzh2ngbRCquX/Yl0L1Wj+i
KocxcAwbwvmpL5dgd2ugeqe355WvrCPoE3TLsM+hMvRbOF9dff40EQ+luseMdTh4
RVvoeLHtHJG1vNAkk9vL7QYGWFXy4tYGXSSoc1MIKPrkJFxHkf7j9p0xnI3COROE
2vwFlS0t290bOpbASYvti7lfB5ZVl5phsd4lc5/gJOIFlJQlFypXJweEauFuqxW9
YQkCK+NYFb9WeViO5jbj/dZ2N5/bFuYMo5yDdkaFCKVbH55Jiu8E15uNL4vfXMbG
qlocztVwvPRI25WnOmjim2F1hf4DJrrq3TBcyvAJk0zChYSuLWx2/Q==
=9ktC
-----END PGP SIGNATURE-----


More information about the Enigmail mailing list