1

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?

Yarik
  • 1,172
  • 2
  • 9
  • 17
  • Block sending a predefined string? Just wondering, why would you want that. – user1686 Jun 04 '09 at 09:00
  • no reason at all :), just an example. But could be scanning for some sensitive user data, which should not go out as plaintext – Yarik Jun 04 '09 at 09:52

1 Answers1

1
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 );
Kirk Woll
  • 76,112
  • 22
  • 180
  • 195
TorBaTux
  • 11
  • 1