Skip to content

[contribution] Script for toggling (GPG) signing a message #346

@araujorm

Description

@araujorm

Hello.

I made the following script for toggling signing (GPG) a message. Possible arguments: on/off (if empty will toggle current state, otherwise forces the message to be signed or not) . Tested successfully on Thunderbird 102.10.0 (Linux, but I don't see any reason for it not to work on every other platform).

Here's the script (I've called it ToggleSignMessage which seems appropriate to me but feel free to name otherwise):

let type = this.mVariables[0];

var win = this.mWindow;

if ( type == null ||
     (type == "on" && !win.gSendSigned) ||
     (type == "off" && win.gSendSigned) ) {
  win.toggleGlobalSignMessage();
}

Basic usage:

[[SCRIPT=ToggleSignMessage|off]]
[[SCRIPT=ToggleSignMessage|on]]
[[SCRIPT=ToggleSignMessage]]

An example follows that I find useful to report spam to a certain service. My identity (GPG) signs messages but default, but the signature attachment could be misinterpreted by that service since they want us to attach the message (forwarded as an attachment). So I made this quicktext template to quickly fill the From and To fields, while also disabling the GPG signing of that message when forwarding a spam message as an attachment. Hope it is useful to somebody else.

[[SCRIPT=Identity|setIdentity|id1]][[SCRIPT=ToggleSignMessage|off]][[SCRIPT=RemoveRecipients|all]][[SCRIPT=AddRecipients|to|spam-report@service-address.domain]]

Please feel free to add the above script to the contributed community scripts, and the same for the example on the wiki if you want.

Thanks for you work.

Edited: simplified the script

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions