I'm writing an Thunderbird extension that inserts some headers into a
mail directly before sending the mail. To do this, I registered a
listener for the "mail:composeOnSend" notification. Everything is
working fine so far, however, the observer is also called when the
user uses "Save As Draft/Template" or even when Thunderbird
automatically saves the message as a draft. This is not acceptable in
my case, because I need to pop up a screen to gather some information
and this should not happen during autosave.

I worked around this problem by examining the call stack and checking
the function names for /Save/ (MsgComposeCommands.js defines methods
like SaveAs{Draft|Template}, AutoSave, SendMessage{Later}?).

Is there a better way to solve this problem? I'm using Thunderbird btw.