maildir custom fields

All things Programming
Post Reply
User avatar
antae
Director of Sandbags
Posts: 431
Joined: Sat Dec 19, 2020 8:49 am

maildir custom fields

Post by antae »

Hello All,

Is it possible to store custom fields for each message in Maildir ?

Outlook gives me two fields - messageID and changeKey - these fields are required when communicating over Graph API, for example, fetch email or set its status to read. And their values too long to be encoded into file name.
My opinion ^_^ may differ from yours. That's OK. Difference makes us humans, not robots.
User avatar
Henry Crunn
Site Admin
Posts: 451
Joined: Fri Dec 18, 2020 2:04 pm
Location: 56N 3W

Re: maildir custom fields

Post by Henry Crunn »

Tell us the problem your want to solve rather than ask for help with your perceived solution.
--
You can't get the wood.
You can't get the 'shiver me timbers' wood' you know.
User avatar
antae
Director of Sandbags
Posts: 431
Joined: Sat Dec 19, 2020 8:49 am

Re: maildir custom fields

Post by antae »

I need to sync emails from office365 to local computer when IMAP/POP3 are not available. Something similar to mbsync but over different protocol.
I can retrieve emails using either Exchange protocol EWS SOAP/XML or MS Graph API (message json representation).
Their APIs use unique identifiers for emails. When I fetch an email, I need to remember that unique external identifier for later use, so I can send updates back to the server after the email was changed by email client locally. Example how to fetch emails via Graph API
Most suitable form of local store is Maildir. mutt, gnus, thunderbird - they work with Maildir folders natively.
My current approach: keep in SQLite3 the mapping external_id <-> file name + folder in Maildir directory.
I'm not sure the middle layer SQLite3 is really needed and I hope there's a trick or feature in Maildir so I can store external_ids without additional database.
My opinion ^_^ may differ from yours. That's OK. Difference makes us humans, not robots.
Post Reply