I need to intercept all mail sent by Thunderbird and block sending if there is a predefined string in the mail body. It should be a part of our already existing XPCOM dll addon.
Do you have any ideas how to implement it?
I need to intercept all mail sent by Thunderbird and block sending if there is a predefined string in the mail body. It should be a part of our already existing XPCOM dll addon.
Do you have any ideas how to implement it?
function send_event_handler( evt ) {
var msgcomposeWindow = document.getElementById( "msgcomposeWindow" );
var msg_type = msgcomposeWindow.getAttribute( "msgtype" );
// do not continue unless this is really an actual send event
if( !(msg_type == nsIMsgCompDeliverMode.Now || msg_type == nsIMsgCompDeliverMode.Later) )
return;
// do what ever you want to do here
}
// here is the listener
window.addEventListener( "compose-send-message", send_event_handler, true );