Thunderbird - cancel sending mail

Talk about add-ons and extension development.
Post Reply
mpawlak
Posts: 16
Joined: February 24th, 2008, 4:48 am
Location: Gliwice, Poland
Contact:

Thunderbird - cancel sending mail

Post by mpawlak »

Hi,

I am writing some code that is executed after the "Send" button has been pressed in the composition Window. I am verifying the receiver's certificate in code that is executed in verificationListener. If I detect that the certificate is revoked, I want to cancel sending the message. I tried calling window.close(). This closed the composition window. However, I cannot view any messages after doing that.

Is there a safe way to cancel sending a message?

Thank you,
Marek Pawlak
User avatar
Rod Whiteley
Posts: 11480
Joined: December 6th, 2004, 3:41 am
Location: UK

Re: Thunderbird - cancel sending mail

Post by Rod Whiteley »

The design seems to be that you use the compose-send-message event to run your code, and call its preventDefault if you need to stop the message. See: http://mxr.mozilla.org/comm-central/sou ... ds.js#1815
Rod
mpawlak
Posts: 16
Joined: February 24th, 2008, 4:48 am
Location: Gliwice, Poland
Contact:

Re: Thunderbird - cancel sending mail

Post by mpawlak »

Thank you Rod!

At first, I put my changes in MsgComposeCommands.js but in the end I decided to call onCancel from SendProgress.js
Your suggestion was very helpful and certainly pointed me in the right direction

Marek
Post Reply