how to uniquely identify messages on Imap from two TB instances?

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

how to uniquely identify messages on Imap from two TB instances?

opto
In short, I want to transfer tags from one TB on PC1 to another TB on PC2 - both listen to the same IMAP server.

(recently, I lost my tags several times when TB crashed on one PC only, and my IMAP server does not save keywords or custom flags, so all tags were gone after rebulding the mailbox).

Are message ID's unique in IMAP? Or more specific: what happens on copy or move of a message? Does copy result in a new messageID?

If unique, I probably would just need to import a list of messageID versus applicable tags on PC2 and have my extension set the tags there.

any help is appreciated,

Klaus
_______________________________________________
dev-apps-thunderbird mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-thunderbird
Reply | Threaded
Open this post in threaded view
|

Re: how to uniquely identify messages on Imap from two TB instances?

opto
I just found that I can test messageId from error console by: parent.opener.gFolderDisplay.selectedMessage.subject

unfortunately, copying a message to another folder preserves the messageId. So how can I distinguish between those 2 messages (original and copy)?

_______________________________________________
dev-apps-thunderbird mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-thunderbird
Reply | Threaded
Open this post in threaded view
|

Re: how to uniquely identify messages on Imap from two TB instances?

opto
In reply to this post by opto
for whoever may be interested: the errorconsole method is really good to try all attributes.

MessageID and folder.folderURL together seem to be unique.
_______________________________________________
dev-apps-thunderbird mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-thunderbird
Reply | Threaded
Open this post in threaded view
|

Re: how to uniquely identify messages on Imap from two TB instances?

Jim Porter
In reply to this post by opto
On 02/20/2017 04:59 PM, opto wrote:
> In short, I want to transfer tags from one TB on PC1 to another TB on PC2 - both listen to the same IMAP server.

Your IMAP server should do this automatically. Unless I'm horribly
mistaken, when you tag a message in TB, it sends that info to the IMAP
server which stores it on the message (assuming the IMAP server supports
that feature, but most of them should). I'm pretty sure it doesn't store
the name/color of the tag though, so you have to manually sync your list
of available tags on all your TB instances.

- Jim
_______________________________________________
dev-apps-thunderbird mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-thunderbird
Reply | Threaded
Open this post in threaded view
|

Re: how to uniquely identify messages on Imap from two TB instances?

opto
In reply to this post by opto
Jim,

thanks for the answer. Storing custom flags is optional in IMAP, and I have that one server (hmailserver) which does not do it.

It is the only free IMAP server om Windows. So it seems I either have to learn Linux to switch the IMAP server or make code to sync the tags myself.

Well, it's a choice, but starting with something on Linux that is connected to the internet doesn't seem to be a wise choice, until I learn more about security.

thanks,

Klaus
_______________________________________________
dev-apps-thunderbird mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-thunderbird
Reply | Threaded
Open this post in threaded view
|

Re: how to uniquely identify messages on Imap from two TB instances?

Jim Porter
On 02/21/2017 12:42 PM, opto wrote:
> thanks for the answer. Storing custom flags is optional in IMAP, and I have that one server (hmailserver) which does not do it.

It looks like hMailServer is open source, so maybe you could add flag
support to it? I'm not sure how that compares in difficulty to writing a
Thunderbird add-on, but it'd certainly work on a wider variety of mail
clients.

- Jim
_______________________________________________
dev-apps-thunderbird mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-thunderbird
Reply | Threaded
Open this post in threaded view
|

Re: how to uniquely identify messages on Imap from two TB instances?

opto
In reply to this post by opto
There is a rather unfriendly (maybe not the right word, but English is not my native language) discussion on this feature in their forums https://www.hmailserver.com/forum/viewtopic.php?t=15794 which does not really invite to submit code for a feature they don't want.

Klaus
_______________________________________________
dev-apps-thunderbird mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-thunderbird
Reply | Threaded
Open this post in threaded view
|

Re: how to uniquely identify messages on Imap from two TB instances?

Joshua Cranmer 🐧
In reply to this post by opto
On 2/20/2017 4:59 PM, opto wrote:
> In short, I want to transfer tags from one TB on PC1 to another TB on PC2 - both listen to the same IMAP server.
>
> (recently, I lost my tags several times when TB crashed on one PC only, and my IMAP server does not save keywords or custom flags, so all tags were gone after rebulding the mailbox).
>
> Are message ID's unique in IMAP? Or more specific: what happens on copy or move of a message? Does copy result in a new messageID?

Message ID's are not sufficiently unique to uniquely identify messages,
as you discovered. IMAP folders do have a unique identifier per message,
the IMAP UID, although this can be ephemeral: the mailbox can decide to
throw these away and change them all without prior notice.

--
Joshua Cranmer
Thunderbird and DXR developer
Source code archæologist

_______________________________________________
dev-apps-thunderbird mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-thunderbird
Reply | Threaded
Open this post in threaded view
|

Re: how to uniquely identify messages on Imap from two TB instances?

opto
In reply to this post by opto
Can I access the IMAP UID from TB? In something derived from a message header, for example?

To check for IMAP UID and messageID would be better that check for messageID and folder, because it is independent on where the message is moved in the foldertree.

And by crosschecking IMAP UID versus messageID, I would see if the server has reissued the IMAP UID's. So the only question is whether TB has the IMAP UID for a message.

Klaus
_______________________________________________
dev-apps-thunderbird mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-thunderbird
Reply | Threaded
Open this post in threaded view
|

Re: how to uniquely identify messages on Imap from two TB instances?

Jim Porter
In reply to this post by opto
On 02/22/2017 01:25 AM, opto wrote:
> There is a rather unfriendly (maybe not the right word, but English is not my native language) discussion on this feature in their forums https://www.hmailserver.com/forum/viewtopic.php?t=15794 which does not really invite to submit code for a feature they don't want.

It sounds like they just want a citation for where the feature is
defined in an RFC, but as I understand it, that's defined in the IMAP
RFC (3501): <https://tools.ietf.org/html/rfc3501#section-2.3.2>. Here's
a relevant excerpt:

   A keyword is defined by the server implementation.  Keywords do not
   begin with "\".  Servers MAY permit the client to define new keywords
   in the mailbox (see the description of the PERMANENTFLAGS response
   code for more information).

- Jim

_______________________________________________
dev-apps-thunderbird mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-thunderbird