[MlMt] Where is message flag color information kept?

Philip Paeps philip at trouble.is
Thu Jul 15 09:30:13 EDT 2021


On 2021-07-15 20:25:41 (+0800), Greg Earle wrote:
> I'm trying to migrate my mail server at work and have come across 
> something I don't understand.
>
> If I mark messages in my work e-mail account (in MailMate) with 
> red/yellow/green etc., MailMate running on my home Mac and my work Mac 
> correctly see the colors.
>
> Also, if I run Apple Mail on either my home Mac or my work Mac, they 
> also correctly see the colors on both systems.  This made me think at 
> first that the flag color information must be in the filename if not 
> metadata in the message file itself.
>
> But if I rsync my Maildirs from my old Ops mail server (Courier) to my 
> new Dev mail server (Postfix+Dovecot), both MailMate and Apple Mail 
> see every flagged message on the new server as being red - all the 
> yellow/green/etc. color differential/subtlety is getting lost 
> somewhere.
>
> I verified that the mail message files have the same exact filename, 
> size and checksum on both servers - so clearly the flag color can't be 
> kept in the file or the filename?
>
> I don't get it - how do Apple Mail and MailMate know about each 
> other's colors (yes I know MailMate implements Apple Mail's flag 
> setup), but if you copy the message to a different server and it's 
> correctly preserved, the color information is lost?
>
> tl;dr: Where do MailMate/Apple Mail store the flag color info for each 
> message?

Both MailMate and Apple Mail store their flags as IMAP keywords.  
Apparently they agree on which keywords to use for which colours.

Dovecot stores the keywords as letters in the filename and uses a 
dovecot-keywords file in the Maildir to map those letters to IMAP 
keywords.  Courier stores the keywords in a file per flagged message in 
a courierimapkeywords directory in the Maildir.

https://doc.dovecot.org/admin_manual/mailbox_formats/maildir/
http://www.courier-mta.org/imap/README.imapkeywords.html

Both implementations set \Flagged, so without further information, 
you'll see the generic colour flag on the messages you rsynced.

You'll have to construct a dovecot-keywords file from the 
courierimapkeywords to get the colours back.  I once wrote a script to 
do something very similar to this ... but I don't seem to have it 
anymore.  I don't remember it being very difficult to write though.

I hope this helps.

Philip

-- 
Philip Paeps
Senior Reality Engineer
Alternative Enterprises
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freron.com/pipermail/mailmate/attachments/20210715/8e96d5ed/attachment.htm>


More information about the mailmate mailing list