Thunderbird add-on - transfer headers when replying an email

Hello all !

I am developing an add-on for Thunderbird in which I create my own header. This header can have different value depending of the situation.

If I receive an email with this header and I decide to reply to this email, I would like to transfer this header to my reply email in order to display it in the “MsgHeadersToolbar” using Javascript.

I know how to create my custom field in the “MsgHeadersToolbar” but I don’t know if it is possible to transfer a header. Do you have any advice about this ?

I have seen the Gloda API but I am not sure if it will be useful in this situation :

Regards,

1 Like

Sounds like some cool work you’re doing. I havent seen too many thunderbird devs here, but I think there were some over here: http://forums.mozillazine.org/viewforum.php?f=19

Yes, it is very interesting but not very easy. Thank you for the link, I will go on Mozillazine.

Let us know how it goes man, not getting help for days when you need it is a horrible feeling

Don’t worry, I have maybe find an idea to solve my problem and I’ll post it if it works well.

If no, well I’ll keep looking for a solution. =)

I have finally find a solution by using the FUEL library. It has a storage property which can store data globally and allow the user to get them in another xul page.

To set a data:

And to get this data:

Where “data” is the data you want to store, “keyname” is the string used to identify the data and “default” is the value to return if keyname does not exists.

For more informations:

And thank you for your support Noitidart ! :smile:

The FUEL library is deprecated, so I suggest you look into alternatives.

Ok, I’ll try looking around the Add-on SDK.

What is the high level goal you are attempting to accomplish with your header?

Headers are public to anyone who has received the message, so if the functionality is really only for your user, then the global database may be a more appropriate mechanism for you to use if you just want to understand the relationship between the replied-to message and the reply because the global database establishes conversation relationships, allowing you to easily access the other messages in the conversation. Then, any additional local-only properties (or private-to-the-user’s IMAP server IMAP tags/labels) you set on the nsIMsgDBHdr can be accessed.

If you really want to propagate public header information to a reply, you are going to want to hook the compose process.

These headers are here to be public to anyone and to allow the sender and receiver to manage their mails depending of the value of these headers.
So I am more interested in the compose process.