OfflineIMAP / offlineimap3

Read/sync your IMAP mailboxes (python3)
Other
452 stars 64 forks source link

IMAP flags/keywords case sensitivity/aliases #209

Open taam opened 1 month ago

taam commented 1 month ago

General informations

Configuration file offlineimaprc (requires code modifications, does not work with current versions)

[...]

[Repository local]
customflag_a = NonJunk
customflag_a_1 = nonjunk
customflag_b = Junk
customflag_b_1 = junk
customflag_b_2 = $Junk
[...]

Steps to reproduce the error

When using the customflag_x feature to sync IMAP flags/keywords, they are currently treated to be case-sensitive. It seems the IMAP specification is not very explicit about this, but I've found various discussions, where the conclusion seems to be, that they should be case-insensitive. And indeed I'm finding on my various accounts common keywords in different variants, in particular NonJunk and Junk. I seems the correct behavior would be to map them to the same flag, so case-independent.

In order to achieve this, I'm using a custom version with a very simple patch, allowing a configuration as shown above, effectively allowing additional keywords for the same char. This is o.c. a bad hack. I see two possible solutions here (none-mutual exclusive):

This is also related to https://github.com/OfflineIMAP/offlineimap3/issues/85, which unfortunately is not yet implemented it seems. (I personally use offlineimap to create backups of my IMAP accounts, so syncing the IMAP flags/keywords currently is somewhat futile, since I couldn't restore them anyway, at least not for now.) A fix for this should probably keep in mind, how the custom flag would later be restored on the IMAP side.

taam commented 1 month ago

Somewhat related side notes: