Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to add custom header properties

24 views
Skip to first unread message

Stanciu Andrei

unread,
Aug 14, 2007, 6:41:47 AM8/14/07
to
Hi,

I need to add a new line in email header. It would be great if I can do this
from javascript, but if it's impossible I can use c++ too.
Also, the line I want to add is something that is unique for the email, so
will change from mail to mail.

Tnx

--

Best Regards,
Andrei Stanciu


David Bienvenu

unread,
Aug 14, 2007, 12:41:33 PM8/14/07
to
Do you want to do this for messages you receive, or messages you send?

- David

Stanciu Andrei

unread,
Aug 15, 2007, 5:53:10 AM8/15/07
to
The message that are already received.
So I parse a mail folder and want to add this custom line in header.

Tnx

--

Best Regards,
Andrei Stanciu
"David Bienvenu" <bien...@mozilla.com> wrote in message
news:--KdnbmPj4OgRlzb...@mozilla.org...

David Bienvenu

unread,
Aug 15, 2007, 6:56:17 PM8/15/07
to
Stanciu Andrei wrote:
> The message that are already received.
> So I parse a mail folder and want to add this custom line in header.
>
> Tnx
>
>
You're looking at rewriting the whole mailbox, adding a header to each
message? That would involve parsing the mailbox, reading each message,
writing each message with the header added to a new mailbox, and copying
the new mailbox over the original, and causing the db to get
regenerated. You might look at the nsMsgFolderCompactor.cpp code, which
does something similar - it adds an x-mozilla-keys header to messages
that don't have one.

But why do you want to do this, instead of just adding a property to the
msg hdr in the .msf file? Does this new header really need to be in the
mailbox file itself?

- David

Stanciu Andrei

unread,
Aug 16, 2007, 8:13:41 AM8/16/07
to
OK, maybe if I explain what my extension do it will be more clear :).

I developed a software that makes incremental backup to e-mails. So I have
an external application
that communicates with my Thunderbied extension and ask for a e-mail to be
exported, imported, etc.
The incremental part is that if i make a backup first time, the second time
I will get only the new emails.
To do that I make a unique signature on the parts of the e-mail everytime I
need to get the new emails.

Now, my purpose is to make this signature once and save it in the e-mail
header, so it can survive to
export / import. From JS I saw that I cannot get the fileStream and there
was a comment there that it's
deprecated and should not be used.

--

Best Regards,
Andrei Stanciu
"David Bienvenu" <bien...@nventure.com> wrote in message
news:WeGdnRC9m84cGV7b...@mozilla.org...

David Bienvenu

unread,
Aug 17, 2007, 5:28:08 PM8/17/07
to
Stanciu Andrei wrote:
> OK, maybe if I explain what my extension do it will be more clear :).
>
> I developed a software that makes incremental backup to e-mails. So I have
> an external application
> that communicates with my Thunderbied extension and ask for a e-mail to be
> exported, imported, etc.
> The incremental part is that if i make a backup first time, the second time
> I will get only the new emails.
> To do that I make a unique signature on the parts of the e-mail everytime I
> need to get the new emails.
This could be stored as a property on the msg hdr. For the case of the
.msf file getting deleted, you could use the message-id as a backup.
Message-id's should be unique, so if you already have a backup of a
message with a given message-id, then it's backed up.

For restoring, you can set a property on the mesage hdr after you
restore the message.

Rewriting anything onto the message itself is going to be problematic
for local messages, since you need to either rewrite the whole folder,
or make a copy of the message and put it at the end of the mailbox, and
its worse for imap messages.

- David

0 new messages