Re: Tags and message body -- see msgHeader on TB

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

Re: Tags and message body -- see msgHeader on TB

dillinger-2
On 08/20/2017 01:11 AM, gNeandr wrote:
> As said tags are stored as part of the msgHeader and with using IMAP
> that is sync also to another account instance.
> (Test it with changing the tag on one and you see it on the other
> instance).
>
Where did you read that?
> You need to modify the messageHeader, have a look at:
>> https://dxr.mozilla.org/comm-central/search?q=folder.addKeywordsToMessages&redirect=false 
>>
Keywords are not tags. You would still need a filter to tag your
keyworded messags.

>
> You will get details how to add/delete tags.
>
>
> On 20.08.2017 00:27, dillinger wrote:
>
>> Tags (labels/flags) are stored on the IMAP server, I suppose not all
>> IMAP servers support this, mine, and apparently yours, does.
>> Thunderbird reads and writes those flags on the server, they are not
>> in the source of a message. This is how flags sync across clients.
>> You probably could recreate this writing of flags in your Perl script
>> but it seems a bit over the top to me.
>> Since the flags are synced anyway why not just create a filter to mark
>> those messages as important?
>>
Apparently I wasn't clear enough, tags are _not_ stored in the message.
There they are linked to the UID of the message as Slabel1, Slabel2 or
Swhatevever, just like the default flags like Seen Junk etc.
Thunderbird reads and writes those flags on the server, it does _not_
change or attach anything to the message.

 From my log, where $label2 is the tag I just added to the message with
UID 20717 and spock.lan is the server:

-6293760[7fc5ffa46100]: fe1ac000:spock.lan:S-[imap]/Info:SendData: 25
uid store 20717 +FLAGS ($label2)

-6293760[7fc5ffa46100]: ReadNextLine [stream=f9fcaa80 nb=46 needmore=0]
-6293760[7fc5ffa46100]:
fe1ac000:spock.lan:S-[imap]/Info:CreateNewLineFromSocket: * 70 FETCH
(FLAGS (\Seen $label2) UID 20717)

-6293760[7fc5ffa46100]: ReadNextLine [stream=f9fcaa80 nb=27 needmore=0]
-6293760[7fc5ffa46100]:
fe1ac000:spock.lan:S-[imap]/Info:CreateNewLineFromSocket: 25 OK UID
STORE completed

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

Re: Tags and message body -- see msgHeader on TB

dillinger-2
Please forget this post. Too much typos and in the wrong newsgroup. See
mozilla.support.thunderbird

On 08/20/2017 10:08 PM, dillinger wrote:

> On 08/20/2017 01:11 AM, gNeandr wrote:
>> As said tags are stored as part of the msgHeader and with using IMAP
>> that is sync also to another account instance.
>> (Test it with changing the tag on one and you see it on the other
>> instance).
>>
> Where did you read that?
>> You need to modify the messageHeader, have a look at:
>>> https://dxr.mozilla.org/comm-central/search?q=folder.addKeywordsToMessages&redirect=false 
>>>
> Keywords are not tags. You would still need a filter to tag your
> keyworded messags.
>>
>> You will get details how to add/delete tags.
>>
>>
>> On 20.08.2017 00:27, dillinger wrote:
>>
>>> Tags (labels/flags) are stored on the IMAP server, I suppose not all
>>> IMAP servers support this, mine, and apparently yours, does.
>>> Thunderbird reads and writes those flags on the server, they are not
>>> in the source of a message. This is how flags sync across clients.
>>> You probably could recreate this writing of flags in your Perl script
>>> but it seems a bit over the top to me.
>>> Since the flags are synced anyway why not just create a filter to
>>> mark those messages as important?
>>>
> Apparently I wasn't clear enough, tags are _not_ stored in the message.
> There they are linked to the UID of the message as Slabel1, Slabel2 or
> Swhatevever, just like the default flags like Seen Junk etc.
> Thunderbird reads and writes those flags on the server, it does _not_
> change or attach anything to the message.
>
>  From my log, where $label2 is the tag I just added to the message with
> UID 20717 and spock.lan is the server:
>
> -6293760[7fc5ffa46100]: fe1ac000:spock.lan:S-[imap]/Info:SendData: 25
> uid store 20717 +FLAGS ($label2)
>
> -6293760[7fc5ffa46100]: ReadNextLine [stream=f9fcaa80 nb=46 needmore=0]
> -6293760[7fc5ffa46100]:
> fe1ac000:spock.lan:S-[imap]/Info:CreateNewLineFromSocket: * 70 FETCH
> (FLAGS (\Seen $label2) UID 20717)
>
> -6293760[7fc5ffa46100]: ReadNextLine [stream=f9fcaa80 nb=27 needmore=0]
> -6293760[7fc5ffa46100]:
> fe1ac000:spock.lan:S-[imap]/Info:CreateNewLineFromSocket: 25 OK UID
> STORE completed
>

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

Re: Tags and message body -- see msgHeader on TB

gNeandr-13
On 21.08.2017 04:21, dillinger wrote:

> Please forget this post. Too much typos and in the wrong newsgroup. See
> mozilla.support.thunderbird
>
> On 08/20/2017 10:08 PM, dillinger wrote:
>> On 08/20/2017 01:11 AM, gNeandr wrote:
>>> As said tags are stored as part of the msgHeader and with using IMAP
>>> that is sync also to another account instance.
>>> (Test it with changing the tag on one and you see it on the other
>>> instance).
>>>
>> Where did you read that?

Please just test it with one message stored in TB and on an IMAP
account. If that IMAP account is used also on another PC with TB you
will see that message and you can follow 'tag/label' changes .. both
directions.
As said, just test it.


>>> You need to modify the messageHeader, have a look at:
>>>> https://dxr.mozilla.org/comm-central/search?q=folder.addKeywordsToMessages&redirect=false 
>>>>
>> Keywords are not tags. You would still need a filter to tag your
>> keyworded messags.

Not sure your answer is right, but we have used the mentioned code to
set tags/keywords with the XPI Reminderfox since years, and that works
perfectly.

Did you had a look at the code? One example is:
> https://dxr.mozilla.org/comm-central/source/mail/base/content/mailWindowOverlay.js#909
... and you will find this line:
> 999       msgHdr.folder.addKeywordsToMessages(msg, "$label" + msgHdr.label);

Here you have 'Keywords' and 'label'  .. and all that handles the
message tagging as you see them on the UI ... see above.

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

Re: Tags and message body -- see msgHeader on TB

dillinger-2
On 08/21/2017 10:34 AM, gNeandr wrote:

> On 21.08.2017 04:21, dillinger wrote:
>> Please forget this post. Too much typos and in the wrong newsgroup.
>> See mozilla.support.thunderbird
>>
>> On 08/20/2017 10:08 PM, dillinger wrote:
>>> On 08/20/2017 01:11 AM, gNeandr wrote:
>>>> As said tags are stored as part of the msgHeader and with using IMAP
>>>> that is sync also to another account instance.
>>>> (Test it with changing the tag on one and you see it on the other
>>>> instance).
>>>>
>>> Where did you read that?
>
> Please just test it with one message stored in TB and on an IMAP
> account. If that IMAP account is used also on another PC with TB you
> will see that message and you can follow 'tag/label' changes .. both
> directions.
> As said, just test it.
>
I did, and it works, the lines from my log show how Thunderbird talks to
the server. Please test it again yourself and compare the source of the
message you tag before and after you tagged it. On any client connected
to that server. You'll see no difference.

>
>>>> You need to modify the messageHeader, have a look at:
>>>>> https://dxr.mozilla.org/comm-central/search?q=folder.addKeywordsToMessages&redirect=false 
>>>>>
>>> Keywords are not tags. You would still need a filter to tag your
>>> keyworded messags.
>
> Not sure your answer is right, but we have used the mentioned code to
> set tags/keywords with the XPI Reminderfox since years, and that works
> perfectly.
>
> Did you had a look at the code? One example is:
>> https://dxr.mozilla.org/comm-central/source/mail/base/content/mailWindowOverlay.js#909 
>>
> ... and you will find this line:
>> 999       msgHdr.folder.addKeywordsToMessages(msg, "$label" +
>> msgHdr.label);
>
> Here you have 'Keywords' and 'label'  .. and all that handles the
> message tagging as you see them on the UI ... see above.
>
Afaict this describes how to make Thunderbird do what it does, it does
not describe how Thunderbird talks to the server, but I'm no wizard at
that, so I could be wrong.
The OP asked how to tag a message important by just adding a message
header through a Perl script, outside of Thunderbird.
Afaics, there is no way to do that.

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

Re: Tags and message body -- see msgHeader on TB

opto
In reply to this post by gNeandr-13

>
> Please just test it with one message stored in TB and on an IMAP
> account. If that IMAP account is used also on another PC with TB you
> will see that message and you can follow 'tag/label' changes .. both
> directions.
> As said, just test it.
>
>



as a matter of fact, not all IMAP servers store keywords.
That is optional in the RFC.
Hmailserver (free Windows IMAP server), for example, does not. There are long forums threads of people trying to convince them to do that.

This refers to the $label0 ... $label9 (wichtig/Important, ...,) those we can colour in the list with the number keys.
The flags (junk, read, etc.) I think are always stored on the server.

Keywords are not saved in the header. I actually wrote an addon to be able to extract tags/keywords from one TB/PC and copy it to a TB on another PC, because hmailserver does not store them.

I considered to put them into the header, but then, on replies, my email partners might see my keywords, if they look at the header. That is not desirable.
_______________________________________________
dev-apps-thunderbird mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-thunderbird